8081027: Create a common test to check adequacy of initial size of static HashMap/ArrayList fields

Reviewed-by: martin
This commit is contained in:
Ivan Gerasimov 2015-05-29 19:20:22 +03:00
parent 5fe4d18385
commit 97f5b473ec
8 changed files with 361 additions and 79 deletions

View file

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