RFR: 8256299: Implement JEP 396: Strongly Encapsulate JDK Internals by Default [v6]
Mark Reinhold
mr at openjdk.java.net
Wed Nov 25 23:50:14 UTC 2020
On Fri, 20 Nov 2020 13:08:11 GMT, Alan Bateman <alanb at openjdk.org> wrote:
>> Looks good.
>
> testWithAddExportsInManifest create an executable JAR with "Add-Exports: java.base/sun.security.x509" in the manifest. It runs it twice, once without any options, the second with --illegal-access=permit, and checks there are no warnings in both cases. To test attempted deep reflection here would need the equivalent of setAccessibleNonPublicMemberNonExportedPackage that tries to access some privates in sun.security.x509. It's okay to use setAccessibleNonPublicMemberNonExportedPackage to test that privates in sun.nio.ch aren't accessible but it's not connected to the Add-Exports attribute in the JAR file.
Thanks for pointing that out. I fixed it by arranging for the `Add-Exports` test to export both `sun.security.x509` and `sun.nio.ch`.
-------------
PR: https://git.openjdk.java.net/jdk/pull/1324
More information about the core-libs-dev
mailing list