RFR: 8327218: Add an ability to specify modules which should have native access enabled [v2]

Jan Lahoda jlahoda at openjdk.org
Wed Mar 6 21:25:00 UTC 2024


On Tue, 5 Mar 2024 18:54:55 GMT, Alan Bateman <alanb at openjdk.org> wrote:

>> Jan Lahoda has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Apply suggestions from code review
>>   
>>   Co-authored-by: ExE Boss <3889017+ExE-Boss at users.noreply.github.com>
>>   Co-authored-by: Maurizio Cimadamore <54672762+mcimadamore at users.noreply.github.com>
>
> src/java.base/share/classes/java/lang/ModuleLayer.java line 896:
> 
>> 894:         return nameToModule.get(name);
>> 895:     }
>> 896: 
> 
> What would you think about replacing this with addEnableNativeAccess(String name) so it can be called by JLA. addEnableNativeAccess. The reason is that the JLA methods are usually just calls to some non-public method but the changes mean mean there is "core" in the JLA method that is not easy to find.

I've tried to that here:
https://github.com/openjdk/jdk/pull/18106/commits/e17cd3722724cbc6aa298f7b789c6574554af6ea

> src/java.base/share/classes/jdk/internal/module/ModuleBootstrap.java line 812:
> 
>> 810:     }
>> 811: 
>> 812:     private static void addEnableNativeAccess(ModuleLayer layer, Set<String> moduleNames, boolean shouldWarn) {
> 
> The private methods in this class have a short comment to summarise what they do.

I've tried to add a comment here:
https://github.com/openjdk/jdk/pull/18106/commits/e17cd3722724cbc6aa298f7b789c6574554af6ea

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/18106#discussion_r1515171359
PR Review Comment: https://git.openjdk.org/jdk/pull/18106#discussion_r1515171099


More information about the core-libs-dev mailing list