summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-18 17:21:47 (EDT)
committerEike Stepper2007-07-18 17:21:47 (EDT)
commit37f94699e792e5d4645274c86e6bae062e56df86 (patch)
treea771f95b0496d39f975e3844cf683812ddc06cb1
parentdbaca03953e8a38c08f7840e72c8207f501da90a (diff)
downloadcdo-37f94699e792e5d4645274c86e6bae062e56df86.zip
cdo-37f94699e792e5d4645274c86e6bae062e56df86.tar.gz
cdo-37f94699e792e5d4645274c86e6bae062e56df86.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java51
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java6
2 files changed, 46 insertions, 11 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
index 37100eb..23e167f 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/EMFUtil.java
@@ -10,25 +10,25 @@
**************************************************************************/
package org.eclipse.emf.cdo.util;
-import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.net4j.util.io.IORuntimeException;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EDataType;
+import org.eclipse.emf.ecore.EEnum;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.impl.EClassifierImpl;
import org.eclipse.emf.ecore.impl.EPackageImpl;
import org.eclipse.emf.ecore.xmi.XMIResource;
import org.eclipse.emf.ecore.xmi.impl.XMIResourceImpl;
-import org.eclipse.emf.internal.cdo.bundle.OM;
-
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
-import java.lang.reflect.Method;
import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
/**
@@ -145,20 +145,49 @@ public final class EMFUtil
*/
public static void fixEClassifiers(EPackageImpl ePackage)
{
- try
+ int id = 0;
+ for (Iterator<EClassifier> i = ePackage.getEClassifiers().iterator(); i.hasNext();)
{
- Method method = EPackageImpl.class.getDeclaredMethod("fixEClassifiers", ReflectUtil.NO_PARAMETERS);
- if (!method.isAccessible())
+ EClassifierImpl eClassifier = (EClassifierImpl)i.next();
+ if (eClassifier instanceof EClass)
{
- method.setAccessible(true);
+ eClassifier.setClassifierID(id++);
}
+ }
- method.invoke(ePackage, ReflectUtil.NO_ARGUMENTS);
+ for (Iterator<EClassifier> i = ePackage.getEClassifiers().iterator(); i.hasNext();)
+ {
+ EClassifierImpl eClassifier = (EClassifierImpl)i.next();
+ if (eClassifier.getClassifierID() == -1 && eClassifier instanceof EEnum)
+ {
+ eClassifier.setClassifierID(id++);
+ }
}
- catch (Exception ex)
+
+ for (Iterator<EClassifier> i = ePackage.getEClassifiers().iterator(); i.hasNext();)
{
- OM.LOG.error(ex);
+ EClassifierImpl eClassifier = (EClassifierImpl)i.next();
+ if (eClassifier.getClassifierID() == -1 && eClassifier instanceof EDataType)
+ {
+ eClassifier.setClassifierID(id++);
+ }
}
+
+ // try
+ // {
+ // Method method = EPackageImpl.class.getDeclaredMethod("fixEClassifiers",
+ // ReflectUtil.NO_PARAMETERS);
+ // if (!method.isAccessible())
+ // {
+ // method.setAccessible(true);
+ // }
+ //
+ // method.invoke(ePackage, ReflectUtil.NO_ARGUMENTS);
+ // }
+ // catch (Exception ex)
+ // {
+ // OM.LOG.error(ex);
+ // }
}
// public static List<Change> analyzeListDifferences(CDORevisionImpl
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java
index 3bc7e24..c249438 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOFactoryImpl.java
@@ -27,6 +27,12 @@ public class CDOFactoryImpl extends EFactoryImpl implements CDOFactory
this.ePackage = ePackage;
}
+ // @Override
+ // public EObject create(EClass eClass)
+ // {
+ // return new DynamicCDOObjectImpl(eClass);
+ // }
+
@Override
protected EObject basicCreate(EClass eClass)
{