[kune-commits] r1859 - trunk/src/main/java/cc/kune/core/server/content

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Apr 23 20:56:08 CEST 2012


Author: vjrj_
Date: 2012-04-23 20:56:08 +0200 (Mon, 23 Apr 2012)
New Revision: 1859

Modified:
   trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
Log:
NEW - # 257: Purge all (Empty Trash bin) fails 
http://kune.ourproject.org/issues/ticket/257

Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java	2012-04-19 13:12:45 UTC (rev 1858)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java	2012-04-23 18:56:08 UTC (rev 1859)
@@ -19,6 +19,8 @@
  */
 package cc.kune.core.server.content;
 
+import java.util.Iterator;
+
 import javax.persistence.EntityManager;
 
 import org.apache.lucene.analysis.standard.StandardAnalyzer;
@@ -136,8 +138,9 @@
     Preconditions.checkState(container.isRoot(), "Trying to purge a non root folder: " + container);
     Preconditions.checkState(container.getTypeId().equals(TrashToolConstants.TYPE_ROOT),
         "Container is not a trash root folder");
-    for (final Container childContainer : container.getChilds()) {
-      purgeContainer(childContainer);
+    final Iterator<Container> iterator = container.getChilds().iterator();
+    while (iterator.hasNext()) {
+      purgeContainer(iterator.next());
     }
     return container;
   }

Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java	2012-04-19 13:12:45 UTC (rev 1858)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java	2012-04-23 18:56:08 UTC (rev 1859)
@@ -24,6 +24,7 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.HashSet;
+import java.util.Iterator;
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
@@ -330,8 +331,9 @@
     Preconditions.checkState(container.isRoot(), "Trying to purge a non root folder: " + container);
     Preconditions.checkState(container.getTypeId().equals(TrashToolConstants.TYPE_ROOT),
         "Container is not a trash root folder");
-    for (final Content content : container.getContents()) {
-      purgeContent(content);
+    final Iterator<Content> iterator = container.getContents().iterator();
+    while (iterator.hasNext()) {
+      purgeContent(iterator.next());
     }
     return container;
   }




More information about the kune-commits mailing list