[java] Deduplicate Unicode PUA mappings in Keys; make OPTION an alias of ALT and deprecate FN#17147
[java] Deduplicate Unicode PUA mappings in Keys; make OPTION an alias of ALT and deprecate FN#17147seethinajayadileep wants to merge 3 commits intoSeleniumHQ:trunkfrom
Conversation
PR TypeBug fix Description
|
| Relevant files | |||
|---|---|---|---|
| Bug fix |
|
PR Compliance Guide 🔍Below is a summary of compliance checks for this PR:
Compliance status legend🟢 - Fully Compliant🟡 - Partial Compliant 🔴 - Not Compliant ⚪ - Requires Further Human Verification 🏷️ - Compliance label |
|||||||||||||||||||||||
PR Code Suggestions ✨Explore these optional code suggestions:
|
|||||||||
There was a problem hiding this comment.
Good for me.
@seethinajayadileep
Isn't there a risk that somebody is already using constant Keys.FN?
What would be a workaround for them?
You’re right — removing Keys.FN would be a source-breaking change for anyone already referencing it. Even though FN is not part of the W3C WebDriver specification and doesn’t have reliable driver support, existing code may still compile against it. A safer approach would be to keep FN for backward compatibility and mark it as @deprecated, documenting that it is symbolic only and not part of the standardized key set. That way existing users are not broken, but future usage is discouraged. I can update the PR accordingly. |
💥 What does this PR do?
Removes duplicate Unicode Private Use Area (PUA) mappings in
org.openqa.selenium.Keys.OPTIONto be an alias ofALTusingOPTION(Keys.ALT)instead of duplicatingRIGHT_ALT(\uE052).FNinto a deprecated alias ofRIGHT_CONTROLusingFN(Keys.RIGHT_CONTROL)instead of directly mapping\uE051.🔧 Implementation Notes
Keys.getKeyFromUnicode()returns the first matching enum value. When multiple enum constants share the same Unicode PUA value:This change ensures that each Unicode PUA value maps to a single canonical key.
OPTIONremains a platform-friendly alias without introducing a duplicate Unicode value.FNis retained for backward compatibility but deprecated. It now delegates toRIGHT_CONTROLinstead of defining its own duplicate Unicode value.💡 Additional Considerations
🔄 Types of changes