RFR: JDK-8310913 Move ReferencedKeyMap to jdk.internal so it may be shared [v2]
Roger Riggs
rriggs at openjdk.org
Thu Jun 29 21:01:58 UTC 2023
On Thu, 29 Jun 2023 18:24:33 GMT, Jim Laskey <jlaskey at openjdk.org> wrote:
>> java.lang.runtime.ReferencedKeyMap was introduced to provide a concurrent caching scheme for Carrier objects. The technique used is generally useful for a variety of caching schemes and is being moved to be shared in other parts of the jdk. The MethodType interning case is one example.
>
> Jim Laskey has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove warning tied to String Templates
LGTM
src/java.base/share/classes/jdk/internal/util/ReferencedKeySet.java line 65:
> 63: * replacing the value in the map entry instead of deleting the old entry and
> 64: * adding a new entry, otherwise replaced entries may end up with a strongly
> 65: * referenced key. {@link HashMap} and {@link ConcurrentHashMap} are known
Can this requirement be backed up with an assert checking for known ok HashMaps?
It could catch mistakes (in debug builds).
-------------
Marked as reviewed by rriggs (Reviewer).
PR Review: https://git.openjdk.org/jdk/pull/14684#pullrequestreview-1506118119
PR Review Comment: https://git.openjdk.org/jdk/pull/14684#discussion_r1247166790
More information about the core-libs-dev
mailing list