RFR: 8264774: Implementation of Foreign Function and Memory API (Incubator) [v2]

Maurizio Cimadamore mcimadamore at openjdk.java.net
Wed Apr 28 18:35:54 UTC 2021


On Wed, 28 Apr 2021 17:53:44 GMT, Daniel Fuchs <dfuchs at openjdk.org> wrote:

>> Maurizio Cimadamore has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Address first batch of review comments
>
> src/java.base/share/classes/jdk/internal/module/IllegalNativeAccessChecker.java line 40:
> 
>> 38: 
>> 39:     private IllegalNativeAccessChecker(Set<String> allowedModuleNames, boolean allowAllUnnamedModules) {
>> 40:         this.allowedModuleNames = Collections.unmodifiableSet(allowedModuleNames);
> 
> Should that be Set.copyOf() to take advantage of the immutability of `SetN` (but at the expense of additional copying)...

Honestly, I'm not even sure why we should be concerned about mutation of the set here - since we create this with a bunch of values read from a system property... e.g. should we just store `allowedModuleNames` period?

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

PR: https://git.openjdk.java.net/jdk/pull/3699


More information about the nio-dev mailing list