When trying out Groovy 5 on the Grails codebase I am getting the following
runtime error:
groovy.lang.MissingFieldException: No such field: id for class:
groovy.xml.slurpersupport.NodeChild
at
org.grails.databinding.xml.GPathResultMap.<init>(GPathResultMap.groovy:35)
at org.grails.databinding.xml.GPathResultMapSpec.Test nested
elements(GPathResultMapSpec.groovy:44)
class GPathResultMap implements Map {
protected GPathResult gpath
protected id
GPathResultMap(GPathResult gpath) {
this.gpath = gpath
this.@id = [email protected]() ?: null // <-- This is the offending line
}
There is no id attribute on the GPathResult root:
<person>
<name>John Doe</name>
<locations>
<location>
<shippingAddress>foo</shippingAddress>
<billingAddress>bar</billingAddress>
</location>
<location>
<shippingAddress>foo2</shippingAddress>
<billingAddress>bar2</billingAddress>
</location>
</locations>
</person>
Is this expected behavior, and we need to update our logic, or is it an
issue that needs addressing in Groovy?
Thanks
Mattias