summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-12-13 07:55:14 (EST)
committerEike Stepper2007-12-13 07:55:14 (EST)
commit38c637a620383d02f89a3c81b9c6e077bd4138d0 (patch)
treed28fffa0bc169f47f64895c75e0283807286eb14
parent60d8d9dee24f20b04dc6da7824d723ea408ed264 (diff)
downloadcdo-38c637a620383d02f89a3c81b9c6e077bd4138d0.zip
cdo-38c637a620383d02f89a3c81b9c6e077bd4138d0.tar.gz
cdo-38c637a620383d02f89a3c81b9c6e077bd4138d0.tar.bz2
[212344] Problem using EMAP with EStore
https://bugs.eclipse.org/bugs/show_bug.cgi?id=212344
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java55
1 files changed, 51 insertions, 4 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
index 5527d7b..ecca2a4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java
@@ -240,13 +240,60 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
@Override
- protected EList<?> createList(EStructuralFeature eStructuralFeature)
+ protected EList<?> createList(final EStructuralFeature eStructuralFeature)
{
- EClassifier eType = eStructuralFeature.getEType();
+ final EClassifier eType = eStructuralFeature.getEType();
if (eType.getInstanceClassName() == "java.util.Map$Entry")
{
- return new EcoreEMap<Object, Object>((EClass)eType, eType.getInstanceClass(),
- new CDOStoreEList<BasicEMap.Entry<Object, Object>>(eStructuralFeature));
+ class EStoreEcoreEMap extends EcoreEMap<Object, Object>
+ {
+ private static final long serialVersionUID = 1L;
+
+ public EStoreEcoreEMap()
+ {
+ super((EClass)eType, eType.getInstanceClass(), null);
+ delegateEList = new CDOStoreEList<BasicEMap.Entry<Object, Object>>(eStructuralFeature)
+ {
+ private static final long serialVersionUID = 1L;
+
+ @Override
+ protected void didAdd(int index, BasicEMap.Entry<Object, Object> newObject)
+ {
+ EStoreEcoreEMap.this.doPut(newObject);
+ }
+
+ @Override
+ protected void didSet(int index, BasicEMap.Entry<Object, Object> newObject,
+ BasicEMap.Entry<Object, Object> oldObject)
+ {
+ didRemove(index, oldObject);
+ didAdd(index, newObject);
+ }
+
+ @Override
+ protected void didRemove(int index, BasicEMap.Entry<Object, Object> oldObject)
+ {
+ EStoreEcoreEMap.this.doRemove(oldObject);
+ }
+
+ @Override
+ protected void didClear(int size, Object[] oldObjects)
+ {
+ EStoreEcoreEMap.this.doClear();
+ }
+
+ @Override
+ protected void didMove(int index, BasicEMap.Entry<Object, Object> movedObject, int oldIndex)
+ {
+ EStoreEcoreEMap.this.doMove(movedObject);
+ }
+ };
+
+ size = delegateEList.size();
+ }
+ }
+
+ return new EStoreEcoreEMap();
}
return new CDOStoreEList<Object>(eStructuralFeature);