ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1481381 - /webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
Date Sat, 11 May 2013 17:26:50 GMT
Author: veithen
Date: Sat May 11 17:26:50 2013
New Revision: 1481381

URL: http://svn.apache.org/r1481381
Log:
Inlined a private method that is only used once.

Modified:
    webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java

Modified: webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
URL: http://svn.apache.org/viewvc/webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java?rev=1481381&r1=1481380&r2=1481381&view=diff
==============================================================================
--- webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
(original)
+++ webservices/axiom/trunk/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/serializer/pull/SwitchingWrapper.java
Sat May 11 17:26:50 2013
@@ -863,37 +863,6 @@ class SwitchingWrapper extends AbstractX
         }
     }
 
-    /** Private method to encapsulate the searching logic. */
-    private void nextNode() {
-        if (node == null) {
-            // We get here if rootNode is an element and the current event is START_DOCUMENT
-            node = rootNode;
-        } else if (!isLeaf(node) && !visited) {
-            OMNode firstChild = _getFirstChild((OMContainer) node);
-            if (firstChild != null) {
-                node = firstChild;
-                visited = false;
-            } else if (node.isComplete()) {
-                visited = true;
-            } else {
-                node = null;
-            }
-        } else {
-            OMNode nextNode = (OMNode)node;
-            OMContainer parent = nextNode.getParent();
-            OMNode nextSibling = getNextSibling(nextNode);
-            if (nextSibling != null) {
-                node = nextSibling;
-                visited = false;
-            } else if (parent.isComplete()) {
-                node = parent;
-                visited = true;
-            } else {
-                node = null;
-            }
-        }
-    }
-    
     /**
      * @param n OMNode
      * @return true if this OMNode should be considered a leaf node
@@ -966,7 +935,33 @@ class SwitchingWrapper extends AbstractX
                 currentEvent = END_DOCUMENT;
                 break;
             case NAVIGABLE:
-                nextNode();
+                if (node == null) {
+                    // We get here if rootNode is an element and the current event is START_DOCUMENT
+                    node = rootNode;
+                } else if (!isLeaf(node) && !visited) {
+                    OMNode firstChild = _getFirstChild((OMContainer) node);
+                    if (firstChild != null) {
+                        node = firstChild;
+                        visited = false;
+                    } else if (node.isComplete()) {
+                        visited = true;
+                    } else {
+                        node = null;
+                    }
+                } else {
+                    OMNode nextNode = (OMNode)node;
+                    OMContainer parent = nextNode.getParent();
+                    OMNode nextSibling = getNextSibling(nextNode);
+                    if (nextSibling != null) {
+                        node = nextSibling;
+                        visited = false;
+                    } else if (parent.isComplete()) {
+                        node = parent;
+                        visited = true;
+                    } else {
+                        node = null;
+                    }
+                }
                 if (node instanceof OMSourcedElement) {
                     OMSourcedElement element = (OMSourcedElement)node;
                     if (!element.isExpanded()) {



Mime
View raw message