Groovy 6, xml-processing improvements, code like ”...
# groovy
j
Groovy 6, xml-processing improvements, code like ”node as Node” will now fail if the type of node is Node while it worked on 5.1.3, this might be a regression?
v
You should probably provide an MCVE. Because for example this works just fine: groovyconsole.dev/?g=groovy_6_0&codez=…
p
also, check for classloader issues
j
The new xml coercion extension targets groovy.util.Node
Not XmlSlurper
p
It is already a Node, so you don't need the "as Node" but that does look strange
👍 1
v
Ah, that looks like a bug, yeah
It is already a Node, so you don't need the "as Node" but that does look strange
In some situations you need it occasionally
👍 1
p
worth creating a jira which we can always close if it turns out to be nothing
j
I do believe there is a small check and early return missing along the lines of ”if type instanceof self then return type cast self”(sorry for the pseudo, im on my phone)
In our code base it could be that sometimes node is not groovy.util.Node, or perhaps the ”as Node” has been used to get rid of some intellij warning
v
Will you create the Jira issue for this? 🙂
I take that as a "No", here it is: issues.apache.org/jira/browse/GROOVY-12474
👍 1