On Fri, 7 Jul 2023 11:49:22 GMT, Jim Laskey <jlas...@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: > > Simple versions of create Looks good. Thanks for the update. Nit: the test can use the 2-arg factory method. test/jdk/jdk/internal/util/ReferencedKeyTest.java line 63: > 61: > 62: static void mapTest(boolean isSoft, Supplier<Map<ReferenceKey<Long>, > String>> supplier) { > 63: Map<Long, String> map = ReferencedKeyMap.create(isSoft, false, > supplier); Suggestion: Map<Long, String> map = ReferencedKeyMap.create(isSoft, supplier); test/jdk/jdk/internal/util/ReferencedKeyTest.java line 72: > 70: > 71: static void setTest(boolean isSoft, Supplier<Map<ReferenceKey<Long>, > ReferenceKey<Long>>> supplier) { > 72: ReferencedKeySet<Long> set = ReferencedKeySet.create(isSoft, > false, supplier); Suggestion: ReferencedKeySet<Long> set = ReferencedKeySet.create(isSoft, supplier); ------------- Marked as reviewed by mchung (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/14684#pullrequestreview-1519246419 PR Review Comment: https://git.openjdk.org/jdk/pull/14684#discussion_r1256081914 PR Review Comment: https://git.openjdk.org/jdk/pull/14684#discussion_r1256082313