RFR: 8352682: Opensource JComponent tests [v2]

Harshitha Onkar honkar at openjdk.org
Fri Apr 11 16:53:28 UTC 2025


On Fri, 11 Apr 2025 13:16:20 GMT, Mikhail Yankelevich <myankelevich at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Use lambda
>
> test/jdk/javax/swing/JComponent/bug4247610.java line 122:
> 
>> 120:         return !passFlag;
>> 121:     }
>> 122:     private static synchronized void fail() {
> 
> I think these methods are a bit redundant, just add more code to read and understand. What about removing them and just renaming the flags `failed` and `traced`?
> What do you think?

I agree traceFlag and passFlag are declared as volatile vars , so all four synchronized methods look redundant and can be removed to simplify the code.

 These vars can be converted to CountDownLatch for stability.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/24562#discussion_r2039919304


More information about the client-libs-dev mailing list