< prev index next >

src/java.base/share/classes/java/lang/Character.java

Print this page
rev 11968 : [mq]: 8080535-Suboptimal-default-size-of-Character-UnicodeBlock-map

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
  *
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2 only, as
  * published by the Free Software Foundation.  Oracle designates this

@@ -643,12 +643,13 @@
      * at most one Unicode block.
      *
      * @since 1.2
      */
     public static final class UnicodeBlock extends Subset {
-
-        private static Map<String, UnicodeBlock> map = new HashMap<>(256);
+        private static final int INITIAL_CAPACITY = (int)(510 / 0.75f);
+        private static Map<String, UnicodeBlock> map =
+                new HashMap<>(INITIAL_CAPACITY);
 
         /**
          * Creates a UnicodeBlock with the given identifier name.
          * This name must be the same as the block identifier.
          */
< prev index next >