[foreign-memaccess+abi] RFR: 8293367: Enable native access for modules not in the boot layer [v3]

Alan Bateman alanb at openjdk.org
Sun Sep 25 09:29:38 UTC 2022


On Wed, 21 Sep 2022 14:16:58 GMT, Athijegannathan Sundararajan <sundar at openjdk.org> wrote:

>> Adding a new API ModuleLayer.Controller.enableNativeAccess(Module).
>> Reworked thread safety of enable native access flag reading and setting.
>
> Athijegannathan Sundararajan has updated the pull request incrementally with one additional commit since the last revision:
> 
>   review comments

src/java.base/share/classes/java/lang/ModuleLayer.java line 322:

> 320:          *         does not mention the module name {@code M}, or {@code ALL-UNNAMED} in case
> 321:          *         {@code M} is an unnamed module.
> 322:          */

The implementation changes are okay but I think the javadoc, particularly the description for IllegalCallerException, will need a bit of word smithing as we can't use informal language like "does not mention the module name" or talk about command line options or operands that the RI provides. The method description links to the "Restricted methods" section in the package description and maybe lend on that rather than trying to repeat in the exception description. It may be that you can just say that the caller is in a module that does not have native access enabled. That will work for module layers because the caller may had its native access enabled via the API rather than the command line.

The method will also needs a @throws IllegalArgumentException for when the module is not in the module layer.

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

PR: https://git.openjdk.org/panama-foreign/pull/729


More information about the panama-dev mailing list