[foreign-preview] RFR: 8282210: Relax policy for restricted method invocation

Jorn Vernee jvernee at openjdk.java.net
Thu Feb 24 12:18:30 UTC 2022


On Thu, 24 Feb 2022 11:13:57 GMT, Julia Boes <jboes at openjdk.org> wrote:

> This change adapts the policy for restricted method invocation, which is controlled via the --enable-native-access flag. 
> 
> As a transitional mode, access to restricted methods is allowed when the flag is not specified, with a runtime warning being omitted on first invocation. This mode supports applications and use cases where the flag cannot easily be specified.
> 
> The behaviour for when the flag is specified remains unchanged.

Nice test! One minor comment inline.

test/jdk/java/foreign/enablenativeaccess/TestEnableNativeAccess.java line 182:

> 180:                 .outputTo(System.out)
> 181:                 .errorTo(System.out);
> 182:         if (expectedResult != null)

I don't see how `expectedResult` could be `null` here? If it is `null` unexpectedly, I think it would be better to fail here (to avoid false-positives).

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

Marked as reviewed by jvernee (Committer).

PR: https://git.openjdk.java.net/panama-foreign/pull/655


More information about the panama-dev mailing list