Author: chris.laprun(a)jboss.com
Date: 2011-08-08 18:51:54 -0400 (Mon, 08 Aug 2011)
New Revision: 7013
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollection.java
Log:
- Ignore empty collections since it would otherwise break the iterator.
Modified:
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollection.java
===================================================================
---
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollection.java 2011-08-08
22:50:34 UTC (rev 7012)
+++
portal/branches/api/component/api-impl/src/main/java/org/gatein/portal/api/impl/util/AggregatedIterableIdentifiableCollection.java 2011-08-08
22:51:54 UTC (rev 7013)
@@ -31,14 +31,21 @@
import java.util.List;
import java.util.NoSuchElementException;
-/** @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a> */
+/**
+ * TODO: fix logic, adding empty collections shouldn't break the iteration process,
just move to the next collection
+ *
+ * @author <a href="mailto:chris.laprun@jboss.com">Chris
Laprun</a>
+ */
public class AggregatedIterableIdentifiableCollection<T extends
Identifiable<T>> implements IterableIdentifiableCollection<T>
{
private List<IterableIdentifiableCollection> aggregated = new
ArrayList<IterableIdentifiableCollection>(7);
public void addCollection(IterableIdentifiableCollection<? extends T>
collection)
{
- aggregated.add(collection);
+ if (collection.size() != 0)
+ {
+ aggregated.add(collection);
+ }
}
Show replies by date