[jboss-jira] [JBoss JIRA] (JGRP-1979) org.jgroups.blocks.Cache.get() method always evicts values because it does not check Value.insertion_time
Ben Johnson (JIRA)
issues at jboss.org
Fri Nov 13 17:52:00 EST 2015
Ben Johnson created JGRP-1979:
---------------------------------
Summary: org.jgroups.blocks.Cache.get() method always evicts values because it does not check Value.insertion_time
Key: JGRP-1979
URL: https://issues.jboss.org/browse/JGRP-1979
Project: JGroups
Issue Type: Bug
Affects Versions: 3.6.6, 3.6.1
Environment: Windows 10 64-bit
Reporter: Ben Johnson
Assignee: Bela Ban
Priority: Minor
Attachments: Cache.java, CacheTest.java
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)
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)
More information about the jboss-jira
mailing list