RFR: 8356080: Address post-integration comments for Stable Values [v4]

Chen Liang liach at openjdk.org
Tue May 13 14:45:07 UTC 2025


On Tue, 13 May 2025 14:39:36 GMT, Luca Kellermann <duke at openjdk.org> wrote:

>> Per Minborg has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address comments
>
> src/java.base/share/classes/java/util/ImmutableCollections.java line 1732:
> 
>> 1730:                         && Objects.equals(getKey(), e.getKey())
>> 1731:                         // Invoke `getValue()` as late as possible to avoid evaluation
>> 1732:                         && Objects.equals(getValue(), e.getValue());
> 
> Suggestion:
> 
>                         && Objects.equals(e.getValue(), getValue());
> 
> You already integrated and it's probably not that important, but this would additionally avoid evaluation if `e.getValue()` throws.

This is in the realms of microoptimization now...

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/25004#discussion_r2087007810


More information about the core-libs-dev mailing list