Author: ajith
Date: Thu Sep  1 05:25:26 2005
New Revision: 265707

URL: http://svn.apache.org/viewcvs?rev=265707&view=rev
Log:
Fixing a hidden bug that might have survived all our test cases! In the 
addChild method the order of the statements is changed. Since the setting of 
the parent strips down all the links the setting of siblings should take place 
AFTER setting the parent.
This caused the iterators to act incorrectly

Modified:
    
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java

Modified: 
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
URL: 
http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java?rev=265707&r1=265706&r2=265707&view=diff
==============================================================================
--- 
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
 (original)
+++ 
webservices/axis2/trunk/java/modules/xml/src/org/apache/axis2/om/impl/llom/OMElementImpl.java
 Thu Sep  1 05:25:26 2005
@@ -212,6 +212,13 @@
      * Method addChild
      */
     private void addChild(OMNodeImpl child) {
+        //the order of these statements is VERY important
+        //Since setting the parent has a detach method inside
+        //it strips down all the rerefences to siblings.
+        //setting the siblings should take place AFTER setting the parent
+
+        child.setParent(this);
+
         if (firstChild == null) {
             firstChild = child;
             child.setPreviousSibling(null);
@@ -219,8 +226,8 @@
             child.setPreviousSibling(lastChild);
             lastChild.setNextSibling(child);
         }
+
         child.setNextSibling(null);
-        child.setParent(this);
         lastChild = child;
 
     }


Reply via email to