RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v9]

Prasanta Sadhukhan psadhukhan at openjdk.org
Thu Nov 20 12:05:47 UTC 2025


On Wed, 19 Nov 2025 18:27:19 GMT, Kevin Rushforth <kcr at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Review comment + OutputRedirect
>
> tests/system/src/test/java/test/javafx/embed/swing/JFXPanelNPETest.java line 99:
> 
>> 97:                 Platform.runLater(() -> contentPane.setScene(webView.getScene()));
>> 98:                 Thread.sleep(1);
>> 99:             }
> 
> The calls in the loop to the FX and AWT threads are asynchronous, so I recommend adding the following after the loop to ensure that both threads are finished with the work submitted in the loops:
> 
> 
>             // Wait for both threads to process the earlier runnables
>             SwingUtilities.invokeAndWait(() -> {});
>             Util.runAndWait(() -> {});

added

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1968#discussion_r2545752084


More information about the openjfx-dev mailing list