svn commit: r926923 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r926923 - /ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java

doogie-3
Author: doogie
Date: Wed Mar 24 03:22:12 2010
New Revision: 926923

URL: http://svn.apache.org/viewvc?rev=926923&view=rev
Log:
Check for validity after converting, instead of before.

Modified:
    ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java

Modified: ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java?rev=926923&r1=926922&r2=926923&view=diff
==============================================================================
--- ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java (original)
+++ ofbiz/trunk/framework/base/src/org/ofbiz/base/util/collections/IteratorWrapper.java Wed Mar 24 03:22:12 2010
@@ -36,9 +36,10 @@ public abstract class IteratorWrapper<DE
         if (!it.hasNext()) return false;
         do {
             lastSrc = it.next();
-            if (isValid(lastSrc)) {
+            DEST nextDest = convert(lastSrc);
+            if (isValid(lastSrc, nextDest)) {
                 nextCalled = true;
-                lastDest = convert(lastSrc);
+                lastDest = nextDest;
                 return true;
             }
         } while (it.hasNext());
@@ -55,8 +56,8 @@ public abstract class IteratorWrapper<DE
 
     public void remove() {
         if (lastSrc != null) {
-            it.remove();
             noteRemoval(lastDest, lastSrc);
+            it.remove();
             lastDest = null;
             lastSrc = null;
         } else {
@@ -64,7 +65,7 @@ public abstract class IteratorWrapper<DE
         }
     }
 
-    protected boolean isValid(SRC src) {
+    protected boolean isValid(SRC src, DEST dest) {
         return true;
     }