RFR: 8298783: java/lang/ref/FinalizerHistogramTest.java failed with "RuntimeException: MyObject is not found in test output" [v4]
Brent Christian
bchristi at openjdk.org
Mon Mar 31 19:44:21 UTC 2025
On Fri, 28 Mar 2025 09:34:58 GMT, Jaikiran Pai <jpai at openjdk.org> wrote:
>> Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
>>
>> convert to WeakRefs, use a RefQ, print ForceGC results
>
> test/jdk/java/lang/ref/FinalizerHistogramTest.java line 131:
>
>> 129: volatile boolean ref1Cleared = false;
>> 130: volatile boolean ref2Cleared = false;
>> 131: Thread thread;
>
> Nit: This need not be a field in the class and instead can be local to the constructor where the Thread is started. But it's OK to leave it like this if you prefer to.
I feel better about maintaining a strong reference (`refQForTwo -> thread`) to the `Thread`.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24143#discussion_r2021665867
More information about the core-libs-dev
mailing list