summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2010-06-03 06:01:58 (EDT)
committerCaspar De Groot2010-06-03 06:01:58 (EDT)
commit5bec933699339e347dc325b04c56e7346f5685d1 (patch)
tree094ad77aabefc06c4cdf2a82a51edaa46f465189
parenta912d89423507870d9aea0d1b7a6cf6769658d61 (diff)
downloadcdo-5bec933699339e347dc325b04c56e7346f5685d1.zip
cdo-5bec933699339e347dc325b04c56e7346f5685d1.tar.gz
cdo-5bec933699339e347dc325b04c56e7346f5685d1.tar.bz2
[314652] Unable to save objects from packages with cyclic dependencies
https://bugs.eclipse.org/bugs/show_bug.cgi?id=314652
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
index 24ee4ba..7022e2a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
@@ -400,6 +400,8 @@ public final class CDOModelUtil
EObject e = it.next();
for (EObject r : e.eCrossReferences())
{
+ EObject refTarget = null;
+
if (r.eIsProxy())
{
String msg = "Package '%s' contains unresolved proxy '%s'";
@@ -413,10 +415,12 @@ public final class CDOModelUtil
EPackage pkg = null;
if (r instanceof EClassifier)
{
+ refTarget = r;
pkg = ((EClassifier)r).getEPackage();
}
else if (r instanceof EStructuralFeature)
{
+ refTarget = r;
EStructuralFeature feature = (EStructuralFeature)r;
EClass ownerClass = (EClass)feature.eContainer();
pkg = ownerClass.getEPackage();
@@ -427,6 +431,7 @@ public final class CDOModelUtil
EClassifier c = genType.getEClassifier();
if (c != null)
{
+ refTarget = c;
pkg = c.getEPackage();
}
}
@@ -441,7 +446,7 @@ public final class CDOModelUtil
pkg = pkg.getESuperPackage();
}
- String resourceURI = r.eResource().getURI().toString();
+ String resourceURI = refTarget.eResource().getURI().toString();
if (!resourceURI.toString().equals(pkg.getNsURI()))
{
String msg = "URI of the resource (%s) does not match the nsURI (%s) of the top-level package";