On Tue, Jun 17, 2025 at 3:34 PM Maurizio Cimadamore <
maurizio.cimadam...@oracle.com> wrote:

> Note that this is already part of the StableValue API:
> https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/StableValue.html#supplier(java.util.function.Supplier)
>

Yes, that's where my thoughts incepted. When I noticed it, I wondered
whether a new type is the best solution for lazy initialization of final
values (and still believe a Supplier.cache(Supplier<T> computer) would be a
nice addition). But your answer about the scope of StableValue being
broader than just lazy initialization makes my comment not so relevant.

Reply via email to