RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v2]
Marius Hanl
mhanl at openjdk.org
Thu Jul 20 09:20:54 UTC 2023
On Wed, 19 Jul 2023 06:02:13 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> Due to transient datatype of scenePeer, it can become null which can result in NPE in scenarios where scene is continuously been reset and set, which warrants a null check, as is done in other places for the same variable.
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Add lock for read/write of scenePeer/stagePeer and added system test
modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 428:
> 426: private void sendMouseEventToFX(MouseEvent e) {
> 427: EmbeddedSceneInterface lScenePeer = getScenePeer();
> 428: if (lScenePeer == null || !isFxEnabled()) {
Probably minor, but maybe we should first check `!isFxEnabled()` and return fast before we actually call `getScenePeer()` and thus locking it
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1178#discussion_r1269185672
More information about the openjfx-dev
mailing list