Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
CacheSimple identifies keys solely by their hash codes, so that two keys with same hash code are treated as equal, and values stored with one key can be retrieved with another.
A test that currently fails:
@Test public void testSameHash() { Cache<String, Integer> cache = new CacheSimple<>(10); assertEquals("Aa".hashCode(), "BB".hashCode()); cache.put("Aa", 1); assertFalse("Keys with same hash code should not be considered equal", cache.containsKey("BB")); }
Attachments
Issue Links
- links to