Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEsteban Dugueperoux2015-01-13 09:33:07 +0000
committerEsteban Dugueperoux2015-01-13 09:33:07 +0000
commita60b8034899dda3ef4be961842e8bf86c1505e83 (patch)
tree34426f96a1cd17d592e1c6d65a19dfafff84b02f /plugins
parentbd51bc8c764ab185c4489838c8aa23adcc877fe5 (diff)
downloadcdo-a60b8034899dda3ef4be961842e8bf86c1505e83.tar.gz
cdo-a60b8034899dda3ef4be961842e8bf86c1505e83.tar.xz
cdo-a60b8034899dda3ef4be961842e8bf86c1505e83.zip
[429659] Fix EObject.eUnset() legacy specific bug
Avoid twice REMOVE_MANY notification dispatch in legacy on unset in CDOStoreImpl.unset() Change-Id: I8ba349f51f135b13833ad4a489628e4c5f2e8af1 Signed-off-by: Esteban Dugueperoux <esteban.dugueperoux@obeo.fr> Task-Url: https://bugs.eclipse.org/bugs/show_bug.cgi?id=429659
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java3
2 files changed, 13 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
index 5acdefd325..61b0b150ff 100644
--- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_429659_Test.java
@@ -13,6 +13,7 @@ package org.eclipse.emf.cdo.tests.bugzilla;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.tests.AbstractCDOTest;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.util.URI;
@@ -121,6 +122,9 @@ public class Bugzilla_429659_Test extends AbstractCDOTest
private void performUnsetOnSingleValuedFeature(Resource resource, EObject root, EStructuralFeature feature,
boolean unsettable, Object addedObject) throws Exception
{
+ // To have CDOLegacyAdapter even in local
+ CDOUtil.getCDOObject(root);
+
// check that Feature is unsettable or not
assertEquals(unsettable, feature.isUnsettable());
@@ -148,6 +152,13 @@ public class Bugzilla_429659_Test extends AbstractCDOTest
private void performUnsetOnMultiValuedFeature(Resource resource, EObject root, EStructuralFeature feature,
boolean unsettable, List<EObject> objectstoAdd) throws Exception
{
+ // To have CDOLegacyAdapter even in local
+ CDOUtil.getCDOObject(root);
+ for (EObject objectToAdd : objectstoAdd)
+ {
+ CDOUtil.getCDOObject(objectToAdd);
+ }
+
// check that feature is unsettable or not
assertEquals(unsettable, feature.isUnsettable());
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
index 14bf21ddae..b829d71a50 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStoreImpl.java
@@ -33,6 +33,7 @@ import org.eclipse.emf.cdo.internal.common.revision.delta.CDOSetFeatureDeltaImpl
import org.eclipse.emf.cdo.internal.common.revision.delta.CDOUnsetFeatureDeltaImpl;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
+import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.cdo.util.ObjectNotFoundException;
import org.eclipse.emf.cdo.view.CDOFeatureAnalyzer;
import org.eclipse.emf.cdo.view.CDORevisionPrefetchingPolicy;
@@ -460,7 +461,7 @@ public final class CDOStoreImpl implements CDOStore
if (feature.isMany())
{
Object object = cdoObject.eGet(feature);
- if (object instanceof List<?>)
+ if (object instanceof List<?> && !CDOUtil.isLegacyObject(cdoObject))
{
List<?> list = (List<?>)object;
list.clear();

Back to the top