On Wed, 19 Nov 2025 14:04:11 GMT, Kevin Rushforth <[email protected]> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one 
>> additional commit since the last revision:
>> 
>>   Review comment
>
> modules/javafx.graphics/src/main/java/com/sun/javafx/tk/quantum/EmbeddedScene.java
>  line 160:
> 
>> 158:                 if (getSceneState() != null) {
>> 159:                     updateSceneState();
>> 160:                 }
> 
> None of the other calls to `updateSceneState()` check for a null 
> `sceneState`. Why is this is the only one that needs to? If it is needed, it 
> might be safer to move the null check into `updateSceneState` itself.

We were getting this so it is needed

java.lang.NullPointerException: Cannot invoke 
"com.sun.javafx.tk.quantum.SceneState.update()" because "this.sceneState" is 
null
        at 
javafx.graphics@26-internal/com.sun.javafx.tk.quantum.GlassScene.updateSceneState(GlassScene.java:253)
        at 
javafx.graphics@26-internal/com.sun.javafx.tk.quantum.EmbeddedScene.lambda$setPixelScaleFactors$1(EmbeddedScene.java:158)
        at 
javafx.graphics@26-internal/com.sun.javafx.tk.quantum.QuantumToolkit.runWithRenderLock(QuantumToolkit.java:447)
        at 
javafx.graphics@26-internal/com.sun.javafx.tk.quantum.EmbeddedScene.lambda$setPixelScaleFactors$0(EmbeddedScene.java:157)
        at 
javafx.graphics@26-internal/com.sun.javafx.application.PlatformImpl.lambda$runLater$0(PlatformImpl.java:424)
        at 
javafx.graphics@26-internal/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:95)
        at 
javafx.graphics@26-internal/com.sun.glass.ui.win.WinApplication._runLoop(Native 
Method)

> tests/system/src/test/java/test/javafx/embed/swing/JFXPanelNPETest.java line 
> 103:
> 
>> 101:             Thread.sleep(100);
>> 102:             Platform.runLater(() -> 
>> contentPane.setScene(webView.getScene()));
>> 103:             Thread.sleep(100);
> 
> With a `sleep(100)` this only occasionally gets an exception when I run it 
> without your fix. I recommend `sleep(1)` which is what the manual test does. 
> The test will take less time and also be a better stress test.

ok modified

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

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

Reply via email to