Author: veithen
Date: Sun May 12 09:36:56 2013
New Revision: 1481500

URL: http://svn.apache.org/r1481500
Log:
Removed the SWITCHED state. With the introduction of PullThroughWrapper, this 
state is no longer used.

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=1481500&r1=1481499&r2=1481500&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
 Sun May 12 09:36:56 2013
@@ -120,8 +120,6 @@ class SwitchingWrapper extends AbstractX
      */
     private static final short COMPLETED = 2;
     
-    private static final short SWITCHED = 3;
-    
     /**
      * Indicates that the final {@link XMLStreamConstants#END_DOCUMENT} event 
has been generated.
      */
@@ -1006,10 +1004,6 @@ class SwitchingWrapper extends AbstractX
                 }
                 updateCompleteStatus();
                 break;
-            case SWITCHED:
-                currentEvent = parser.next();
-                updateCompleteStatus();
-                break;
             default:
                 throw new IllegalStateException("unsuppported state!");
         }
@@ -1064,23 +1058,11 @@ class SwitchingWrapper extends AbstractX
         } else if (currentEvent == END_ELEMENT) {
             depth--;
         }
-        if (state == NAVIGABLE) {
-            if (rootNode == node && visited) {
-                if (currentEvent == END_DOCUMENT) {
-                    state = DOCUMENT_COMPLETE;
-                } else {
-                    state = COMPLETED;
-                }
-            }
-        } else {
-            assert state == SWITCHED;
-            if (depth == 0 && rootNode instanceof OMElement) {
-                // If rootNode is an OMElement and depth == 0, then 
currentEvent can only be END_ELEMENT
-                // (because we don't generate any other events at depth 0)
-                assert currentEvent == END_ELEMENT;
-                state = COMPLETED;
-            } else if (currentEvent == END_DOCUMENT) {
+        if (rootNode == node && visited) {
+            if (currentEvent == END_DOCUMENT) {
                 state = DOCUMENT_COMPLETE;
+            } else {
+                state = COMPLETED;
             }
         }
     }


Reply via email to