Description
The initial load size for UnicodeBlock.map is currently 649 as follows:
---
public static final class UnicodeBlock extends Subset {
/**
* 649 - the expected number of entities
* 0.75 - the default load factor of HashMap
*/
private static Map<String, UnicodeBlock> map =
new HashMap<>((int)(649 / 0.75f + 1.0f));
---
However, actually it is 667 in the latest 12 build. The discrepancy comes from incorrect upgrading of Unicode version, which did not count for extra aliases.
Although this does not affect the actual performance (HashMap aligns initial capacity to a power of 2 size (= 1024 in both cases), this fix is desired for correctness.
---
public static final class UnicodeBlock extends Subset {
/**
* 649 - the expected number of entities
* 0.75 - the default load factor of HashMap
*/
private static Map<String, UnicodeBlock> map =
new HashMap<>((int)(649 / 0.75f + 1.0f));
---
However, actually it is 667 in the latest 12 build. The discrepancy comes from incorrect upgrading of Unicode version, which did not count for extra aliases.
Although this does not affect the actual performance (HashMap aligns initial capacity to a power of 2 size (= 1024 in both cases), this fix is desired for correctness.
Attachments
Issue Links
- relates to
-
JDK-8209923 Unicode 11
- Resolved