DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13062>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=13062

removeChild failes when a NPE when a NodeIterator is attached

           Summary: removeChild failes when a NPE when a NodeIterator is
                    attached
           Product: Xerces2-J
           Version: 2.0.2
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: Critical
          Priority: Other
         Component: DOM
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


When removeChild is called when a NodeIterator is attached at any place in the
document it failed with the following stacktrace:
java.lang.NullPointerException
        at
org.apache.xerces.dom.NodeIteratorImpl.matchNodeOrParent(NodeIteratorImpl.java:279)
        at
org.apache.xerces.dom.NodeIteratorImpl.removeNode(NodeIteratorImpl.java:373)
        at org.apache.xerces.dom.DocumentImpl.removingNode(DocumentImpl.java:1113)
        at org.apache.xerces.dom.ParentNode.internalRemoveChild(ParentNode.java:541)
        at org.apache.xerces.dom.ParentNode.removeChild(ParentNode.java:514)
        at
org.apache.xerces.dom.CoreDocumentImpl.removeChild(CoreDocumentImpl.java:467)
        at com.TestDOMImpl.main(TestDOMImpl.java:55)


A simplified code example:

public static void main(String args[]) {
  try {
    Document document = new DocumentImpl();
    Element e=document.createElement("Temp");
    document.appendChild(e);
    NodeIterator iter =
((DocumentTraversal)document).createNodeIterator(document, NodeFilter.SHOW_ALL,
null, true);
    document.removeChild(e);
  }
  catch (Exception exception) {
    exception.printStackTrace();
  }
}

It only happens when the iterator has not been detached. This worked in Xerces
2.0.1 but not in any versions after 2.0.1

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to