Add comment to Todo.

git-svn-id: https://svn.apache.org/repos/asf/commons/proper/collections/trunk@1493556 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Thomas Neidhart 2013-06-16 18:02:35 +00:00
parent bf07b37e9a
commit ce1dc52bec
1 changed files with 5 additions and 1 deletions

View File

@ -1950,13 +1950,17 @@ public abstract class AbstractMapTest<K, V> extends AbstractObjectTest {
assertEquals("hashCodes should be the same", getConfirmed().hashCode(), getMap().hashCode()); assertEquals("hashCodes should be the same", getConfirmed().hashCode(), getMap().hashCode());
// this fails for LRUMap because confirmed.equals() somehow modifies // this fails for LRUMap because confirmed.equals() somehow modifies
// map, causing concurrent modification exceptions. // map, causing concurrent modification exceptions.
//assertEquals("Map should still equal HashMap", confirmed, map); // assertEquals("Map should still equal HashMap", confirmed, map);
// this works though and performs the same verification: // this works though and performs the same verification:
assertTrue("Map should still equal HashMap", getMap().equals(getConfirmed())); assertTrue("Map should still equal HashMap", getMap().equals(getConfirmed()));
// TODO: this should really be reexamined to figure out why LRU map // TODO: this should really be reexamined to figure out why LRU map
// behaves like it does (the equals shouldn't modify since all accesses // behaves like it does (the equals shouldn't modify since all accesses
// by the confirmed collection should be through an iterator, thus not // by the confirmed collection should be through an iterator, thus not
// causing LRUMap to change). // causing LRUMap to change).
// When comparing two maps, the entries in the map have to be accessed
// (usually with the get(Object) method). In the case of the LRUMap, this
// also alters the modCount as moveToMRU is called for the retrieved entry.
// Imho, the modCount should not be increased for a read-only operation.
} }
public void verifyEntrySet() { public void verifyEntrySet() {