RFR: 8255248: NullPointerException in JFXPanel due to race condition in HostContainer [v2]
Prasanta Sadhukhan
psadhukhan at openjdk.org
Tue Nov 11 03:02:03 UTC 2025
On Mon, 10 Nov 2025 18:41:43 GMT, Andy Goryachev <angorya at openjdk.org> wrote:
>> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>>
>> debug fix
>
> modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 215:
>
>> 213:
>> 214: debugPrint = "true".equalsIgnoreCase(debugStr);
>> 215: }
>
> suggestion:
>
> private static final boolean DEBUG = Boolean.getBoolean("jfxpanel.debug");
ok
> modules/javafx.swing/src/main/java/javafx/embed/swing/JFXPanel.java line 217:
>
>> 215: }
>> 216:
>> 217: protected static void debug_println(String str) {
>
> javadoc complains about this new public API. Or is it a temporary debugging thing? Can it be declared `private`?
>
> If it is a permanent thing, it incurs a string concatenation overhead even when disabled. Use lambdas instead? Alternatively (and faster), one needs to check if debug printout is enabled on each use inline:
>
>
> if(DEBUG) {
> debug_println("JFXPanel Thread " + Thread.currentThread().getName() + " isFXUserThread " + Toolkit.getToolkit().isFxUserThread());
> }
I intend to keep it as permanent to enable logging of flow and thread context viewing.
Updated to keep the method private
-------------
PR Review Comment: https://git.openjdk.org/jfx/pull/1968#discussion_r2512659364
PR Review Comment: https://git.openjdk.org/jfx/pull/1968#discussion_r2512658847
More information about the openjfx-dev
mailing list