Pavel Mikhailovskii created JENA-1784:
-----------------------------------------
Summary: CacheSimple doesn't check keys for equality
Key: JENA-1784
URL: https://issues.apache.org/jira/browse/JENA-1784
Project: Apache Jena
Issue Type: Bug
Reporter: Pavel Mikhailovskii
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:
{code:java}
@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"));
}
{code}
--
This message was sent by Atlassian Jira
(v8.3.4#803005)