1

While I've tried to use the following code snippet with the Groovy in-operator explanation the VerifyError has occured. Have you guys any idea about?

The code and console output is below.

class Hello extends ArrayList {
    boolean isCase(Object val) {
        return val == 66
    }

    static void main(args) {
        def myList = new Hello()
        myList << 55
        assert 66 in myList
        assert !myList.contains(66)
    }
}

The error log:

Exception in thread "main" java.lang.VerifyError: (class: Hello, method: super$1$stream 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 com.intellij.rt.execution.application.AppMain.main(AppMain.java:116)

The code origin from the topic How does the Groovy in operator work?.

Update:

Groovy Version: 1.8.6 JVM: 1.6.0_45 Vendor: Sun Microsystems Inc. OS: Linux

Community
  • 1
  • 1
Yehor Nemov
  • 907
  • 2
  • 16
  • 31

1 Answers1

1

Check this out. It's for Java, but generally problem is, that you are using wrong library versions. The class is there, but different version than expected.

http://craftingjava.blogspot.co.uk/2012/08/3-reasons-for-javalangverfiyerror.html

Probably you have messed up Groovy or Java SDK installations.

alobodzk
  • 1,284
  • 2
  • 15
  • 27