<i18n dev> RFR: 8283465: Character.UnicodeBlock.NUM_ENTITIES is out of date

Stuart Marks smarks at openjdk.java.net
Tue Mar 22 21:46:40 UTC 2022


On Tue, 22 Mar 2022 18:44:09 GMT, Naoto Sato <naoto at openjdk.org> wrote:

> Fixing the out-of-date number of entries in `Character.UnicodeBlock.NUM_ENTITIES` field. The regression test has been renamed and now repurposed just to examine whether the `NUM_ENTITIES` correctly has the `map.size()` value.

Thanks for doing this! I was going to offer to do this myself but you beat me to it. Rewritten test looks great.

src/java.base/share/classes/java/lang/Character.java line 740:

> 738:     public static final class UnicodeBlock extends Subset {
> 739:         /**
> 740:          * 737 - the expected number of entities

Just a quibble about this comment... it's probably not worth repeating the actual value. But it probably is worth mentioning that the actual value should (or must) match the number of entries added to the map by constructors called from the static initializers in this class. Whenever aliases or new blocks are added, this number must be adjusted.

-------------

Marked as reviewed by smarks (Reviewer).

PR: https://git.openjdk.java.net/jdk/pull/7909


More information about the i18n-dev mailing list