Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8255394

jdk/test/lib/hexdump/ASN1FormatterTest.java fails with ---illegal-access=deny

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 16
    • Fix Version/s: 16
    • Component/s: other-libs
    • Labels:
    • Resolved In Build:
      b22

      Description

      This test fails when run with --illegal-access=deny.

      java.lang.reflect.InaccessibleObjectException: Unable to make public static sun.security.util.KnownOIDs sun.security.util.KnownOIDs.findMatch(java.lang.String) accessible: module java.base does not "exports sun.security.util" to unnamed module @7efb1695
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:357)
      at java.base/java.lang.reflect.AccessibleObject.checkCanSetAccessible(AccessibleObject.java:297)
      at java.base/java.lang.reflect.Method.checkCanSetAccessible(Method.java:196)
      at java.base/java.lang.reflect.Method.setAccessible(Method.java:190)
      at jdk.test.lib.hexdump.ASN1Formatter.oidName(ASN1Formatter.java:415)
      at jdk.test.lib.hexdump.ASN1Formatter.annotate(ASN1Formatter.java:230)
      at jdk.test.lib.hexdump.ASN1Formatter.annotate(ASN1Formatter.java:313)
      at jdk.test.lib.hexdump.ASN1Formatter.annotate(ASN1Formatter.java:313)
      at jdk.test.lib.hexdump.ASN1Formatter.annotate(ASN1Formatter.java:313)
      at jdk.test.lib.hexdump.ASN1Formatter.annotate(ASN1Formatter.java:133)
      at jdk.test.lib.hexdump.HexPrinter$AnnotationWriter.flush(HexPrinter.java:1026)
      at jdk.test.lib.hexdump.HexPrinter.toString(HexPrinter.java:535)
      at jdk.test.lib.hexdump.ASN1FormatterTest.dumpPEM(ASN1FormatterTest.java:91)

      diff --git a/test/lib-test/jdk/test/lib/hexdump/ASN1FormatterTest.java b/test/lib-test/jdk/test/lib/hexdump/ASN1FormatterTest.java
      index 01887fa8baa..ac8d229c3c2 100644
      --- a/test/lib-test/jdk/test/lib/hexdump/ASN1FormatterTest.java
      +++ b/test/lib-test/jdk/test/lib/hexdump/ASN1FormatterTest.java
      @@ -39,6 +39,7 @@ import static org.testng.Assert.*;
       /*
        * @test
        * @summary ASN.1 formatting
      + * @modules java.base/sun.security.util:open
        * @library /test/lib
        * @compile ASN1FormatterTest.java
        * @run testng jdk.test.lib.hexdump.ASN1FormatterTest

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              rriggs Roger Riggs
              Reporter:
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: