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

Prasanta Sadhukhan psadhukhan at openjdk.org
Tue Jul 25 05:30:09 UTC 2023


On Mon, 24 Jul 2023 17:15:18 GMT, Andy Goryachev <angorya at openjdk.org> wrote:

>> This code is still accessing shared state (`dnd`, `pWidth`, `pHeight`, `scaleFactorX`, `scaleFactorY`). Without further analysis of when and where these values are written, it is unclear whether this is the right move. In general, allowing interleaved code execution on multiple threads is very hard to get right. Better to not do it, if at all possible.
>
> No doubt.  `dnd`, even though it's commented as "// Accessed on EDT only" (line 152) seems to be accessed from FX thread via setFxEnabled line 866.
> I tend to agree with @mstr2 that this component deserves a re-think and perhaps a re-design (starting with clear separation of which methods can be accessed from which thread, or adding explicit synchronization primitives).
>  I do recall seeing a number of issues with swing/fx interop in jdk8.

I have synchronized other shared resources.

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

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


More information about the openjfx-dev mailing list