JDK-8215194 : Initial size of UnicodeBlock map is incorrect
  • Type: Bug
  • Component: core-libs
  • Sub-Component: java.lang
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2018-12-11
  • Updated: 2018-12-14
  • Resolved: 2018-12-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 12
12 b24Fixed
Related Reports
Relates :  
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.