Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Fixed
-
1.6-beta-1
Description
Test Case:
class Foo extends BuilderSupport { public void setParent(Object parent, Object child){ parent.setFoo(child) } public Object createNode(Object name){ return createNode(name,(Object)null) } public Object createNode(Object name, Object value){ return createNode(name,[:],value) } public Object createNode(Object name, Map attributes){ return createNode(name,attributes,null) } public Object createNode(Object name, Map attributes, Object value){ return "${name}" } } try { def f = new Foo() f.foo { bar() } } catch(MissingMethodException e) { assert e.method == "setFoo", "was ${e.method}" }
It's actually the method setFoo that is missing, but it is reported as bar that is missing. Any MissingMethodException thrown while inside a Builder will be misreported in this way.
Attachments
Attachments
Issue Links
- relates to
-
GROOVY-7156 Builders behave strange when closures throw MissingMethodException
- Closed