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

Strange MissingMethodException

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Won't Fix
    • 1.0-beta-5
    • 1.0-beta-6
    • None
    • None

    Description

      Strangely, the exception does not occur if you comment out either the f=... line or the g=... line.

      === test.groovy

      [1..5].each {
      f=f(5)
      [1..5].each

      { g=f(5) }

      }

      def f

      { [x] }

      === output

      []
      []
      Caught: groovy.lang.MissingMethodException: No such method: doCall for class: java.util.ArrayList with arguments: [5]
      groovy.lang.MissingMethodException: No such method: doCall for class: java.util.ArrayList with arguments: [5]
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:271)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeClosure(InvokerHelper.java:132)
      at test$2.doCall(test.groovy)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.Closure.call(Closure.java:195)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:283)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at org.codehaus.groovy.runtime.NewStaticMetaMethod.invoke(NewStaticMetaMethod.java:100)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at test$1.doCall(test.groovy:2)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.Closure.call(Closure.java:195)
      at org.codehaus.groovy.runtime.DefaultGroovyMethods.each(DefaultGroovyMethods.java:283)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at org.codehaus.groovy.runtime.NewStaticMetaMethod.invoke(NewStaticMetaMethod.java:100)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at test.run(test.groovy)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeMethod(MetaClass.java:268)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:130)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at test.invokeMethod(test.groovy)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:117)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at org.codehaus.groovy.runtime.InvokerHelper.runScript(InvokerHelper.java:332)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at test.main(test.groovy)
      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:324)
      at org.codehaus.groovy.runtime.ReflectionMetaMethod.invoke(ReflectionMetaMethod.java:56)
      at groovy.lang.MetaClass.doMethodInvoke(MetaClass.java:846)
      at groovy.lang.MetaClass.invokeStaticMethod(MetaClass.java:329)
      at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:124)
      at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:101)
      at groovy.lang.GroovyShell.run(GroovyShell.java:183)
      at groovy.lang.GroovyShell.main(GroovyShell.java:88)
      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:324)
      at org.codehaus.classworlds.Launcher.launchStandard(Launcher.java:410)
      at org.codehaus.classworlds.Launcher.launch(Launcher.java:344)
      at org.codehaus.classworlds.Launcher.main(Launcher.java:474)

      Attachments

        Activity

          People

            Unassigned Unassigned
            jaquino Jonathan Aquino
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: