summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian W. Damus2012-10-31 01:15:59 (EDT)
committer Eike Stepper2012-10-31 01:15:59 (EDT)
commit9e9b1aac1fd89d2bbf7ac39c823ee996e4f3d832 (patch)
treea0fded06b447f1cb619cd3711b44206ad1c70b3a
parent02de48b12f68104d19b18827f0beceac71545c23 (diff)
downloadcdo-9e9b1aac1fd89d2bbf7ac39c823ee996e4f3d832.zip
cdo-9e9b1aac1fd89d2bbf7ac39c823ee996e4f3d832.tar.gz
cdo-9e9b1aac1fd89d2bbf7ac39c823ee996e4f3d832.tar.bz2
[369253] [Legacy] Issues with non-containment opposite references in
legacy mode https://bugs.eclipse.org/bugs/show_bug.cgi?id=369253
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model5/META-INF/MANIFEST.MF8
-rw-r--r--plugins/org.eclipse.emf.cdo.tests.model5/model/model5.ecore19
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java2
3 files changed, 20 insertions, 9 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests.model5/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.tests.model5/META-INF/MANIFEST.MF
index 598dcfd..db74c87 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model5/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.tests.model5/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.tests.model5;singleton:=true
-Bundle-Version: 3.0.200.qualifier
+Bundle-Version: 3.0.300.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -11,6 +11,6 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.4.0,4.0.0)",
org.eclipse.emf.cdo;bundle-version="[4.0.0,5.0.0)";visibility:=reexport
Export-Package: org.eclipse.emf.cdo.tests.legacy.model5;version="3.0.200",
org.eclipse.emf.cdo.tests.legacy.model5.impl;version="3.0.200",
- org.eclipse.emf.cdo.tests.model5;version="3.0.200",
- org.eclipse.emf.cdo.tests.model5.impl;version="3.0.200",
- org.eclipse.emf.cdo.tests.model5.util;version="3.0.200"
+ org.eclipse.emf.cdo.tests.model5;version="3.0.300",
+ org.eclipse.emf.cdo.tests.model5.impl;version="3.0.300",
+ org.eclipse.emf.cdo.tests.model5.util;version="3.0.300"
diff --git a/plugins/org.eclipse.emf.cdo.tests.model5/model/model5.ecore b/plugins/org.eclipse.emf.cdo.tests.model5/model/model5.ecore
index 85395e3..7761e1a 100644
--- a/plugins/org.eclipse.emf.cdo.tests.model5/model/model5.ecore
+++ b/plugins/org.eclipse.emf.cdo.tests.model5/model/model5.ecore
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
-<ecore:EPackage xmi:version="2.0"
- xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
- xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model5"
- nsURI="http://www.eclipse.org/emf/CDO/tests/model5/1.0.0" nsPrefix="model5">
+<ecore:EPackage xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore" name="model5" nsURI="http://www.eclipse.org/emf/CDO/tests/model5/1.0.0"
+ nsPrefix="model5">
<eClassifiers xsi:type="ecore:EClass" name="TestFeatureMap">
<eStructuralFeatures xsi:type="ecore:EReference" name="managers" upperBound="-1"
eType="#//Manager" transient="true">
@@ -70,4 +69,16 @@
eType="#//IntArray"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EDataType" name="IntArray" instanceClassName="int[]"/>
+ <eClassifiers xsi:type="ecore:EClass" name="Parent">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="children" upperBound="-1"
+ eType="#//Child" containment="true" eOpposite="#//Child/parent"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="favourite" eType="#//Child"
+ eOpposite="#//Child/preferredBy"/>
+ </eClassifiers>
+ <eClassifiers xsi:type="ecore:EClass" name="Child">
+ <eStructuralFeatures xsi:type="ecore:EReference" name="parent" eType="#//Parent"
+ eOpposite="#//Parent/children"/>
+ <eStructuralFeatures xsi:type="ecore:EReference" name="preferredBy" eType="#//Parent"
+ eOpposite="#//Parent/favourite"/>
+ </eClassifiers>
</ecore:EPackage>
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
index 8be6c37..05bc8a0 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyWrapper.java
@@ -585,7 +585,7 @@ public abstract class CDOLegacyWrapper extends CDOObjectWrapper
// do not set the feature to null. Otherwise the object will be removed from the container which is the
// resource instead of the original container. As a result the object will be detached. See
// MapTest.testEObjectToEObjectValueContainedMap for more information
- if (object != instance.eContainer())
+ if (object != instance.eContainer() || !oppositeReference.isContainment())
{
instance.eInverseAdd((InternalEObject)object, featureID, baseClass, null);
}