[
https://issues.apache.org/jira/browse/OAK-12147?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18069357#comment-18069357
]
Rishabh Daim edited comment on OAK-12147 at 3/29/26 9:54 AM:
-------------------------------------------------------------
Looked into this and found the root cause, it is _*OakCacheStats*_ class.
This class is of _*record*_ type, and it adds import for
{_}*java/lang/runtime/ObjectMethods.bootstrap*{_}.
QQ: How did you find it? And why would it cause an issue, since _*java.lang*_
is always imported in a Java class?
*P.S.* checked on local, after converting the class to a normal one,
_*java.lang.runtime*_ is not imported anymore.
was (Author: JIRAUSER299730):
Looked into this and found the root cause, it is _*OakCacheStats*_ class.
This class is of _*record*_ type, and it adds import for
{_}*java/lang/runtime/ObjectMethods.bootstrap*{_}.
QQ: How did you find it? And why would it cause an issue, since _*java.lang*_
is always imported in a Java class?
> Introduce Oak Cache API interfaces in oak-core-spi
> --------------------------------------------------
>
> Key: OAK-12147
> URL: https://issues.apache.org/jira/browse/OAK-12147
> Project: Jackrabbit Oak
> Issue Type: Sub-task
> Reporter: Rishabh Daim
> Assignee: Rishabh Daim
> Priority: Critical
> Fix For: 2.0.0
>
>
> Introduce a new Oak-owned cache API in org.apache.jackrabbit.oak.cache so
> that all Oak modules depend on stable interfaces rather than Guava shim or
> Caffeine types directly.
> New files:
> - OakCache<K,V> — base interface with:
> - getIfPresent(K) → @Nullable V
> - get(K, Function<? super K, ? extends V>) → @Nullable V
> (Caffeine-aligned, unchecked — replaces the Callable-based API)
> - put(K, V)
> - invalidate(K)
> - invalidateAll()
> - invalidateAll(Iterable) (no Oak module currently calls this; can be
> removed if decided)
> - estimatedSize() → long (no Oak module currently calls this directly;
> can be removed if decided)
> - stats() → OakCacheStats
> - asMap() → ConcurrentMap<K, V>
> - getAllPresent(Iterable) → Map<K, V> (no Oak module currently calls
> this; CacheLIRS throws UnsupportedOperationException; can be removed if
> decided)
> - cleanUp() (no Oak module currently calls this; CacheLIRS is a no-op;
> can be removed if decided)
> - OakLoadingCache<K,V> extends OakCache — get(K) returns @NotNull V, throws
> CompletionException on loader failure; refresh(K)
> - OakCacheLoader<K,V> — functional interface: V load(K) throws Exception
> - OakWeigher<K,V> — functional interface: int weigh(K, V)
> - OakRemovalCause — enum: EXPLICIT, REPLACED, SIZE, EXPIRED, COLLECTED
> - OakRemovalListener<K,V> — functional interface: void onRemoval(K, V,
> OakRemovalCause)
> - OakCacheStats — immutable value object: hitCount, missCount,
> loadSuccessCount, loadFailureCount, totalLoadTime, evictionCount; methods
> minus(), hitRate(), missRate(), requestCount()
> - CacheImplementation — enum: LIRS, CAFFEINE; used by OakCacheBuilder for
> per-module backend override
> No changes to AbstractCacheStats, CacheStats, or CacheLIRS. All existing
> call sites continue to compile unchanged.
> Acceptance criteria:
> - oak-core-spi compiles; no new Caffeine or Guava types in the public API
> surface
> - All existing oak-core-spi tests pass (CacheTest, CacheSizeTest,
> ConcurrentTest, ConcurrentPerformanceTest)
> - No consumer module is changed; all existing CacheLIRS.newBuilder() and
> new CacheStats(guavaCache, ...) call sites still compile
--
This message was sent by Atlassian Jira
(v8.20.10#820010)