Community
Participate
Working Groups
Created attachment 200591 [details] Proposed patch for the NodeContainer When calling org.w3c.dom.Node node, child; node.replaceChild(child, child); I would expect that the result is the same DOM as before. But as the JavaDoc for org.w3c.dom.Node.replaceChild(Node, Node) says: "Replacing a node with itself is implementation dependent." I would at least expect an exception then. The org.eclipse.wst.xml.core.internal.document.NodeContainer.replaceChild(Node, Node) implementation does something totally different: it removes the given node. From my point of view, it should make an identity check before any modification.
Thanks for your patch, Tobias. Looks great! I've added a unit test to go along with the fix and released the code.