On Fri, 11 Apr 2025 21:36:28 GMT, Roger Riggs <rri...@openjdk.org> wrote:

>> Brent Christian has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   wFRP throws InterruptedException, pass through from 
>> InvocationTargetException; don't check param count
>
> test/lib/jdk/test/whitebox/WhiteBox.java line 568:
> 
>> 566:   private Method getWaitForReferenceProcessingMethod() {
>> 567:     Method wfrp = waitForReferenceProcessingMethod;
>> 568:     if (wfrp == null) {
> 
> Racy initialization is fine, the field can be static and the last one (any 
> racy init would all the same) wins:
> Suggestion:
> 
>   private static Method waitForReferenceProcessingMethod = 
> getWaitForReferenceProcessingMethod();
> 
>   private static Method getWaitForReferenceProcessingMethod() {

I can make the `Method` static, but I don't think it should be set until 
there's a call to `getWaitForReferenceProcessing()`, as most uses of `WhiteBox` 
won't need it.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24527#discussion_r2040420062

Reply via email to