ws-commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d...@apache.org
Subject svn commit: r391002 - /webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java
Date Mon, 03 Apr 2006 11:14:28 GMT
Author: dims
Date: Mon Apr  3 04:14:25 2006
New Revision: 391002

URL: http://svn.apache.org/viewcvs?rev=391002&view=rev
Log:
minimize getParent() calls

Modified:
    webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java

Modified: webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java?rev=391002&r1=391001&r2=391002&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java
(original)
+++ webservices/commons/trunk/modules/axiom/src/org/apache/axiom/om/impl/builder/StAXBuilder.java
Mon Apr  3 04:14:25 2006
@@ -25,6 +25,7 @@
 import org.apache.axiom.om.OMNamespace;
 import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMXMLParserWrapper;
+import org.apache.axiom.om.OMContainer;
 import org.apache.axiom.om.impl.OMNodeEx;
 import org.apache.axiom.om.impl.llom.OMSerializerUtil;
 
@@ -162,8 +163,11 @@
             return null;
         } else if (!lastNode.isComplete()) {
             node = omfactory.createText((OMElement) lastNode, parser.getText(), textType);
-        } else if (!(lastNode.getParent() instanceof OMDocument)) {
-            node = omfactory.createText((OMElement) lastNode.getParent(), parser.getText(),
textType);
+        } else {
+            OMContainer parent = lastNode.getParent();
+            if (!(parent instanceof OMDocument)) {
+                node = omfactory.createText((OMElement) parent, parser.getText(), textType);
+            }
         }
         return node;
     }



Mime
View raw message