JDK-8340004 : [TestBug] Call ModuleLayer.Controller::enableNativeAccess directly rather than via reflection
  • Type: Bug
  • Component: javafx
  • Sub-Component: other
  • Affected Version: jfx24
  • Priority: P4
  • Status: Open
  • Resolution: Unresolved
  • Submitted: 2024-09-12
  • Updated: 2024-09-12
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
Other
tbdUnresolved
Related Reports
Blocks :  
Relates :  
Description
JDK-8339517 updated our tests to run the Java launcher with `--enable-native-access` when running tests to avoid the native access warnings that result from  JEP 472. See JDK-8331671.

We have two tests that dynamically load the JavaFX modules at runtime using a ModuleLayer. Those tests need to call ModuleLayer.Controller::enableNativeAccess to enable native access for the JavaFX modules. This method is a preview feature in JDK 21, so cannot be called directly if we happen to build and test JavaFX with JDK 21. As such, when I added the calls to enableNativeAccess as part of JDK-8339517, I did so using reflection.

Once we bump the minimum JDK to 22, the reflection calls should be replaced with direct calls to enableNativeAccess. See JDK-8340003.