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

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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 1.8.9, 2.0.8, 2.1.9, 2.2.1
    • 2.3.0-beta-1
    • bytecode
    • 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

            blackdrag Jochen Theodorou
            mpierce Marlon Pierce
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: