Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2008-10-30 12:09:56 -0400
committerEike Stepper2008-10-30 12:09:56 -0400
commit3b3d6365b80dcc1ad6aad352ddad82be48dd5397 (patch)
tree58cc0d25eeabd9150a9b381c964c05f4bcac5f8d /plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util
parent5aedf281cca3845d98e4fec88d5e125918698b7d (diff)
downloadcdo-3b3d6365b80dcc1ad6aad352ddad82be48dd5397.tar.gz
cdo-3b3d6365b80dcc1ad6aad352ddad82be48dd5397.tar.xz
cdo-3b3d6365b80dcc1ad6aad352ddad82be48dd5397.zip
[252161] StackOverflow in CDOEditor.populateNewRoot() when sessino.packageRegistry contains a package not registered in the client machine
https://bugs.eclipse.org/bugs/show_bug.cgi?id=252161
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageRegistryImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java8
3 files changed, 14 insertions, 5 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageRegistryImpl.java
index 029dd9573c..d2ee08ab74 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageRegistryImpl.java
@@ -166,7 +166,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
public EFactory getEFactory()
{
- // TODO Implement method LocalPackageDescriptor.getEFactory()
+ // TODO Implement method RemotePackageDescriptor.getEFactory()
throw new UnsupportedOperationException("Not yet implemented");
}
@@ -185,7 +185,7 @@ public class CDOPackageRegistryImpl extends EPackageRegistryImpl implements CDOP
@Override
public String toString()
{
- return MessageFormat.format("LocalPackageDescriptor[{0}]", cdoPackage.getPackageURI());
+ return MessageFormat.format("RemotePackageDescriptor[{0}]", cdoPackage.getPackageURI());
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
index 6dc36b65fc..42d85c9f24 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CDOPackageTypeRegistryImpl.java
@@ -77,6 +77,12 @@ public final class CDOPackageTypeRegistryImpl extends HashMapRegistry<String, CD
put(packageURI, CDOPackageType.NATIVE);
}
+ public void reset()
+ {
+ deactivate();
+ activate();
+ }
+
@Override
protected void doActivate() throws Exception
{
@@ -110,6 +116,7 @@ public final class CDOPackageTypeRegistryImpl extends HashMapRegistry<String, CD
}
}
+ clear();
super.doDeactivate();
}
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 5c7d5bc4cc..32976ed8f8 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
@@ -322,7 +322,7 @@ public final class ModelUtil
{
if (!cdoPackage.isDynamic())
{
- EPackage ePackage = createGeneratedEPackage(cdoPackage.getPackageURI());
+ EPackage ePackage = getGeneratedEPackage(cdoPackage);
if (ePackage != null)
{
return ePackage;
@@ -332,14 +332,16 @@ public final class ModelUtil
return createDynamicEPackage(cdoPackage);
}
- public static EPackage createGeneratedEPackage(String packageURI)
+ private static EPackage getGeneratedEPackage(CDOPackage cdoPackage)
{
+ String packageURI = cdoPackage.getPackageURI();
if (packageURI.equals(EcorePackage.eINSTANCE.getNsURI()))
{
return EcorePackage.eINSTANCE;
}
- return EPackage.Registry.INSTANCE.getEPackage(packageURI);
+ EPackage.Registry registry = EPackage.Registry.INSTANCE;
+ return registry.getEPackage(packageURI);
}
public static EPackageImpl createDynamicEPackage(CDOPackage cdoPackage)

Back to the top