6625725: (coll) modCount should not be volatile
authormartin
Mon, 10 Mar 2008 23:23:48 -0700
changeset 65 51fc1d79463f
parent 64 3244b8bab101
child 66 eac97080ce1e
6625725: (coll) modCount should not be volatile Reviewed-by: dholmes
jdk/src/share/classes/java/util/HashMap.java
jdk/src/share/classes/java/util/IdentityHashMap.java
jdk/src/share/classes/java/util/WeakHashMap.java
--- a/jdk/src/share/classes/java/util/HashMap.java	Mon Mar 10 23:23:48 2008 -0700
+++ b/jdk/src/share/classes/java/util/HashMap.java	Mon Mar 10 23:23:48 2008 -0700
@@ -173,7 +173,7 @@
      * rehash).  This field is used to make iterators on Collection-views of
      * the HashMap fail-fast.  (See ConcurrentModificationException).
      */
-    transient volatile int modCount;
+    transient int modCount;
 
     /**
      * Constructs an empty <tt>HashMap</tt> with the specified initial
--- a/jdk/src/share/classes/java/util/IdentityHashMap.java	Mon Mar 10 23:23:48 2008 -0700
+++ b/jdk/src/share/classes/java/util/IdentityHashMap.java	Mon Mar 10 23:23:48 2008 -0700
@@ -173,7 +173,7 @@
     /**
      * The number of modifications, to support fast-fail iterators
      */
-    private transient volatile int modCount;
+    private transient int modCount;
 
     /**
      * The next size value at which to resize (capacity * load factor).
--- a/jdk/src/share/classes/java/util/WeakHashMap.java	Mon Mar 10 23:23:48 2008 -0700
+++ b/jdk/src/share/classes/java/util/WeakHashMap.java	Mon Mar 10 23:23:48 2008 -0700
@@ -182,7 +182,7 @@
      *
      * @see ConcurrentModificationException
      */
-    volatile int modCount;
+    int modCount;
 
     @SuppressWarnings("unchecked")
     private Entry<K,V>[] newTable(int n) {