diff options
author | Christian W. Damus | 2013-04-09 12:58:45 +0000 |
---|---|---|
committer | Christian W. Damus | 2013-04-09 13:20:51 +0000 |
commit | 2a8464397581e4cd9887c6fe8bd2e82bd78f59df (patch) | |
tree | 5d1d8e725f5dbea7d202bde12be3752636a6dd2d | |
parent | 103ccfa56b39c153c3cb39c7e3196d72bcd1b146 (diff) | |
download | cdo-2a8464397581e4cd9887c6fe8bd2e82bd78f59df.tar.gz cdo-2a8464397581e4cd9887c6fe8bd2e82bd78f59df.tar.xz cdo-2a8464397581e4cd9887c6fe8bd2e82bd78f59df.zip |
[405257] [Legacy] NIL value not committed for unsettable attribute
https://bugs.eclipse.org/bugs/show_bug.cgi?id=405257
-rw-r--r-- | plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java index 75b3b0309a..c5753e803d 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDOLegacyAdapter.java @@ -27,6 +27,7 @@ import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.common.notify.Notifier; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.EStructuralFeature; +import org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder; import org.eclipse.emf.ecore.InternalEObject; import org.eclipse.emf.spi.cdo.CDOStore; import org.eclipse.emf.spi.cdo.FSMUtil; @@ -144,7 +145,19 @@ public class CDOLegacyAdapter extends CDOLegacyWrapper implements Adapter.Intern protected void notifySet(EStructuralFeature feature, int position, Object oldValue, Object newValue) { CDOStore store = viewAndState.view.getStore(); - store.set(instance, feature, position, newValue); + + // bug 405257: handle unsettable features set explicitly to null. + // Note that an unsettable list feature doesn't allow individual + // positions to be set/unset + if (newValue == null && feature.isUnsettable() && position == Notification.NO_INDEX) + { + store.set(instance, feature, position, DynamicValueHolder.NIL); + } + else + { + store.set(instance, feature, position, newValue); + } + if (feature instanceof EReference) { EReference reference = (EReference)feature; |