changeset 5060:f1152e1c7ae7

7173918: set alternative string hashing threshold. Summary: Sets the threshold for enabling alternative string hashing to 512, the intended shipping default. Reviewed-by: alanb, dholmes, forax
author mduigou
date Thu, 07 Jun 2012 01:01:18 -0700
parents cbd726c8b322
children 4fc6b7a992f5
files src/share/classes/java/util/HashMap.java src/share/classes/java/util/Hashtable.java src/share/classes/java/util/WeakHashMap.java
diffstat 3 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/java/util/HashMap.java	Thu Jun 07 01:01:09 2012 -0700
+++ b/src/share/classes/java/util/HashMap.java	Thu Jun 07 01:01:18 2012 -0700
@@ -186,7 +186,7 @@
      * {@code 2147483648 } ({@code Integer.MAX_VALUE}) value ensures that
      * alternative hashing is never used.
      */
-    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 0;
+    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 512;
 
     /**
      * holds values which can't be initialized until after VM is booted.
--- a/src/share/classes/java/util/Hashtable.java	Thu Jun 07 01:01:09 2012 -0700
+++ b/src/share/classes/java/util/Hashtable.java	Thu Jun 07 01:01:18 2012 -0700
@@ -174,7 +174,7 @@
      * {@code 2147483648 } ({@code Integer.MAX_VALUE}) value ensures that
      * alternative hashing is never used.
      */
-    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 0;
+    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 512;
 
     /**
      * holds values which can't be initialized until after VM is booted.
@@ -1063,7 +1063,7 @@
      */
     private static class Entry<K,V> implements Map.Entry<K,V> {
         int hash;
-        K key;
+        final K key;
         V value;
         Entry<K,V> next;
 
--- a/src/share/classes/java/util/WeakHashMap.java	Thu Jun 07 01:01:09 2012 -0700
+++ b/src/share/classes/java/util/WeakHashMap.java	Thu Jun 07 01:01:18 2012 -0700
@@ -195,7 +195,7 @@
     * whereas {@code 2147483648 } ({@code Integer.MAX_VALUE}) value ensures
     * that alternative hashing is never used.
     */
-    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 0;
+    static final int ALTERNATE_HASHING_THRESHOLD_DEFAULT = 512;
 
     /**
      * holds values which can't be initialized until after VM is booted.