Uploaded image for project: 'Groovy'
  1. Groovy
  2. GROOVY-6550

VerifyError when instantiating class that has Java 8 default method in its ancestry

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 1.8.9, 2.0.8, 2.1.9, 2.2.1
    • Fix Version/s: 2.3.0-beta-1
    • Component/s: bytecode
    • Labels:
    • Environment:
      JDK 8 M8 b127

      Description

      I've created a simple repro here: https://bitbucket.org/marshallpierce/java8-groovy-verifyerror

      The README has full details; I'll copy a trimmed version here.

      It looks like every available groovy version (1.8.9, 2.0.8, 2.1.9, 2.2.1) all have issues with generating bytecode for classes that extend interfaces that have default method implementations (new in Java 8).

      Under Java 7, `./gradlew clean build` succeeds. Under Java 8, it fails with a VerifyError:

      java.lang.VerifyError: (class: org/mpierce/groovy/GroovySetSubclass, method: super$1$parallelStream signature: ()Ljava/util/stream/Stream;) Illegal use of nonvirtual function call
      	at java.lang.Class.forName0(Native Method)
      	at java.lang.Class.forName(Class.java:259)
      	at org.mpierce.groovy.GroovySetSubclassTest.class$(GroovySetSubclassTest.groovy)
      	at org.mpierce.groovy.GroovySetSubclassTest.$get$$class$org$mpierce$groovy$GroovySetSubclass(GroovySetSubclassTest.groovy)
      	at org.mpierce.groovy.GroovySetSubclassTest.testGroovySubclass(GroovySetSubclassTest.groovy:9)
      

      GroovySetSubclass is a trivial subclass of HashSet. Java analogs are

        Attachments

          Activity

            People

            • Assignee:
              blackdrag Jochen Theodorou
              Reporter:
              mpierce Marshall Pierce
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: