RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v56]
Per Minborg
pminborg at openjdk.org
Tue Apr 22 10:48:10 UTC 2025
On Fri, 18 Apr 2025 12:47:37 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Address comments on original vs underlying
>
> src/java.base/share/classes/java/lang/StableValue.java line 389:
>
>> 387: * successful invocation. Since stable functions and stable collections are built on top
>> 388: * of {@linkplain StableValue#orElseSet(Supplier) orElseSet()} they too are
>> 389: * thread safe and guarantee at-most-once-per-input invocation.
>
> I think you should drop the note here about stable collections being built on top of `orElseSet`. This is an interesting implementation detail, but not directly relevant for the specification, and some that we might want to change in the future.
>
> I suggest just specifying the behavior of stable collections directly, without mentioning how they are implemented.
Good catch. I now say "Since stable functions and stable collections are built on top
of the same principles as {@linkplain StableValue#orElseSet(Supplier) orElseSet()} they
too are thread safe and guarantee at-most-once-per-input invocation."
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2053853385
More information about the core-libs-dev
mailing list