summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPekka Enberg <penberg@kernel.org>2011-02-22 16:09:41 +0000
committerPekka Enberg <penberg@kernel.org>2011-02-22 16:09:41 +0000
commit91debbc6aae04e6201172303bdb8be952058301a (patch)
tree19505f4df78a1b54c3d35e19f862b68992ec7630
parenteace3ded0136a5bbe99eef4d0bbb13798c38f99a (diff)
downloadclasspath-91debbc6aae04e6201172303bdb8be952058301a.tar.gz
Bump up HashMap default initial capacity
While debugging Jython bootstrap issues with GNU Classpath, I noticed that HashMap.DEFAULT_CAPACITY is set to 11 although Java 1.4 has it as 16. 2011-02-22 Pekka Enberg <penberg@kernel.org> * java/util/HashMap: (DEFAULT_CAPACITY): Make default initial capacity 16 as it is defined in official Javadocs.
-rw-r--r--ChangeLog6
-rw-r--r--java/util/HashMap.java5
2 files changed, 8 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index f1c7c3183..7eeacf0dd 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2011-02-22 Pekka Enberg <penberg@kernel.org>
+
+ * java/util/HashMap:
+ (DEFAULT_CAPACITY): Make default initial capacity 16 as it is
+ defined in official Javadocs.
+
2010-02-16 Pekka Enberg <penberg@kernel.org>
* java/util/Formatter.java:
diff --git a/java/util/HashMap.java b/java/util/HashMap.java
index 55d81c620..d7a9a7f5b 100644
--- a/java/util/HashMap.java
+++ b/java/util/HashMap.java
@@ -100,11 +100,10 @@ public class HashMap<K, V> extends AbstractMap<K, V>
implements Map<K, V>, Cloneable, Serializable
{
/**
- * Default number of buckets. This is the value the JDK 1.3 uses. Some
- * early documentation specified this value as 101. That is incorrect.
+ * Default number of buckets; this is currently set to 16.
* Package visible for use by HashSet.
*/
- static final int DEFAULT_CAPACITY = 11;
+ static final int DEFAULT_CAPACITY = 16;
/**
* The default load factor; this is explicitly specified by the spec.