summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEgidijus Vaishnora2011-09-23 05:29:09 (EDT)
committerEgidijus Vaishnora2011-09-23 05:29:09 (EDT)
commitabf0f98620a1836877838c61cdfe858d7c9d2be1 (patch)
tree85e943fc094952b21726e463a881db45299a86d5
parent7867595e26fffd6f8731161f0266d91da02216f7 (diff)
downloadcdo-abf0f98620a1836877838c61cdfe858d7c9d2be1.zip
cdo-abf0f98620a1836877838c61cdfe858d7c9d2be1.tar.gz
cdo-abf0f98620a1836877838c61cdfe858d7c9d2be1.tar.bz2
358581: AbstractCDOView.getObjectsArray gives array with NULLs
https://bugs.eclipse.org/bugs/show_bug.cgi?id=358581
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java13
1 files changed, 12 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
index a018dfd..4a29f5c 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
@@ -90,6 +90,7 @@ import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections;
import java.util.HashMap;
+import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Set;
@@ -474,7 +475,17 @@ public abstract class AbstractCDOView extends Lifecycle implements InternalCDOVi
public synchronized InternalCDOObject[] getObjectsArray()
{
- return objects.values().toArray(new InternalCDOObject[objects.size()]);
+ Collection<InternalCDOObject> values = objects.values();
+ List<InternalCDOObject> valuesNoNull = new ArrayList<InternalCDOObject>(values.size());
+ for (Iterator<InternalCDOObject> it = values.iterator(); it.hasNext();)
+ {
+ InternalCDOObject next = it.next();
+ if (next != null)
+ {
+ valuesNoNull.add(next);
+ }
+ }
+ return valuesNoNull.toArray(new InternalCDOObject[valuesNoNull.size()]);
}
public synchronized CDOResource getResource(String path)