[External] : Re: JEP draft: Prepare to Restrict The Use of JNI

Alex Buckley alex.buckley at oracle.com
Tue Aug 29 16:30:08 UTC 2023


On 8/29/2023 8:01 AM, Glavo wrote:
>         1. Allows a module to declare that it wants native access:
> 
>         2. Allows a module with native access enabled to grant
>         permissions to other modules:
> 
>         3. If the main module requires native access, it is allowed
>         without the --enable-native-access.
> 
>         4. Allows users to declare restricted methods.
>              This will prevent code from masking its true intent through
>         low-level libraries like JNA/JNR.
> 
> I never wanted zero flags. I want modules to always need to declare 
> themselves needing native access in module info.
> The only difference between the main module and other modules is that it 
> does not need to be granted permissions by other modules,
> as I believe the end user has the right to make decisions.

#3 is pretty clear that the main module can use JNI with no permission 
from other modules and with no acknowledgement of --enable-native-access 
from the user.

Alex


More information about the jdk-dev mailing list