Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-03-21 17:11:25 +0000
committerEike Stepper2020-03-21 17:11:25 +0000
commitca3b7daf2a04ad8654054fd477482c0ae45dd937 (patch)
tree5d33494f299a575ab7c9eb757f502eab79feb6e2
parent5bb5274f9d41dd0f6004c089050634b6cff69642 (diff)
downloadcdo-ca3b7daf2a04ad8654054fd477482c0ae45dd937.tar.gz
cdo-ca3b7daf2a04ad8654054fd477482c0ae45dd937.tar.xz
cdo-ca3b7daf2a04ad8654054fd477482c0ae45dd937.zip
[561250] First element in EMap is not always visible from another session
https://bugs.eclipse.org/bugs/show_bug.cgi?id=561250 Change-Id: Ie5a657108db1ed1e5df35407dc38571651c2ce67
-rw-r--r--features/org.eclipse.emf.cdo.server-feature/feature.xml2
-rw-r--r--features/org.eclipse.emf.cdo.server-feature/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF68
-rw-r--r--plugins/org.eclipse.emf.cdo.common/pom.xml2
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java5
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_561250_Test.java59
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java93
8 files changed, 168 insertions, 84 deletions
diff --git a/features/org.eclipse.emf.cdo.server-feature/feature.xml b/features/org.eclipse.emf.cdo.server-feature/feature.xml
index c24df591c5..14fd724eee 100644
--- a/features/org.eclipse.emf.cdo.server-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo.server-feature/feature.xml
@@ -12,7 +12,7 @@
<feature
id="org.eclipse.emf.cdo.server"
label="%featureName"
- version="4.9.1.qualifier"
+ version="4.10.0.qualifier"
provider-name="%providerName"
image="eclipse_update_120.jpg"
license-feature="org.eclipse.emf.cdo.license"
diff --git a/features/org.eclipse.emf.cdo.server-feature/pom.xml b/features/org.eclipse.emf.cdo.server-feature/pom.xml
index c92ca6e6e6..5041fdce7a 100644
--- a/features/org.eclipse.emf.cdo.server-feature/pom.xml
+++ b/features/org.eclipse.emf.cdo.server-feature/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo.features</groupId>
<artifactId>org.eclipse.emf.cdo.server</artifactId>
- <version>4.9.1-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-feature</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
index 5fabb5a501..11e6b3c0e3 100644
--- a/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
+++ b/plugins/org.eclipse.emf.cdo.common/META-INF/MANIFEST.MF
@@ -1,7 +1,7 @@
Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-SymbolicName: org.eclipse.emf.cdo.common;singleton:=true
-Bundle-Version: 4.9.0.qualifier
+Bundle-Version: 4.10.0.qualifier
Bundle-Name: %pluginName
Bundle-Vendor: %providerName
Bundle-Localization: plugin
@@ -15,21 +15,21 @@ Require-Bundle: org.eclipse.core.runtime;bundle-version="[3.5.0,4.0.0)";visibili
org.eclipse.emf.ecore.change;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.emf.ecore.xmi;bundle-version="[2.5.0,3.0.0)";visibility:=reexport,
org.eclipse.net4j.util;bundle-version="[3.0.0,4.0.0)";visibility:=reexport
-Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
- org.eclipse.emf.cdo.common.admin;version="4.9.0",
- org.eclipse.emf.cdo.common.branch;version="4.9.0",
- org.eclipse.emf.cdo.common.commit;version="4.9.0",
- org.eclipse.emf.cdo.common.commit.handler;version="4.9.0",
- org.eclipse.emf.cdo.common.id;version="4.9.0",
- org.eclipse.emf.cdo.common.lob;version="4.9.0",
- org.eclipse.emf.cdo.common.lock;version="4.9.0",
- org.eclipse.emf.cdo.common.model;version="4.9.0",
- org.eclipse.emf.cdo.common.protocol;version="4.9.0",
- org.eclipse.emf.cdo.common.revision;version="4.9.0",
- org.eclipse.emf.cdo.common.revision.delta;version="4.9.0",
- org.eclipse.emf.cdo.common.security;version="4.9.0",
- org.eclipse.emf.cdo.common.util;version="4.9.0",
- org.eclipse.emf.cdo.internal.common;version="4.9.0";
+Export-Package: org.eclipse.emf.cdo.common;version="4.10.0",
+ org.eclipse.emf.cdo.common.admin;version="4.10.0",
+ org.eclipse.emf.cdo.common.branch;version="4.10.0",
+ org.eclipse.emf.cdo.common.commit;version="4.10.0",
+ org.eclipse.emf.cdo.common.commit.handler;version="4.10.0",
+ org.eclipse.emf.cdo.common.id;version="4.10.0",
+ org.eclipse.emf.cdo.common.lob;version="4.10.0",
+ org.eclipse.emf.cdo.common.lock;version="4.10.0",
+ org.eclipse.emf.cdo.common.model;version="4.10.0",
+ org.eclipse.emf.cdo.common.protocol;version="4.10.0",
+ org.eclipse.emf.cdo.common.revision;version="4.10.0",
+ org.eclipse.emf.cdo.common.revision.delta;version="4.10.0",
+ org.eclipse.emf.cdo.common.security;version="4.10.0",
+ org.eclipse.emf.cdo.common.util;version="4.10.0",
+ org.eclipse.emf.cdo.internal.common;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -38,10 +38,10 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.branch;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.branch;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.bundle;version="4.9.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.commit;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.bundle;version="4.10.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.commit;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -50,7 +50,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.id;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.id;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -61,9 +61,9 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.tests,
org.eclipse.emf.cdo.admin,
org.eclipse.emf.cdo.server.admin",
- org.eclipse.emf.cdo.internal.common.lock;version="4.9.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.messages;version="4.9.0";x-internal:=true,
- org.eclipse.emf.cdo.internal.common.model;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.lock;version="4.10.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.messages;version="4.10.0";x-internal:=true,
+ org.eclipse.emf.cdo.internal.common.model;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -72,7 +72,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.revision;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -81,7 +81,7 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.internal.common.revision.delta;version="4.9.0";
+ org.eclipse.emf.cdo.internal.common.revision.delta;version="4.10.0";
x-friends:="org.eclipse.emf.cdo.common,
org.eclipse.emf.cdo.common.db,
org.eclipse.emf.cdo,
@@ -90,14 +90,14 @@ Export-Package: org.eclipse.emf.cdo.common;version="4.9.0",
org.eclipse.emf.cdo.server.net4j,
org.eclipse.emf.cdo.ui,
org.eclipse.emf.cdo.tests",
- org.eclipse.emf.cdo.spi.common;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.admin;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.branch;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.commit;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.id;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.lock;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.model;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.protocol;version="4.9.0",
- org.eclipse.emf.cdo.spi.common.revision;version="4.9.0"
+ org.eclipse.emf.cdo.spi.common;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.admin;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.branch;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.commit;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.id;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.lock;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.model;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.protocol;version="4.10.0",
+ org.eclipse.emf.cdo.spi.common.revision;version="4.10.0"
Automatic-Module-Name: org.eclipse.emf.cdo.common
Eclipse-RegisterBuddy: org.eclipse.net4j.util
diff --git a/plugins/org.eclipse.emf.cdo.common/pom.xml b/plugins/org.eclipse.emf.cdo.common/pom.xml
index 26cd10de8b..37c4540f5e 100644
--- a/plugins/org.eclipse.emf.cdo.common/pom.xml
+++ b/plugins/org.eclipse.emf.cdo.common/pom.xml
@@ -25,7 +25,7 @@
<groupId>org.eclipse.emf.cdo</groupId>
<artifactId>org.eclipse.emf.cdo.common</artifactId>
- <version>4.9.0-SNAPSHOT</version>
+ <version>4.10.0-SNAPSHOT</version>
<packaging>eclipse-plugin</packaging>
</project>
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
index 93ef0a5a50..ab1aed0231 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOClassInfo.java
@@ -63,6 +63,11 @@ public interface CDOClassInfo extends Adapter
public EStructuralFeature[] getAllPersistentContainments();
/**
+ * @since 4.10
+ */
+ public EStructuralFeature[] getAllPersistentMapFeatures();
+
+ /**
* @deprecated As of 4.2 pushed down to {@link InternalCDOClassInfo#getPersistentFeatureIndex(EStructuralFeature)}.
*/
@Deprecated
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
index c5e75baf65..1f45544c87 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java
@@ -69,6 +69,8 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
private EStructuralFeature[] allPersistentContainments;
+ private EStructuralFeature[] allPersistentMapFeatures;
+
private int[] persistentFeatureIndices;
private int settingsFeatureCount;
@@ -197,6 +199,12 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
}
@Override
+ public EStructuralFeature[] getAllPersistentMapFeatures()
+ {
+ return allPersistentMapFeatures;
+ }
+
+ @Override
public int getPersistentFeatureIndex(EStructuralFeature feature) throws IllegalArgumentException
{
int featureID = eClass.getFeatureID(feature);
@@ -288,6 +296,7 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
List<EStructuralFeature> persistentFeatures = new ArrayList<>();
List<EReference> persistentReferences = new ArrayList<>();
List<EStructuralFeature> persistentContainments = new ArrayList<>();
+ List<EStructuralFeature> persistentMapFeatures = new ArrayList<>();
// Used for tests for containment
EStructuralFeature[] containments = ((EClassImpl.FeatureSubsetSupplier)eClass.getEAllStructuralFeatures()).containments();
@@ -322,6 +331,11 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
}
}
+ if (isMap(feature))
+ {
+ persistentMapFeatures.add(feature);
+ }
+
if (feature.isMany() || FeatureMapUtil.isFeatureMap(feature))
{
settingsFeatureIndices[i] = settingsFeatureCount++;
@@ -354,6 +368,7 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
allPersistentFeatures = persistentFeatures.toArray(new EStructuralFeature[persistentFeatures.size()]);
allPersistentReferences = persistentReferences.toArray(new EReference[persistentReferences.size()]);
allPersistentContainments = persistentContainments.toArray(new EStructuralFeature[persistentContainments.size()]);
+ allPersistentMapFeatures = persistentMapFeatures.toArray(new EStructuralFeature[persistentMapFeatures.size()]);
persistentFeatureIndices = new int[allFeatures.size()];
Arrays.fill(persistentFeatureIndices, NO_SLOT);
@@ -453,6 +468,12 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
return DEBUG ? getDump() : eClass.toString();
}
+ public static boolean isMap(EStructuralFeature eStructuralFeature)
+ {
+ // Java ensures that string constants are interned, so == is actually more efficient than equals().
+ return eStructuralFeature.getEType().getInstanceClassName() == "java.util.Map$Entry"; //$NON-NLS-1$
+ }
+
/**
* @author Eike Stepper
*/
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_561250_Test.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_561250_Test.java
new file mode 100644
index 0000000000..58538b2191
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/bugzilla/Bugzilla_561250_Test.java
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2020 Eike Stepper (Loehne, Germany) and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ * Robert Schulk - initial API and implementation
+ */
+package org.eclipse.emf.cdo.tests.bugzilla;
+
+import org.eclipse.emf.cdo.eresource.CDOResource;
+import org.eclipse.emf.cdo.session.CDOSession;
+import org.eclipse.emf.cdo.tests.AbstractCDOTest;
+import org.eclipse.emf.cdo.tests.model1.Customer;
+import org.eclipse.emf.cdo.tests.model1.Product1;
+import org.eclipse.emf.cdo.tests.model1.SalesOrder;
+import org.eclipse.emf.cdo.transaction.CDOTransaction;
+import org.eclipse.emf.cdo.view.CDOView;
+
+import org.eclipse.emf.common.util.EMap;
+
+/**
+ * Bug 561250 - First element in EMap is not always visible from another session.
+ *
+ * @author Robert Schulk
+ */
+public class Bugzilla_561250_Test extends AbstractCDOTest
+{
+ public void testMapInitialization() throws Exception
+ {
+ CDOSession session1 = openSession();
+ CDOTransaction transaction1 = session1.openTransaction();
+
+ Customer customer1 = getModel1Factory().createCustomer();
+ Product1 product1 = getModel1Factory().createProduct1();
+ SalesOrder salesOrder1 = getModel1Factory().createSalesOrder();
+
+ CDOResource resource1 = transaction1.createResource(getResourcePath("/test"));
+ resource1.getContents().add(customer1);
+ resource1.getContents().add(product1);
+ resource1.getContents().add(salesOrder1);
+ transaction1.commit();
+
+ CDOSession session2 = openSession();
+ CDOView view2 = session2.openView();
+ Customer customer2 = view2.getObject(customer1);
+
+ // Load customer2. Necessary before the next transaction1.commit() !
+ EMap<Product1, SalesOrder> orderByProduct2 = customer2.getOrderByProduct();
+
+ customer1.getOrderByProduct().put(product1, salesOrder1);
+ commitAndSync(transaction1, view2); // Transitions customer2 from CLEAN to PROXY.
+
+ Product1 product2 = view2.getObject(product1);
+ assertNotNull("Could not find the recently added map entry.", orderByProduct2.get(product2));
+ }
+}
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 5529150a61..1817fe087e 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
@@ -25,6 +25,7 @@ import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.security.CDOPermission;
import org.eclipse.emf.cdo.eresource.CDOResource;
import org.eclipse.emf.cdo.eresource.impl.CDOResourceNodeImpl;
+import org.eclipse.emf.cdo.internal.common.model.CDOClassInfoImpl;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo.PersistenceFilter;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
@@ -69,7 +70,6 @@ import org.eclipse.emf.ecore.util.FeatureMapUtil;
import org.eclipse.emf.ecore.util.InternalEList;
import org.eclipse.emf.spi.cdo.CDOStore;
import org.eclipse.emf.spi.cdo.FSMUtil;
-import org.eclipse.emf.spi.cdo.InternalCDOLoadable;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
import org.eclipse.emf.spi.cdo.InternalCDOView;
import org.eclipse.emf.spi.cdo.InternalCDOView.ViewAndState;
@@ -78,6 +78,7 @@ import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Map;
+import java.util.function.Consumer;
/**
* The base class of all <em>native</em> {@link CDOObject objects}.
@@ -433,27 +434,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
@Override
public final void cdoInternalPostLoad()
{
- // Reset EMAP objects
- Object[] eSettings = eBasicSettings();
- if (eSettings != null)
- {
- // Make sure transient features are kept but persisted values are not cached.
- InternalCDOClassInfo classInfo = cdoClassInfo();
- int featureCount = classInfo.getEClass().getFeatureCount();
- for (int i = 0; i < featureCount; i++)
- {
- // We need to keep the existing list if possible.
- int index = classInfo.getSettingsFeatureIndex(i);
- if (index != InternalCDOClassInfo.NO_SLOT)
- {
- Object value = eSettings[index];
- if (value instanceof InternalCDOLoadable)
- {
- ((InternalCDOLoadable)value).cdoInternalPostLoad();
- }
- }
- }
- }
+ forAllMapAttributes(map -> map.postLoad());
}
/**
@@ -463,6 +444,31 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
public final void cdoInternalPostInvalidate()
{
cdoInternalSetRevision(null);
+ forAllMapAttributes(map -> map.postInvalidate());
+ }
+
+ private void forAllMapAttributes(Consumer<CDOStoreEcoreEMap> consumer)
+ {
+ Object[] eSettings = eBasicSettings();
+ if (eSettings != null)
+ {
+ InternalCDOClassInfo classInfo = cdoClassInfo();
+ EStructuralFeature[] persistentMapFeatures = classInfo.getAllPersistentMapFeatures();
+ int length = persistentMapFeatures.length;
+
+ for (int i = 0; i < length; i++)
+ {
+ EStructuralFeature feature = persistentMapFeatures[i];
+ int featureID = feature.getFeatureID();
+ int index = classInfo.getSettingsFeatureIndex(featureID);
+
+ CDOStoreEcoreEMap map = (CDOStoreEcoreEMap)eSettings[index];
+ if (map != null)
+ {
+ consumer.accept(map);
+ }
+ }
+ }
}
/**
@@ -1299,7 +1305,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
@Override
protected EList<?> createList(EStructuralFeature eStructuralFeature)
{
- if (isMap(eStructuralFeature))
+ if (CDOClassInfoImpl.isMap(eStructuralFeature))
{
return createMap(eStructuralFeature);
}
@@ -1336,12 +1342,6 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
return new CDOStoreEcoreEMap(eStructuralFeature);
}
- private boolean isMap(EStructuralFeature eStructuralFeature)
- {
- // Java ensures that string constants are interned, so == is actually more efficient than equals().
- return eStructuralFeature.getEType().getInstanceClassName() == "java.util.Map$Entry"; //$NON-NLS-1$
- }
-
private boolean isRootResource()
{
return this instanceof CDOResource && ((CDOResource)this).isRoot();
@@ -1793,8 +1793,10 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @author Eike Stepper
* @since 4.1
*/
- private final class CDOStoreEcoreEMap extends EcoreEMap<Object, Object> implements InternalCDOLoadable
+ private final class CDOStoreEcoreEMap extends EcoreEMap<Object, Object>
{
+ private static final int CHECK_LIST_FOR_READING = Integer.MAX_VALUE;
+
private static final long serialVersionUID = 1L;
public CDOStoreEcoreEMap(EStructuralFeature eStructuralFeature)
@@ -1804,10 +1806,6 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
{
private static final long serialVersionUID = 1L;
- // {
- // ensureEntryDataExists();
- // }
-
@Override
public void unset()
{
@@ -1838,7 +1836,6 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
protected void didClear(int size, Object[] oldObjects)
{
CDOStoreEcoreEMap.this.doClear();
- // ensureEntryDataExists();
}
@Override
@@ -1848,15 +1845,29 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
};
+ size = CHECK_LIST_FOR_READING;
+ }
+
+ public void postLoad()
+ {
+ entryData = null;
size = delegateEList.size();
}
+ public void postInvalidate()
+ {
+ entryData = null;
+ size = CHECK_LIST_FOR_READING;
+ }
+
private void checkListForReading()
{
if (!FSMUtil.isTransient(CDOObjectImpl.this))
{
CDOStateMachine.INSTANCE.read(CDOObjectImpl.this);
}
+
+ size = delegateEList.size();
}
/**
@@ -2519,18 +2530,6 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
checkListForReading();
return super.containsValue(value);
}
-
- @Override
- public void cdoInternalPreLoad()
- {
- }
-
- @Override
- public void cdoInternalPostLoad()
- {
- entryData = null;
- size = delegateEList.size();
- }
}
/**

Back to the top