-
Notifications
You must be signed in to change notification settings - Fork 6.1k
8370160: NumericShaper allows illegal ranges #27884
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
👋 Welcome back prr! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
private NumericShaper(int key, int mask) { | ||
this.key = key; | ||
this.mask = mask; | ||
this.mask = mask & (CONTEXTUAL_MASK | ALL_RANGES); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that this will accept the CONTEXTUAL_MASK even if it was provided by the app. It is unclear whether we should discard it in that case or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is always added by the implementation when constructing a contextual shaper.
So when we get here it is always part of the mask argument.
The only path that gets here without a contextual shaper bit set is the single range case.
But it the app has set that there an IAE is thrown, so it can't happen.
This is a follow-on to 8365077: java.awt.font.NumericShaper violates equals/hashCode contract
The factory method to construct a contextual shaper from a bitmask will happily store illegal, unspecified bits.
So there are still ways to create instances which violate the contract.
This isn't possible with the enum approach. We should align these two. And we should document it.
Additionally the behaviour of eliminating an value which is of lesser precedence is also something we should specify.
CSR : https://bugs.openjdk.org/browse/JDK-8370161
Progress
Issues
Reviewers
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27884/head:pull/27884
$ git checkout pull/27884
Update a local copy of the PR:
$ git checkout pull/27884
$ git pull https://git.openjdk.org/jdk.git pull/27884/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27884
View PR using the GUI difftool:
$ git pr show -t 27884
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27884.diff
Using Webrev
Link to Webrev Comment