Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
None
-
None
-
None
Description
the following scripts fails, because the methodMissing not in A throws a MissingMethodException, but the Exception is not catched, because it is wrapped in a invokerInvocationException and not unpacked correctly. As a result the Closure code fails to catch the MissingMethodException and does no longer call A#missingMethod
class A { def invokeMethod(String name, args) { "A" } } def methodMissing(String name, args) { visited=true throw new MissingMethodException(name,this.class,args) } visited=false def closure = { foo() } closure.delegate = new A() assert closure() == "A" assert visited==true