Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 1.6-rc-1, 1.5.8, 1.7-beta-1
-
Component/s: None
-
Labels:None
-
Number of attachments :
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