You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@jena.apache.org by "afs (via GitHub)" <gi...@apache.org> on 2024/10/27 17:32:06 UTC
[I] CacheSimple removes slots for same hash, different key. [jena]
afs opened a new issue, #2802:
URL: https://github.com/apache/jena/issues/2802
### Change
CacheSimple invalidates the hash slot when the key hash matches even if it is a different key.
```
Object key1 = new Object() { @Override public int hashCode() { return 0 ; } };
Object key2 = new Object() { @Override public int hashCode() { return 0 ; } };
Cache<Object, String> cache = CacheFactory.createSimpleCache(16);
cache.put(key1, "object1");
cache.put(key2, null);
String s = cache.getIfPresent(key1);
System.out.println(s);
// s is null, should be "object1"
```
This is functionally safe - it just looses the cache entry unnecessarily.
### Are you interested in contributing a pull request for this task?
Yes
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org
Re: [I] CacheSimple removes slots for same hash, different key. [jena]
Posted by "afs (via GitHub)" <gi...@apache.org>.
afs closed issue #2802: CacheSimple removes slots for same hash, different key.
URL: https://github.com/apache/jena/issues/2802
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@jena.apache.org
For additional commands, e-mail: issues-help@jena.apache.org