While implementing 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), I discovered 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 afterJDK-8339517 is fixed, we still get native access warnings when running any test that uses SwingNode.
WARNING: A native method in com.sun.javafx.embed.swing.newimpl.SwingNodeInteropN has been bound
WARNING: com.sun.javafx.embed.swing.newimpl.SwingNodeInteropN::overrideNativeWindowHandle is declared in module javafx.swing (file:/Users/kcr/dev/javafx/jfx-kcr/jfx/rt/build/shims/javafx.swing/)
WARNING: Use --enable-native-access=javafx.swing to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
This means that even after
WARNING: A native method in com.sun.javafx.embed.swing.newimpl.SwingNodeInteropN has been bound
WARNING: com.sun.javafx.embed.swing.newimpl.SwingNodeInteropN::overrideNativeWindowHandle is declared in module javafx.swing (file:/Users/kcr/dev/javafx/jfx-kcr/jfx/rt/build/shims/javafx.swing/)
WARNING: Use --enable-native-access=javafx.swing to avoid a warning for native methods declared in this module
WARNING: Restricted methods will be blocked in a future release unless native access is enabled
- relates to
-
JDK-8339517 Add --enable-native-access flag when running tests
- Resolved
- links to
-
Commit(master) openjdk/jfx/9c31cb0c
-
Review(master) openjdk/jfx/1600