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

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Nov 11 03:07:18 UTC 2025


On Tue, 11 Nov 2025 03:02:01 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:
> 
>   debug fix

I couldn't find anything adverse w.r.t thread usage using the added debug logs and I think it's standard and proven practice to store global (and in this case transient) variable into temp variable and use it to prevent 
inadvertent modification of the global variable and also avoid variable state change causing issue during context switching
especially in multi-threaded environments  
and it is consistent with the approach taken for other swing-interop class like SwingNode

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

PR Comment: https://git.openjdk.org/jfx/pull/1968#issuecomment-3514803313


More information about the openjfx-dev mailing list