RFR: 8356080: Address post-integration comments for Stable Values [v4]
Luca Kellermann
duke at openjdk.org
Tue May 13 14:45:07 UTC 2025
On Tue, 13 May 2025 07:57:15 GMT, Per Minborg <pminborg at openjdk.org> wrote:
>> This PR proposes to address comments in the initial PR for Stable Values, which were deferred until after integration.
>>
>> Most of the efforts in this PR are to retain "stability" as long as possible so that views of stable collections remain stable and do not evaluate on `toString()` for example.
>>
>> Unfortunately, this PR shows the total commit history for stable values.
>
> 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.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/25004#discussion_r2086998430
More information about the core-libs-dev
mailing list