On Thu, 24 Apr 2025 13:35:45 GMT, Luca Kellermann <[email protected]> wrote:
>> Per Minborg has updated the pull request incrementally with one additional
>> commit since the last revision:
>>
>> Make public constuctor private
>
> src/java.base/share/classes/java/lang/StableValue.java line 389:
>
>> 387: * Invocations of {@link #setOrThrow(Object)} form a total order of
>> zero or more
>> 388: * exceptional invocations followed by zero (if the contents were
>> already set) or one
>> 389: * successful invocation. Since stable functions and stable collections
>> are built on top
>
> How can an exceptional invocation of `setOrThrow` be followed by a successful
> invocation?
`setOrThrow` might be invoked several times. If the first invocation failed
because the supplier threw and then the second invocation (with the same
supplier) succeded (because there was some state that changed), we have this
situation.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2059866634