[
https://issues.apache.org/jira/browse/OAK-11656?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=18015208#comment-18015208
]
Julian Reschke commented on OAK-11656:
--------------------------------------
trunk:
[b8ff5ea808|https://github.com/apache/jackrabbit-oak/commit/b8ff5ea808c6af9c2a96faae6565409916c6a7f8]
> Remove usage of Guava Suppliers.memoize
> ---------------------------------------
>
> Key: OAK-11656
> URL: https://issues.apache.org/jira/browse/OAK-11656
> Project: Jackrabbit Oak
> Issue Type: Technical task
> Reporter: Julian Reschke
> Assignee: Julian Reschke
> Priority: Minor
> Fix For: 1.86.0
>
>
> Can be relatively easy replaced, such as with:
> {code}
> @Nullable private DocumentStore memoizedDocumentStore = null;
> protected Supplier<DocumentStore> documentStoreSupplier = () ->
> memoizedDocumentStore = Objects.requireNonNullElse(memoizedDocumentStore, new
> MemoryDocumentStore());
> {code}
> or by the classical:
> {code}
> @Nullable private DocumentStore memoizedDocumentStore = null;
> @NonNull DocumentStore getDocumentStore() {
> memoizedDocumentStore =
> Objects.requireNonNullElse(memoizedDocumentStore, new MemoryDocumentStore()):
> return memoizedDocumentStore;
> }
> {code}
> Both variants require a visible local variable though.
> ...but we only have 8 instances outside tests.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)