提交 3d58d163 编写于 作者: M martin

6625725: (coll) modCount should not be volatile

Reviewed-by: dholmes
上级 4999325d
...@@ -173,7 +173,7 @@ public class HashMap<K,V> ...@@ -173,7 +173,7 @@ public class HashMap<K,V>
* rehash). This field is used to make iterators on Collection-views of * rehash). This field is used to make iterators on Collection-views of
* the HashMap fail-fast. (See ConcurrentModificationException). * the HashMap fail-fast. (See ConcurrentModificationException).
*/ */
transient volatile int modCount; transient int modCount;
/** /**
* Constructs an empty <tt>HashMap</tt> with the specified initial * Constructs an empty <tt>HashMap</tt> with the specified initial
......
...@@ -173,7 +173,7 @@ public class IdentityHashMap<K,V> ...@@ -173,7 +173,7 @@ public class IdentityHashMap<K,V>
/** /**
* The number of modifications, to support fast-fail iterators * 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). * The next size value at which to resize (capacity * load factor).
......
...@@ -182,7 +182,7 @@ public class WeakHashMap<K,V> ...@@ -182,7 +182,7 @@ public class WeakHashMap<K,V>
* *
* @see ConcurrentModificationException * @see ConcurrentModificationException
*/ */
volatile int modCount; int modCount;
@SuppressWarnings("unchecked") @SuppressWarnings("unchecked")
private Entry<K,V>[] newTable(int n) { private Entry<K,V>[] newTable(int n) {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册