On Wed, 12 Mar 2025 14:38:28 GMT, Luca Kellermann <d...@openjdk.org> wrote:
>> This is something we experimented with a bit in the past. It isn't easy to >> do in the general case. There are pros (the function and its resources that >> can be collected) and cons (e.g., mutability, visibility, complexity, etc.) >> with this. > >> (Also `orElseSet` does not NPE if the incoming supplier is null but the >> value is bound) > > You mean > [this](https://github.com/openjdk/jdk/blob/a05717d8da8f804003cfb8d6d25b8a5b6cecd473/src/java.base/share/classes/jdk/internal/lang/stable/StableValueImpl.java#L117-L120) > is missing `Objects.requireNonNull(supplier);`, right? Fixed `Objects.requireNonNull()` now. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r1993279982