RFR: 8371386: Fix potential NPE in SwingNode

Andy Goryachev angorya at openjdk.org
Thu Nov 6 20:44:25 UTC 2025


On Thu, 6 Nov 2025 03:57:51 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:

> There can be potential NPEs in SwingNode which is fixed

modules/javafx.swing/src/main/java/javafx/embed/swing/SwingNode.java line 557:

> 555: 
> 556:     private final EventHandler<FocusUngrabEvent> ungrabHandler = event -> {
> 557:         var hFrame = lwFrame;

this can be pushed down to L559 - no need to create/assign if not needed.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1965#discussion_r2500791603


More information about the openjfx-dev mailing list