8215194: Initial size of UnicodeBlock map is incorrect

Reviewed-by: rriggs, rgoel, igerasim
This commit is contained in:
Naoto Sato 2018-12-11 13:13:18 -08:00
parent 7cea6f6ac2
commit c2364ff9e0
2 changed files with 16 additions and 4 deletions

View file

@ -681,11 +681,12 @@ class Character implements java.io.Serializable, Comparable<Character> {
*/
public static final class UnicodeBlock extends Subset {
/**
* 649 - the expected number of entities
* 667 - the expected number of entities
* 0.75 - the default load factor of HashMap
*/
private static final int NUM_ENTITIES = 667;
private static Map<String, UnicodeBlock> map =
new HashMap<>((int)(649 / 0.75f + 1.0f));
new HashMap<>((int)(NUM_ENTITIES / 0.75f + 1.0f));
/**
* Creates a UnicodeBlock with the given identifier name.