On Thu, 16 Jun 2022 16:08:04 GMT, Roger Riggs <rri...@openjdk.org> wrote:
>> 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. Good point. I learned a lot these days from PRs comments! Thank you! The patch is changed to use refersTo(). ------------- PR: https://git.openjdk.org/jdk/pull/8979