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

John Hendrikx jhendrikx at openjdk.org
Fri Jul 21 22:03:49 UTC 2023


On Fri, 21 Jul 2023 18:01:15 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Check FXEnabled initially
>
> modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 1092:
> 
>> 1090:             lScenePeer.setPixelScaleFactors((float) scaleFactorX, (float) scaleFactorY);
>> 1091:             synchronized(LOCK) {
>> 1092:                 scenePeer = lScenePeer;
> 
> I wonder if the whole method should be synchronized?
> the logic around scenePeer is asking to be atomic, isn't it?

The change as-is doesn't work correctly; if `embeddedScene` is `null`, `scenePeer` is now unchanged.

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

PR Review Comment: https://git.openjdk.org/jfx/pull/1178#discussion_r1271129888


More information about the openjfx-dev mailing list