RFR: 8316388: Opensource five Swing component related regression tests [v3]
Alexey Ivanov
aivanov at openjdk.org
Thu Mar 14 09:08:40 UTC 2024
On Wed, 13 Mar 2024 19:40:16 GMT, Alexander Zuev <kizune at openjdk.org> wrote:
>> test/jdk/javax/swing/JDesktopPane/bug4773378.java line 99:
>>
>>> 97: bug4773378.this.wait();
>>> 98: }
>>> 99: }
>>
>> Suggestion:
>>
>> frameActivated.await();
>>
>>
>> Using `CountDownLatch` is so much cleaner.
>
> You like your countdown latches :) Ok, i will re-write this test with CDL.
Because 1 line of code replaces 4 lines of code and communicates what's happening much clearer than a synchronized block with a flag.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/18259#discussion_r1524493581
More information about the client-libs-dev
mailing list