nfsantos commented on PR #2457: URL: https://github.com/apache/jackrabbit-oak/pull/2457#issuecomment-3208994116
In the near future, this issue will be solved by Stable Values, which will first appear in Java 25 as preview: https://openjdk.org/jeps/502 ``` private final StableValue<Logger> logger = StableValue.of(); Logger getLogger() { return logger.orElseSet(() -> Logger.create(OrderController.class)); } ``` This guarantees lazy and thread-safe initialization. For Oak, it will take a long time until we can target a Java version with a finalized version of Stable Values, but it's nice to know that we will no longer need to write double-checked locking logic. -- 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: oak-dev-unsubscr...@jackrabbit.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org