[foreign-memaccess+abi] RFR: 8310659: The jar tool should support allowing access to restricted methods from executable jars [v4]
Alan Bateman
alanb at openjdk.org
Wed Jun 28 05:51:34 UTC 2023
On Tue, 27 Jun 2023 19:51:15 GMT, Jorn Vernee <jvernee at openjdk.org> wrote:
>> Jorn Vernee has updated the pull request incrementally with one additional commit since the last revision:
>>
>> error when flag is set to false
>
> src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java line 776:
>
>> 774: private static final boolean HAS_ENABLE_NATIVE_ACCESS_FLAG;
>> 775: private static final Set<String> NATIVE_ACCESS_MODULES;
>> 776: private static boolean ENABLE_NATIVE_ACCESS_SET_IN_MANIFEST = false;
>
> We initialize this class before the manifest is read, so I made this flag mutable.
ModuleBootstrap is for initialising the module system early in the startup. It's not meant to have mutable state that is changed post VM initialization by the launcher. So I'd prefer not introduce this coupling.
If the manifest has `Enable-Native-Access: ALL-UNNAMED` then I would just expect to see the launcher use Modules.addEnableNativeAccessToAllUnnamed(), nothing more. So I think I'd like to understand how setEnableNativeAccessSetInManifest came about. Is there an ordering issue where somehow ModuleBootstrap.hasEnableNativeAccessFlag is called before EnableNativeAccess.isNativeAccessEnabled on the target module?
-------------
PR Review Comment: https://git.openjdk.org/panama-foreign/pull/843#discussion_r1244714467
More information about the panama-dev
mailing list