RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v78]

Per Minborg pminborg at openjdk.org
Fri Apr 25 09:15:30 UTC 2025


On Thu, 24 Apr 2025 13:35:45 GMT, Luca Kellermann <duke at openjdk.org> 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


More information about the core-libs-dev mailing list