Author: mrglavas
Date: Mon Aug 28 08:52:19 2006
New Revision: 437729

URL: http://svn.apache.org/viewvc?rev=437729&view=rev
Log:
Fixing JIRA Bug #1180: 
http://issues.apache.org/jira/browse/XERCESJ-1180

When an element node is materialized we were assuming that it must be the
document element if (docElement == null). It's possible for this field to
be null when other elements are created, for instance if the children of the
document element are expanded after the document element has been removed
from the tree. In such a case one of the child element nodes was being
blindly assigned as the document node. This should be fixed now. Note that
DeferredDocumentImpl.synchronizeChildren() handles assignment of the
document element so the code that I'm removing was always redundant.

Modified:
    xerces/java/trunk/src/org/apache/xerces/dom/DeferredDocumentImpl.java

Modified: xerces/java/trunk/src/org/apache/xerces/dom/DeferredDocumentImpl.java
URL: 
http://svn.apache.org/viewvc/xerces/java/trunk/src/org/apache/xerces/dom/DeferredDocumentImpl.java?rev=437729&r1=437728&r2=437729&view=diff
==============================================================================
--- xerces/java/trunk/src/org/apache/xerces/dom/DeferredDocumentImpl.java 
(original)
+++ xerces/java/trunk/src/org/apache/xerces/dom/DeferredDocumentImpl.java Mon 
Aug 28 08:52:19 2006
@@ -998,11 +998,6 @@
                     node = new DeferredElementImpl(this, nodeIndex);
                 }
 
-                // save the document element node
-                if (docElement == null) {
-                    docElement = (ElementImpl)node;
-                }
-
                 // check to see if this element needs to be
                 // registered for its ID attributes
                 if (fIdElement != null) {



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

Reply via email to