Author: adietish
Date: 2011-01-11 15:00:21 -0500 (Tue, 11 Jan 2011)
New Revision: 28104
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java
Log:
[JBIDE-8091] fixed bug when filtering instances: returned array that is too large
Modified: trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog
===================================================================
--- trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-11 19:55:22
UTC (rev 28103)
+++ trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/ChangeLog 2011-01-11 20:00:21
UTC (rev 28104)
@@ -1,5 +1,7 @@
2011-01-11 André Dietisheim <André Dietisheim@adietisheim-thinkpad>
+ * src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java (filter):
+ [JBIDE-8091] fixed bug when filtering instances: returned array that is too large
* src/org/jboss/tools/deltacloud/ui/views/cloud/ImagesCategoryItem.java (filter):
[JBIDE-8080] fixed bug when filtering images: returned array that is too large
Modified:
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java
===================================================================
---
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java 2011-01-11
19:55:22 UTC (rev 28103)
+++
trunk/deltacloud/plugins/org.jboss.tools.deltacloud.ui/src/org/jboss/tools/deltacloud/ui/views/cloud/InstancesCategoryItem.java 2011-01-11
20:00:21 UTC (rev 28104)
@@ -12,6 +12,7 @@
import java.beans.PropertyChangeEvent;
import java.text.MessageFormat;
+import java.util.Collection;
import org.eclipse.core.runtime.IProgressMonitor;
import org.eclipse.core.runtime.IStatus;
@@ -96,6 +97,7 @@
protected DeltaCloudInstance[] filter(DeltaCloudInstance[] instances) throws
DeltaCloudException {
DeltaCloud cloud = getModel();
IInstanceFilter f = cloud.getInstanceFilter();
- return f.filter(instances).toArray(new DeltaCloudInstance[instances.length]);
+ Collection<DeltaCloudInstance> filteredInstances = f.filter(instances);
+ return filteredInstances.toArray(new DeltaCloudInstance[filteredInstances.size()]);
}
}
Show replies by date