summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-23 12:30:28 (EDT)
committerEike Stepper2007-07-23 12:30:28 (EDT)
commite9b3277781963bc30a3778b188e17321db370cce (patch)
tree1d8fdd1e4b746d4159b6f9e05dfbccdc2bf9887b
parent6db02f74d33f5ff475b2f6ba6872d3e435775ba2 (diff)
downloadcdo-e9b3277781963bc30a3778b188e17321db370cce.zip
cdo-e9b3277781963bc30a3778b188e17321db370cce.tar.gz
cdo-e9b3277781963bc30a3778b188e17321db370cce.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java16
3 files changed, 16 insertions, 8 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
index 0250c22..3d35786 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOPackageRegistryImpl.java
@@ -96,7 +96,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
/**
* @author Eike Stepper
*/
- private static final class CDOPackageDescriptor implements EPackage.Descriptor
+ private final class CDOPackageDescriptor implements EPackage.Descriptor
{
private CDOPackageImpl cdoPackage;
@@ -113,7 +113,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
public EPackage getEPackage()
{
- return ModelUtil.createEPackage(cdoPackage);
+ return ModelUtil.createEPackage(cdoPackage, CDOPackageRegistryImpl.this);
}
@Override
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index a5eb561..05971ed 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -36,6 +36,7 @@ import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
@@ -190,7 +191,8 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
public InternalCDOObject newInstance(EClass eClass)
{
- return (InternalCDOObject)EcoreUtil.create(eClass);
+ EObject eObject = EcoreUtil.create(eClass);
+ return FSMUtil.adapt(eObject, this);
}
public InternalCDOObject newInstance(CDOClass cdoClass)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index 942d2b6..4ba2af8 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -197,7 +197,7 @@ public final class ModelUtil
ePackage = packageRegistry.getEPackage(uri);
if (ePackage == null)
{
- ePackage = createEPackage(cdoPackage);
+ ePackage = createEPackage(cdoPackage, packageRegistry);
packageRegistry.put(uri, ePackage);
}
@@ -233,11 +233,11 @@ public final class ModelUtil
return eFeature;
}
- public static EPackage createEPackage(CDOPackageImpl cdoPackage)
+ public static EPackage createEPackage(CDOPackageImpl cdoPackage, CDOPackageRegistryImpl packageRegistry)
{
if (!cdoPackage.isDynamic())
{
- EPackage ePackage = createGeneratedEPackage(cdoPackage.getPackageURI());
+ EPackage ePackage = createGeneratedEPackage(cdoPackage.getPackageURI(), packageRegistry);
if (ePackage != null)
{
return ePackage;
@@ -247,9 +247,15 @@ public final class ModelUtil
return createDynamicEPackage(cdoPackage);
}
- public static EPackage createGeneratedEPackage(String packageURI)
+ public static EPackage createGeneratedEPackage(String packageURI, CDOPackageRegistryImpl packageRegistry)
{
- return EPackage.Registry.INSTANCE.getEPackage(packageURI);
+ if (packageURI.equals(EcorePackage.eINSTANCE.getNsURI()))
+ {
+ return EcorePackage.eINSTANCE;
+ }
+
+ // TODO Implement method ModelUtil.createGeneratedEPackage()
+ throw new UnsupportedOperationException("Not yet implemented");
}
public static EPackageImpl createDynamicEPackage(CDOPackageImpl cdoPackage)