Details
-
Bug
-
Status: Closed
-
Blocker
-
Resolution: Fixed
-
None
-
None
-
None
Description
Basically the problem seems to affect only certain method calls that take place in nested (2nd-level) closures. This text is mostly cut and paste from the ML so where you read Grails, replace it with Groovy 1.1-beta-3.
(ML thread: http://www.nabble.com/Fwd%3A-Method-calls-in-nested-closures---recent-change-in-behavior--tf4379730.html)
This code produces different results in Groovy 1.1-beta-2's console and beta-3's:
import groovy.xml.* class Builder { String build() { def writer = new StringWriter() def mkp = new groovy.xml.MarkupBuilder(writer) def self = this mkp."envelope" { body { def r = doSomething("one", [:], null) assert r instanceof String def attributes = transformMap([:]) assert attributes instanceof Map } } return writer.toString() } private transformMap(arg) { println "transformMap called" return arg } private doSomething(str, map, whatever) { return "abc" } } class BuilderTest { def ownMethodCount = 0 def test() { def b = new Builder() b.build() } } def t = new BuilderTest() println t.test()
(I'm only using XmlBuilder since that's what my real code uses, but I don't think it's limited to XmlBuilder.)
In Groovy 1.1-beta-2 console I get:
transformMap called <envelope> <body /> </envelope>
In Grails's console I get:
Exception thrown: java.lang.AssertionError : Expression: (attributes instanceof java.util.Map). Values: attributes = transformMap java.lang.AssertionError: Expression: (attributes instanceof java.util.Map). Values: attributes = transformMap at org.codehaus.groovy.runtime.InvokerHelper.assertFailed (InvokerHelper.java:370) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.assertFailed(ScriptBytecodeAdapter.java:691) at Builder$_build_closure1_closure2.doCall(Script6:13) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at Builder$_build_closure1_closure2.doCall(Script6) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.util.BuilderSupport.doInvokeMethod (BuilderSupport.java:148) at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:721) at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:638) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:67) at Builder$_build_closure1.doCall(Script6:9) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at Builder$_build_closure1.doCall(Script6) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.util.BuilderSupport.doInvokeMethod (BuilderSupport.java:148) at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:119) at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at Builder.build(Script6:8) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java :202) at BuilderTest.test(Script6:33) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java :202) at Script6.run(Script6:38) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at groovy.ui.Console$_runScript_closure10.doCall(Console.groovy:675) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at groovy.ui.Console$_runScript_closure10.doCall(Console.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:585) at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.lang.Closure.run (Closure.java:366) at java.lang.Thread.run(Thread.java:595)
Some observations I have made by modifying the code for beta-3:
- it can be fixed by qualifying the call to "transformMap" with a rerfence to class instance, eg: self.transformMap (self is already defined above for this purpose). But why don't I need to qualify the call to "doSomething"?
- comment out the inner "body" method and closure opening bracket and closing bracket, like:
mkp."envelope" { // body { def r = doSomething("one", [:], null) assert r instanceof String def attributes = transformMap(null) assert attributes instanceof Map // }
well of course the result is wrong, but this time the "transformMap" method is called:
transformMap called <envelope />
- If I change the private methods to closures, like:
private transformMap = { arg -> println "transformMap called" return [:] } private doSomething = { str, map, whatever -> return "abc" }
it still works ok in Groovy 1.1-beta-2 but I get a different error with Grails:
java.lang.NullPointerException at groovy.xml.MarkupBuilder.createNode(MarkupBuilder.java :125) at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:87) at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java :721) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:638) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at Builder$_build_closure3_closure4.doCall(Script14:12) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:67) at Builder$_build_closure3_closure4.doCall(Script14) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.util.BuilderSupport.doInvokeMethod(BuilderSupport.java:148) at groovy.util.BuilderSupport.invokeMethod (BuilderSupport.java:64) at groovy.lang.MetaClassImpl.invokeMethodOnGroovyObject(MetaClassImpl.java:721) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:638) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN(ScriptBytecodeAdapter.java:67) at Builder$_build_closure3.doCall(Script14:9) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at Builder$_build_closure3.doCall(Script14) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.util.BuilderSupport.doInvokeMethod (BuilderSupport.java:148) at groovy.util.BuilderSupport.invokeMethod(BuilderSupport.java:64) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:119) at org.codehaus.groovy.runtime.Invoker.invokeMethod (Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod(InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at Builder.build(Script14:8) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java :202) at BuilderTest.test(Script14:33) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke (MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod (MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethod0(ScriptBytecodeAdapter.java :202) at Script14.run(Script14:38) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at org.codehaus.groovy.runtime.Invoker.invokePogoMethod(Invoker.java:115) at org.codehaus.groovy.runtime.Invoker.invokeMethod(Invoker.java:81) at org.codehaus.groovy.runtime.InvokerHelper.invokeMethod (InvokerHelper.java:85) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodN(ScriptBytecodeAdapter.java:159) at groovy.ui.Console$_runScript_closure10.doCall(Console.groovy:675) 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:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod(ExpandoMetaClass.java:894) at org.codehaus.groovy.runtime.ScriptBytecodeAdapter.invokeMethodOnCurrentN (ScriptBytecodeAdapter.java:67) at groovy.ui.Console$_runScript_closure10.doCall(Console.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:585) at org.codehaus.groovy.runtime.metaclass.ReflectionMetaMethod.invoke (ReflectionMetaMethod.java:58) at org.codehaus.groovy.runtime.MetaClassHelper.doMethodInvoke(MetaClassHelper.java:678) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:689) at groovy.lang.ExpandoMetaClass.invokeMethod (ExpandoMetaClass.java:894) at groovy.lang.MetaClassImpl.invokeMethod(MetaClassImpl.java:531) at groovy.lang.Closure.call(Closure.java:290) at groovy.lang.Closure.call(Closure.java:285) at groovy.lang.Closure.run (Closure.java:366) at java.lang.Thread.run(Thread.java:595)