RFR: 8287596: Reorg jdk.test.lib.util.ForceGC [v9]

Roger Riggs rriggs at openjdk.org
Thu Jun 16 16:11:56 UTC 2022


On Thu, 16 Jun 2022 15:55:00 GMT, Xue-Lei Andrew Fan <xuelei at openjdk.org> wrote:

>> This is a follow up update per comments in [JDK-8287384 PR](https://urldefense.com/v3/__https://github.com/openjdk/jdk/pull/8907__;!!ACWV5N9M2RV99hQ!LTtncpyN_2kanJmZF3wz3O88hB5AwboRKEitwQ0UJpiaZQ7RhIZpzgU4kCL3gwrt_JRqji2j5Tb92sOTWGguKw$ ).  The tier1 and tier2 test in open part looks good to me.  Please help to run Mach5 just case the closed test cases are impacted.
>
> Xue-Lei Andrew Fan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   remove trailing whitespaces

test/jdk/java/io/ObjectStreamClass/TestOSCClassLoaderLeak.java line 64:

> 62:         assertNotNull(myOwnClassLoaderWeakReference.get());
> 63: 
> 64:         assertTrue(ForceGC.wait(() -> myOwnClassLoaderWeakReference.get() == null));

The call to ref.get() can create a strong reference to the object; depending on the timing it might interfere with the GC in process.
`ref.refersTo(null)` is preferred over `ref.get() == null` 

Here and all subsequent changes.

-------------

PR: https://git.openjdk.org/jdk/pull/8979


More information about the security-dev mailing list