Daniel Sun created GROOVY-8437:
----------------------------------

             Summary: Implement an atomic `getAndPut` method for `LRUCache`
                 Key: GROOVY-8437
                 URL: https://issues.apache.org/jira/browse/GROOVY-8437
             Project: Groovy
          Issue Type: Improvement
            Reporter: Daniel Sun
            Assignee: Daniel Sun
             Fix For: 3.0.0-alpha-2


Currently LRUCache just provides basic cache function(i.e. get, put), which can 
not make sure same entry will not be added multi-times easily and effectively.

In order to resolve the above problem, ConcurrentLinkedHashMap is refined to 
support `computeIfAbsent`, which is key function for caches. In addition, 
LRUCache implements `getAndPut`, which is based on the `computeIfAbsent`. 

Note: the improvement is only available in Groovy 3.0.0+



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Reply via email to