RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v6]
Per Minborg
pminborg at openjdk.org
Mon Mar 31 09:46:00 UTC 2025
On Sun, 16 Mar 2025 18:43:26 GMT, Luca Kellermann <duke at openjdk.org> wrote:
>> Per Minborg has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 246 commits:
>>
>> - Merge branch 'master' into implement-jep502
>> - Clean up exception messages and fix comments
>> - Rename field
>> - Rename method and fix comment
>> - Rework reenterant logic
>> - Use acquire semantics for reading rather than volatile semantics
>> - Add missing null check
>> - Simplify handling of sentinel, wrap, and unwrap
>> - Fix JavaDoc issues
>> - Fix members in StableEnumFunction
>> - ... and 236 more: https://git.openjdk.org/jdk/compare/4e51a8c9...d6e1573f
>
> src/java.base/share/classes/jdk/internal/lang/stable/StableValueFactories.java line 77:
>
>> 75: int i = 0;
>> 76: for (K key : keys) {
>> 77: entries[i++] = Map.entry(key, StableValueImpl.newInstance());
>
> `Map.entry` causes `null` keys to throw a `NullPointerException`, meaning there can't be stable functions/maps with a `null` input/key. They can however have `null` values. Is that intended?
Yes. The keys need to be non-null. I have added info about this in the docs now.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2020715235
More information about the hotspot-dev
mailing list