On Wed, 18 Nov 2026 07:47:38 GMT, Serguei Spitsyn <[email protected]> wrote:
>> Markus Grönlund has updated the pull request incrementally with one >> additional commit since the last revision: >> >> Allow obsolete record and type-switch helper classes to unload > > test/jdk/java/lang/instrument/LambdaClassUnloading.java line 113: > >> 111: testHelpers(retransform, "recordHashCode"); >> 112: testHelpers(retransform, "typeSwitch"); >> 113: } > > Q: What is the reason to avoid the same testing for the "redefine" case? It was an attempt to reduce the test matrix, but the asymmetry is hard to justify, so lets just run them for all. > test/jdk/java/lang/instrument/LambdaClassUnloading.java line 173: > >> 171: // Transform before the first link too, avoiding an initial >> STRONG helper. >> 172: transform(retransform, host, originalBytes); >> 173: runHelperWorkload(kind); > > Q: Lines 118 and 172: Does the test ever check that helpers are generated > before transformation? No, deliberately. The test transforms the host before its first linkage so that every tracked implementation belongs to the generations affected by this change. It then checks that retained implementations survive and released implementations unload. Initial strongly linked implementations are outside that unloading expectation. > test/jdk/java/lang/instrument/LambdaClassUnloading.java line 243: > >> 241: Asserts.assertTrue(instance.getClass().isHidden(), "Expected a >> hidden lambda implementation class"); >> 242: classes.add(new WeakReference<>(instance.getClass())); >> 243: } > > Q: Lines: 124-126, 239-242: Does the test verify it actually exercises > multiple proxy generations? The record/switch helper tests explicitly require a new implementation class for each generation. The lambda tests exercise repeated transformations and check unloading, but do not explicitly assert distinct class identities across all generations. I will add that assertion using the existing weak references. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/33921#discussion_r4612362230 PR Review Comment: https://git.openjdk.org/jdk/pull/33921#discussion_r4612317552 PR Review Comment: https://git.openjdk.org/jdk/pull/33921#discussion_r4612346172
