Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.0
-
None
-
Mac OS X, groovy 1.0
Description
I am seeing odd behavior when I try to use a MarkupBuilder in a static method. The following fails with a MissingMethodException (waba is the missing method):
Foo.groovy
class Foo { static void main(args) { def xml = new groovy.xml.MarkupBuilder() def configMap = [name:'Jeff'] xml.foo { configMap.each { key, value -> waba(name:'bar') } } } }
The following seems to work fine:
Foo.groovy
class Foo { static void main(args) { new Foo() } public Foo() { def xml = new groovy.xml.MarkupBuilder() def configMap = [name:'Jeff'] xml.foo { configMap.each { key, value -> waba(name:'bar') } } } }