ws-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From veit...@apache.org
Subject svn commit: r1299355 - /webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java
Date Sun, 11 Mar 2012 12:54:14 GMT
Author: veithen
Date: Sun Mar 11 12:54:14 2012
New Revision: 1299355

URL: http://svn.apache.org/viewvc?rev=1299355&view=rev
Log:
Fixed an incorrect iterator usage. Woden was assuming that Iterator#next() returns null if
there are no more items. This however is incorrect and the code only worked because of a bug
in Axiom.

Modified:
    webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java

Modified: webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java
URL: http://svn.apache.org/viewvc/webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java?rev=1299355&r1=1299354&r2=1299355&view=diff
==============================================================================
--- webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java
(original)
+++ webservices/woden/trunk/java/woden-om/src/main/java/org/apache/woden/internal/OMXMLElement.java
Sun Mar 11 12:54:14 2012
@@ -155,13 +155,12 @@ public class OMXMLElement extends BaseXM
         OMElement elem = (OMElement)fSource;
         Iterator elems = elem.getChildElements();
         List children = new Vector();
-        Object next = elems.next();
-        while(next != null)
+        while(elems.hasNext())
         {
+            Object next = elems.next();
             OMXMLElement omXMLElement = new OMXMLElement(fErrorReporter);
             omXMLElement.setSource(next);
             children.add(omXMLElement);
-            next = elems.next();
         }
         XMLElement[] array = new XMLElement[children.size()];
         children.toArray(array);



Mime
View raw message