< prev index next >
src/java.base/share/classes/java/lang/Character.java
Print this page
rev 52948 : 8215194: Initial size of UnicodeBlock map is incorrect
Reviewed-by: rriggs, rgoel
@@ -679,15 +679,16 @@
*
* @since 1.2
*/
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 MAP_CAPACITY = (int)(667 / 0.75f + 1.0f);
private static Map<String, UnicodeBlock> map =
- new HashMap<>((int)(649 / 0.75f + 1.0f));
+ new HashMap<>(MAP_CAPACITY);
/**
* Creates a UnicodeBlock with the given identifier name.
* This name must be the same as the block identifier.
*/
< prev index next >