RFR: 8340005: Eliminate native access calls from javafx.swing [v2]
Kevin Rushforth
kcr at openjdk.org
Tue Oct 15 22:02:16 UTC 2024
On Tue, 15 Oct 2024 17:46:33 GMT, Prasanta Sadhukhan <psadhukhan at openjdk.org> wrote:
>> While implementing [JDK-8339517](https://bugs.openjdk.org/browse/JDK-8339517) to eliminate native access warnings by passing "--enable-native-access" for the three JavaFX modules with native code (javafx.graphics, javafx.media, and javafx.web), it was found that the Swing interop code in javafx.swing calls a JNI method defined in one of the native graphics libraries (prism-common) directly
>>
>> This means that even after [JDK-8339517](https://bugs.openjdk.org/browse/JDK-8339517) is fixed, we still get native access warnings when running any test that uses SwingNode.
>>
>> This fixes the native access warning by making javafx.graphics module call the native JNI and Swing-interop calls the static utility method in javafx.graphics, in this case defined in PlatformImpl
>>
>> All test.javafx.embed.swing SwingNode tests are running ok without any native warning
>
> Prasanta Sadhukhan has updated the pull request incrementally with one additional commit since the last revision:
>
> Move native method to Application
Looks good now, except that you didn't fully revert all changes in PlatformImpl.java (there is now a spurious change in a blank line). Please fix it before you integrate and I'll reapprove.
modules/javafx.graphics/src/main/java/com/sun/javafx/application/PlatformImpl.java line 1063:
> 1061: }
> 1062: }
> 1063:
Please revert all changes to this file, since you now aren't touching it in your PR.
-------------
Marked as reviewed by kcr (Lead).
PR Review: https://git.openjdk.org/jfx/pull/1600#pullrequestreview-2370769966
PR Review Comment: https://git.openjdk.org/jfx/pull/1600#discussion_r1802063207
More information about the openjfx-dev
mailing list