You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ws.apache.org by ve...@apache.org on 2013/05/18 12:21:41 UTC

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

Author: veithen
Date: Sat May 18 10:21:40 2013
New Revision: 1484084

URL: http://svn.apache.org/r1484084
Log:
Inlined a private method that is used only 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=1484084&r1=1484083&r2=1484084&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 18 10:21:40 2013
@@ -769,7 +769,16 @@ final class SwitchingWrapper extends Pul
                 }
                 if (nextNode != null) {
                     node = nextNode;
-                    currentEvent = generateEvents(node);
+                    if (node instanceof OMContainer) {
+                        OMContainer container = (OMContainer)node;
+                        if (visited) {
+                            currentEvent = container instanceof OMDocument ? END_DOCUMENT : END_ELEMENT;
+                        } else {
+                            currentEvent = container instanceof OMDocument ? START_DOCUMENT : START_ELEMENT;
+                        }
+                    } else {
+                        currentEvent = ((OMNode)node).getType();
+                    }
                     attributeCount = -1;
                     namespaceCount = -1;
                 } else {
@@ -1005,27 +1014,6 @@ final class SwitchingWrapper extends Pul
     }
 
     /*
-     *
-     * ################################################################
-     * Generator methods for the OMNodes returned by the navigator
-     * ################################################################
-     *
-     */
-
-    private int generateEvents(OMSerializable node) {
-        if (node instanceof OMContainer) {
-            OMContainer container = (OMContainer)node;
-            if (visited) {
-                return container instanceof OMDocument ? END_DOCUMENT : END_ELEMENT;
-            } else {
-                return container instanceof OMDocument ? START_DOCUMENT : START_ELEMENT;
-            }
-        } else {
-            return ((OMNode)node).getType();
-        }
-    }
-
-    /*
      * ####################################################################
      * Other helper methods
      * ####################################################################