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

Trying to get spliterator from a stream via method reference leads to java.lang.IllegalAccessError: tried to access class java.util.stream.BaseStream

XMLWordPrintable

      Using construct like "streamSupplier.get()::spliterator" in a lambda expression leads to

      Exception in thread "main" java.lang.IllegalAccessError: tried to access class java.util.stream.BaseStream from class IllegalAccessErrorTest$AllTests
      at IllegalAccessErrorTest$AllTests.lambda$2$bridge(IllegalAccessErrorTest.java:25)
      at IllegalAccessErrorTest$AllTests$$Lambda$3.get(Unknown Source)


      If method reference is not used no exception is thrown.

      Please see the source attached for reproduction of the issue.
      It definitely could be simplified as it has a trace of JCK's test frameworks.

      The problem could be seen on both JDK8b94 and JDK8b95-lambda.

      Plenty of JCK tests fail due to this issue, currently a "use-lambda-not-methodref" workaround is applied in the tests.

      Please redispatch this issue to compiler or VM as needed.


            vromero Vicente Arturo Romero Zaldivar
            dbessono Dmitry Bessonov
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: