[ 
https://issues.apache.org/jira/browse/OFBIZ-6747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17615993#comment-17615993
 ] 

Ben Manes commented on OFBIZ-6747:
----------------------------------

Good catch. The error you saw and figured out is that Caffeine v3 requires Java 
11+, but your build targets Java 8.
{quote}The consumer was configured to find a runtime of a library compatible 
with Java 8
{quote}
The minimum requirements change was to migrate from {{sun.misc.Unsafe}} to 
{{VarHandles}} (Java 9). The usage was primarily to avoid per-entry bloat of a 
few {{AtomicReference}} fields so benign, but understandably no one's 
preference. For Java 8 the only alternative is {{AtomicReferenceFieldUpdater,}} 
but that uses reflection per call so known that it can be slow.

Anyway, the main motivation for this ticket was informing you of the 
dependency's evolution. As it works fine I don't want to create headaches, just 
awareness that CLHM is stable but end-of-life with the successor being 
Caffeine. It's perfectly fine to stay as is.

> Replace ConcurrentLinkedHashMap by Caffeine
> -------------------------------------------
>
>                 Key: OFBIZ-6747
>                 URL: https://issues.apache.org/jira/browse/OFBIZ-6747
>             Project: OFBiz
>          Issue Type: Task
>          Components: ALL COMPONENTS
>            Reporter: Ben Manes
>            Assignee: Jacques Le Roux
>            Priority: Minor
>
> Similar to OFBIZ-3779, please consider upgrading the library used by 
> [UtilCache|https://github.com/apache/ofbiz/blob/trunk/framework/base/src/main/java/org/apache/ofbiz/base/util/cache/UtilCache.java]
>  (v1.2). The current version is 1.4.2 and is the last major release planned.
> The preferable alternative would be to upgrade to 
> [Caffeine|https://github.com/ben-manes/caffeine]. This is a Java 8 rewrite 
> based on what I've learned since developing CLHM and Guava's cache. As 
> expected it provides [superior 
> performance|https://github.com/ben-manes/caffeine/wiki/Benchmarks]. It also 
> provides a [near 
> optimal|https://github.com/ben-manes/caffeine/wiki/Efficiency] eviction 
> policy.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to