[jboss-jira] [JBoss JIRA] (JGRP-1979) org.jgroups.blocks.Cache.get() method always evicts values because it does not check Value.insertion_time

Bela Ban (JIRA) issues at jboss.org
Sat Nov 14 02:58:00 EST 2015


     [ https://issues.jboss.org/browse/JGRP-1979?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bela Ban resolved JGRP-1979.
----------------------------
    Resolution: Done


> 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.1, 3.6.6
>         Environment: Windows 10 64-bit
>            Reporter: Ben Johnson
>            Assignee: Bela Ban
>            Priority: Minor
>             Fix For: 3.6.7
>
>         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