Details
-
Bug
-
Status: Closed
-
Major
-
Resolution: Fixed
-
1.6
-
None
-
Mac OS X
Description
The following test fails - the new node is always inserted at the end of the list
def xml = "<parent><child id=\"1\"/></parent>" def parent = new XmlParser().parseText(xml) def node = new Node(parent, "child", [id:"2"]) parent.child.add(0, node) assert parent.child[0] == node
The following test fails too - In this case, the second assertions fails - the node is inserted twice!
def xml = "<parent><child id=\"1\"/></parent>" def parent = new XmlParser().parseText(xml) def node = new Node(parent, "child", [id:"2"]) parent.children().add(0, node) assert parent.children()[0] == node assert parent.children()[2] != node