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

sun/security/util/DerValue/Indefinite.java fails with ---illegal-access=deny

    XMLWordPrintable

    Details

      Description

      This test needs to be updated to work with --illegal-access=deny as this will be the default in the future. Without a fix, the test will fail with:

      java.lang.reflect.InaccessibleObjectException: Unable to make field final byte[] sun.security.util.DerValue.buffer accessible: module java.base does not "opens sun.security.util" to unnamed module @77a57272
      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.Field.checkCanSetAccessible(Field.java:177)
      at java.base/java.lang.reflect.Field.setAccessible(Field.java:171)
      at Indefinite.test(Indefinite.java:72)
      at Indefinite.main(Indefinite.java:46)


      diff --git a/test/jdk/sun/security/util/DerValue/Indefinite.java b/test/jdk/sun/security/util/DerValue/Indefinite.java
      index 17270c6642f..f69a0515041 100644
      --- a/test/jdk/sun/security/util/DerValue/Indefinite.java
      +++ b/test/jdk/sun/security/util/DerValue/Indefinite.java
      @@ -25,7 +25,7 @@
        * @test
        * @bug 6731685 8249783
        * @summary CertificateFactory.generateCertificates throws IOException on PKCS7 cert chain
      - * @modules java.base/sun.security.util
      + * @modules java.base/sun.security.util:+open
        * @library /test/lib
        */


        Attachments

          Issue Links

            Activity

              People

              Assignee:
              weijun Weijun Wang
              Reporter:
              alanb Alan Bateman
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: