Cool! Thanks Eric, for a swift response and patch. Den fre 16 maj 2025 23:14Milles, Eric (TR Technology) via dev < dev@groovy.apache.org> skrev:
> This should be fixed in the next Groovy 5 release. > > https://issues.apache.org/jira/browse/GROOVY-11667 > > > ------------------------------ > *From:* Milles, Eric (TR Technology) <eric.mil...@thomsonreuters.com> > *Sent:* Friday, May 16, 2025 2:49 PM > *To:* dev@groovy.apache.org <dev@groovy.apache.org> > *Subject:* Re: GPathResult breakage in Groovy 5 > > I'm guessing it is "gpath.@id" not "this.@id" that throws the exception. > There have been some changes to help with private method access. It is > unclear without some additional tracing just where the attribute syntax > falls down. > > I don't quite know enough about GPathResult to know if > "gpath.getAttribute('id')" or "gpath.getProperty('@id')" is the equivalent > of "gpath.@id". > > > ------------------------------ > *From:* Mattias Reichel <mattias.reic...@gmail.com> > *Sent:* Thursday, May 15, 2025 3:13 AM > *To:* dev@groovy.apache.org <dev@groovy.apache.org> > *Subject:* [EXT] GPathResult breakage in Groovy 5 > > *External Email:* Use caution with links and attachments. > > 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 = gpa...@id.text() ?: 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 >