On Mon, 16 Nov 2026 19:28:57 GMT, Andy Goryachev <[email protected]> wrote:

>>> this did not fix the test
>> 
>> does it fail for you? It passes for me on Windows and macOS
>
> this is a code review comment, I have not run the test(s) yet.  my pet LLM 
> basically tells us that the test may not catch the NPE because it ends 
> prematurely.

You are right, the events that `requestFocus()` triggers run after the 
runAndWait and the latch is already 0. On macOS, the events are synchronous 
though, and that was passing locally for me.
I've changed it now to use latches based on focused stages, to prevent that 
issue.

I've tested this on macOS/Windows/Linux. The issue only happens on macOS (NPE 
without the patch, passes with the pass). On Windows/Linux the test passes 
always with or without the patch.

There is an issue worth mentioning though: on some Linux setups, the window 
manager might prevent the stages from getting the focus (unless clicked by a 
user), and the test would fail. Maybe we should add a condition so it runs on 
macOS (and maybe Windows) only?

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

PR Review Comment: https://git.openjdk.org/jfx/pull/2373#discussion_r4599319834

Reply via email to