8170733: HashMap.HashIterator.remove method does not use cached value for the hash code

Reviewed-by: martin, dl, shade
This commit is contained in:
Paul Sandoz 2016-12-05 13:00:32 -08:00
parent 0c0db99a87
commit 36779a0df3
2 changed files with 2 additions and 4 deletions

View File

@ -1502,8 +1502,7 @@ public class HashMap<K,V> extends AbstractMap<K,V>
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
current = null;
K key = p.key;
removeNode(hash(key), key, null, false, false);
removeNode(p.hash, p.key, null, false, false);
expectedModCount = modCount;
}
}

View File

@ -731,8 +731,7 @@ public class LinkedHashMap<K,V>
if (modCount != expectedModCount)
throw new ConcurrentModificationException();
current = null;
K key = p.key;
removeNode(hash(key), key, null, false, false);
removeNode(p.hash, p.key, null, false, false);
expectedModCount = modCount;
}
}