RFR: JDK-8325255 jdk.internal.util.ReferencedKeySet::add using wrong test [v3]
Jim Laskey
jlaskey at openjdk.org
Tue Mar 5 20:23:57 UTC 2024
On Sun, 11 Feb 2024 17:41:14 GMT, ExE Boss <duke at openjdk.org> wrote:
>> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>>
>> Update ReferencedKeyTest.java
>
> src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 151:
>
>> 149: @Override
>> 150: public boolean add(T e) {
>> 151: return intern(e) == e;
>
> https://github.com/openjdk/jdk/pull/14684#discussion_r1485634936
>> While `intern(e) == e` is (mostly) sufficient, it will return a false positive when `add(e)` is called and `e` is already present in the map, the correctest implementation would be some internal API in `ReferencedKeyMap` for implementing `ReferencedKeySet::add`.
Updated
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/17732#discussion_r1513458157
More information about the core-libs-dev
mailing list