E.g.
public void remove() {
if( _prevV == null ) throw new IllegalStateException();
_sschm.putIfMatch( _prevK, TOMBSTONE, _prevV ); // !!! tries to match with old value
_prevV = null;
}
private void testKeySetIteratorRemoveKeyAfterValChange(Map<Long, String> map, Long testKey) {
map.put(testKey, "0");
assertEquals("0", map.get(testKey));
assertEquals(1, map.size());
assertTrue(!map.isEmpty());
assertTrue(map.containsKey(testKey));
assertTrue(map.containsValue("0"));
Iterator<Long> iterator = map.keySet().iterator();
map.put(testKey, "1");
while (iterator.hasNext()) {
long key = iterator.next();
if (key == testKey) {
iterator.remove(); // !!! current impl does not remove the key !!!
break;
}
}
assertEquals(null, map.get(testKey));
assertEquals(0, map.size());
assertTrue(map.isEmpty());
assertTrue(!map.containsKey(testKey));
assertTrue(!map.containsValue("1"));
}
E.g.
JCTools/jctools-core/src/main/java/org/jctools/maps/NonBlockingHashMapLong.java
Line 1044 in f58559b
This means that the following fails: