RFR: 8370160: NumericShaper allows illegal ranges
Prasanta Sadhukhan
psadhukhan at openjdk.org
Thu Oct 30 06:14:03 UTC 2025
On Sat, 18 Oct 2025 05:05:48 GMT, Phil Race <prr at openjdk.org> wrote:
> 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
Marked as reviewed by psadhukhan (Reviewer).
src/java.desktop/share/classes/java/awt/font/NumericShaper.java line 1446:
> 1444: * Any bit set in the {@code ranges} bitmask which is not a
> 1445: * recognised value is discarded. Similarly if two bits are
> 1446: * specified where one takes precedence, the lesser one is discarded.
should we mention "take precedence over the other" to be consistent with other updated javadoc?
src/java.desktop/share/classes/java/awt/font/NumericShaper.java line 1467:
> 1465: *
> 1466: * If two ranges are specified where one takes precedence over the
> 1467: * other the lesser range is discarded.
shouldn't there be a "," after other?
-------------
PR Review: https://git.openjdk.org/jdk/pull/27884#pullrequestreview-3397575640
PR Review Comment: https://git.openjdk.org/jdk/pull/27884#discussion_r2476528313
PR Review Comment: https://git.openjdk.org/jdk/pull/27884#discussion_r2476527196
More information about the client-libs-dev
mailing list