summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-11-01 15:16:43 (EDT)
committerEike Stepper2007-11-01 15:16:43 (EDT)
commitedf40764533a86c9545c0e0d468ef5cb613ea654 (patch)
treee593ab68d91a9f78c8b57cb948832df9f8a43355
parent0de5ce47f5d9e9ae5d28541aa288f84d3cf27c85 (diff)
downloadcdo-edf40764533a86c9545c0e0d468ef5cb613ea654.zip
cdo-edf40764533a86c9545c0e0d468ef5cb613ea654.tar.gz
cdo-edf40764533a86c9545c0e0d468ef5cb613ea654.tar.bz2
[208468] Implement generic CDOStore.toArray()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=208468
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java12
1 files changed, 10 insertions, 2 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 608fb91..8eaf1cf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -315,9 +315,17 @@ public final class CDOStore implements EStore
Object[] array = toArray(eObject, eFeature);
int size = array.length;
- if (a.length < size) a = (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size);
+ if (a.length < size)
+ {
+ a = (T[])java.lang.reflect.Array.newInstance(a.getClass().getComponentType(), size);
+ }
+
System.arraycopy(array, 0, a, 0, size);
- if (a.length > size) a[size] = null;
+ if (a.length > size)
+ {
+ a[size] = null;
+ }
+
return a;
}