RFR: 8351565: Implement JEP 502: Stable Values (Preview) [v56]
Per Minborg
pminborg at openjdk.org
Tue Apr 22 11:28:28 UTC 2025
On Fri, 18 Apr 2025 14:30:51 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/util/ImmutableCollections.java line 1592:
>
>> 1590: final K k = inner.getKey();
>> 1591: return new NullableKeyValueHolder<>(k, inner.getValue().orElseSet(new Supplier<V>() {
>> 1592: @Override public V get() { return mapper.apply(k); }}));
>
> I suppose you could potentially make this more lazy by returning an `Entry` implementation that only evaluates the mapper when calling `Entry::getValue`.
Yepp. Interesting idea.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/23972#discussion_r2053909004
More information about the core-libs-dev
mailing list