On Thu, 9 Jan 2025 20:17:06 GMT, Alexey Ivanov <aiva...@openjdk.org> wrote:
>> I understand that you need 2 separate CountDownLatches for Button 2, but my >> question was about the count of `button2FocusLatch2` . Shouldn't this be 1 >> instead of 2 counts or do you mean we require 2 counts of >> `button2FocusLatch2` to track focus twice after the initial one? > > No, it has to be 2. Focus listeners are added before the frame is displayed. > > https://github.com/openjdk/jdk/blob/e7991216fb25a0eeb094cbeef74128c6770c051a/test/jdk/javax/swing/JRadioButton/ButtonGroupFocus/ButtonGroupFocusTest.java#L100-L104 > > If Button 2 receives focus **twice**, `button2FocusLatch2` will be released. > If it had 1, then the latch would be released when Button 2 gets focus at the > test start. Makes sense. Thanks for clarifying. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22977#discussion_r1909396861