RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v4]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Nov 18 13:24:33 UTC 2025
On Mon, 17 Nov 2025 16:35:50 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> NPE is seen while accessing transient "scenePeer" variable between reads..
>> Fix is made to store it in a temp variable rather than reading it twice since the value can change between successive reads in many places it is accessed.
>> Also some debug logs added to be enabled via `jfxpanel.debug` property
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Remove debug, store transient var in temp var in EDT methods
Modified PR to add comments to specify which methods and fields are called on which threads
> > Ideally, this component should be redesigned to ensure proper communication between threads.
>
> That would be the best long-term solution, but that would be a large effort.
Synchronizing at atomic granularity needs to be done but many methods internally context switch to other thread which can be problematic for this so I have followed the present approach..
-------------
PR Comment: https://git.openjdk.org/jfx/pull/1968#issuecomment-3547632132
More information about the openjfx-dev
mailing list