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

VerifyError with a Closure using instanceof

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 1.1-rc-3
    • 1.1-rc-3
    • None
    • None

    Description

      def list = [one:'1',two:'2',three:[1,2] ]
      def i = 1
      list.find { it.value instanceof List ? it.value.find

      { i }

      : it.value == i }

      Produces:

      java.lang.VerifyError: (class: Script1$_run_closure1, method: doCall
      signature: (Ljava/lang/Object;)Ljava/lang/Object;) Accessing value
      from uninitialized register 4
             at Script1.run(Script1:3)
             at groovy.lang.GroovyShell.evaluate(GroovyShell.java:459)
             at groovy.lang.GroovyShell.evaluate(GroovyShell.java:400)
             at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
             at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
             at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
             at java.lang.reflect.Method.invoke(Method.java:585)
             at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      

      Attachments

        Activity

          People

            blackdrag Jochen Theodorou
            graemerocher Graeme Rocher
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: