-
Bug
-
Resolution: Done
-
Minor
-
3.6.1, 3.6.6
-
None
org.jgroups.blocks.Cache.get(String key) always evicts the matching entry and returns a value of null. It is doing this because the method is comparing the Value timeout property against the current system time without using the Value's insertion_time (unlike the evict() method, which does).
I have created a simple unit test to illustrate this and provided a fix (from the 3.6.1.Final code base, which doesn't include the diamond operator updates). I added a couple of helper methods isExpired(Value val) and getValue(Value val)