RFR: 8305186: Reference.waitForReferenceProcessing should be more accessible to tests [v8]
Brent Christian
bchristi at openjdk.org
Wed Apr 23 17:45:29 UTC 2025
On Wed, 23 Apr 2025 06:08:59 GMT, Kim Barrett <kbarrett at openjdk.org> wrote:
>> Brent Christian has updated the pull request incrementally with one additional commit since the last revision:
>>
>> make waitForReferenceProcessingMethod volatile
>
> test/lib/jdk/test/whitebox/WhiteBox.java line 605:
>
>> 603: throw (InterruptedException) cause;
>> 604: } else {
>> 605: throw new RuntimeException(e);
>
> I still think it would be better to finish unwrapping e, rather than further
> wrapping it. We know the only checked exception is InterruptedException,
> because we checked that when looking up the method. That leaves either
> RuntimeException or Error. I think it is generally inappropriate to wrap
> Errors, and we don't really need to additionally wrap the RuntimeException
> case. But I'm going to approve this change anyway, and leave that question to
> real Java programmers.
For production code, I might do more.
But for a test library (where, IMO, the exception handling path won't see much action), doing enough to get the information into the test log seems sufficient to me.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24527#discussion_r2056588317
More information about the core-libs-dev
mailing list