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/01/13 20:33:34 UTC
svn commit: r1432713 -
/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
Author: veithen
Date: Sun Jan 13 19:33:34 2013
New Revision: 1432713
URL: http://svn.apache.org/viewvc?rev=1432713&view=rev
Log:
No need to look two nodes ahead.
Modified:
webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
Modified: webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java?rev=1432713&r1=1432712&r2=1432713&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-common-impl/src/main/java/org/apache/axiom/om/impl/common/SwitchingWrapper.java Sun Jan 13 19:33:34 2013
@@ -192,7 +192,6 @@ class SwitchingWrapper extends AbstractX
// returns the starting node at the first call to it
currentNode = navigator.getNext();
- updateNextNode();
if (startNode instanceof OMDocument) {
currentEvent = -1;
try {
@@ -889,6 +888,9 @@ class SwitchingWrapper extends AbstractX
* @throws XMLStreamException
*/
public int next() throws XMLStreamException {
+ if (state == NAVIGABLE) {
+ updateNextNode();
+ }
switch (state) {
case DOCUMENT_COMPLETE:
throw new NoSuchElementException("End of the document reached");
@@ -973,7 +975,6 @@ class SwitchingWrapper extends AbstractX
attributeCount = -1;
namespaceCount = -1;
currentNode = nextNode;
- updateNextNode();
}
/** Method updateNextNode. */