reschke commented on code in PR #2224:
URL: https://github.com/apache/jackrabbit-oak/pull/2224#discussion_r2039238431
##########
oak-store-document/src/main/java/org/apache/jackrabbit/oak/plugins/document/DocumentNodeStoreBuilder.java:
##########
@@ -117,7 +116,7 @@ public class DocumentNodeStoreBuilder<T extends
DocumentNodeStoreBuilder<T>> {
*/
static final int UPDATE_LIMIT = Integer.getInteger("update.limit",
DEFAULT_UPDATE_LIMIT);
- protected Supplier<DocumentStore> documentStoreSupplier = ofInstance(new
MemoryDocumentStore());
+ protected Supplier<DocumentStore> documentStoreSupplier = () -> new
MemoryDocumentStore();
Review Comment:
Maybe:
~~~
private DocumentStore memoizedDocumentStore = null;
protected Supplier<DocumentStore> documentStoreSupplier = () ->
memoizedDocumentStore = Objects.requireNonNullElse(memoizedDocumentStore, new
MemoryDocumentStore());
~~~
This might be the shortest way to do that just with JDK, at least for simple
cases.
We have roughly 10 non-case uses of `memoize` - so we'll have to discuss how
to adress these.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]