Skip to content

Conversation

prrace
Copy link
Contributor

@prrace prrace commented Oct 18, 2025

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

  • Change must be properly reviewed (1 review required, with at least 1 Reviewer)
  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change requires CSR request JDK-8370161 to be approved

Issues

  • JDK-8370160: NumericShaper allows illegal ranges (Bug - P4)
  • JDK-8370161: NumericShaper allows illegal ranges (CSR)

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

@bridgekeeper
Copy link

bridgekeeper bot commented Oct 18, 2025

👋 Welcome back prr! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Oct 18, 2025

❗ This change is not yet ready to be integrated.
See the Progress checklist in the description for automated requirements.

@openjdk openjdk bot changed the title 8370160 8370160: NumericShaper allows illegal ranges Oct 18, 2025
@openjdk openjdk bot added csr Pull request needs approved CSR before integration client [email protected] labels Oct 18, 2025
@openjdk
Copy link

openjdk bot commented Oct 18, 2025

@prrace The following label will be automatically applied to this pull request:

  • client

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing list. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added the rfr Pull request is ready for review label Oct 18, 2025
@mlbridge
Copy link

mlbridge bot commented Oct 18, 2025

Webrevs

private NumericShaper(int key, int mask) {
this.key = key;
this.mask = mask;
this.mask = mask & (CONTEXTUAL_MASK | ALL_RANGES);
Copy link
Member

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.

Copy link
Contributor Author

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

client [email protected] csr Pull request needs approved CSR before integration rfr Pull request is ready for review

Development

Successfully merging this pull request may close these issues.

2 participants