You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commons-dev@ws.apache.org by ve...@apache.org on 2008/12/16 13:16:06 UTC

svn commit: r727037 - /webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java

Author: veithen
Date: Tue Dec 16 04:16:06 2008
New Revision: 727037

URL: http://svn.apache.org/viewvc?rev=727037&view=rev
Log:
WSCOMMONS-372: Changed OMChildrenIterator so that parsing exceptions are no longer swallowed.

Modified:
    webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java

Modified: webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java
URL: http://svn.apache.org/viewvc/webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java?rev=727037&r1=727036&r2=727037&view=diff
==============================================================================
--- webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java (original)
+++ webservices/commons/trunk/modules/axiom/modules/axiom-api/src/main/java/org/apache/axiom/om/impl/traverse/OMChildrenIterator.java Tue Dec 16 04:16:06 2008
@@ -39,8 +39,6 @@
     /** Field removeCalled */
     protected boolean removeCalled = false;
 
-    protected boolean isExceptionThrownInAdvancingToNextElement = false;
-
     /**
      * Constructor OMChildrenIterator.
      *
@@ -83,11 +81,10 @@
      * Returns <tt>true</tt> if the iteration has more elements. (In other words, returns
      * <tt>true</tt> if <tt>next</tt> would return an element rather than throwing an exception.)
      *
-     * @return Returns <tt>true</tt> if the iterator has more elements. This will never throw an
-     *         exception even there is an exception thrown underneath.
+     * @return Returns <tt>true</tt> if the iterator has more elements.
      */
     public boolean hasNext() {
-        return (currentChild != null && !isExceptionThrownInAdvancingToNextElement);
+        return (currentChild != null);
     }
 
     /**
@@ -102,11 +99,7 @@
         removeCalled = false;
         if (hasNext()) {
             lastChild = currentChild;
-            try {
-                currentChild = currentChild.getNextOMSibling();
-            } catch (OMException e) {
-                isExceptionThrownInAdvancingToNextElement = true;
-            }
+            currentChild = currentChild.getNextOMSibling();
             return lastChild;
         } else {
             throw new NoSuchElementException();