Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2013-02-13 03:17:16 -0500
committerEike Stepper2013-02-13 14:58:23 -0500
commitae4976ae6e18c5871d1838b927d95d905da84296 (patch)
tree8c36f9b3999ad57feb0da59ba18de979e86a562c
parentef70e75984ccdd2c0eb2cec0da13ac7e1319d4ea (diff)
downloadcdo-ae4976ae6e18c5871d1838b927d95d905da84296.tar.gz
cdo-ae4976ae6e18c5871d1838b927d95d905da84296.tar.xz
cdo-ae4976ae6e18c5871d1838b927d95d905da84296.zip
[400388] Integrate the new MinimalEStoreEObjectImpl
https://bugs.eclipse.org/bugs/show_bug.cgi?id=400388
-rw-r--r--features/org.eclipse.emf.cdo-feature/feature.xml8
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java93
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOClassInfo.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/AbstractCDORevision.java31
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.java16
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java10
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java9
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath7
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.project39
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs90
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs32
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF10
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html28
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini15
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings6
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties31
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties26
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt8
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties11
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.pngbin0 -> 2414 bytes
-rw-r--r--plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java334
-rw-r--r--plugins/org.eclipse.emf.cdo/.settings/.api_filters232
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java266
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java6
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java1
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java3
26 files changed, 1188 insertions, 128 deletions
diff --git a/features/org.eclipse.emf.cdo-feature/feature.xml b/features/org.eclipse.emf.cdo-feature/feature.xml
index 09a3a5c6ac..e74219abd7 100644
--- a/features/org.eclipse.emf.cdo-feature/feature.xml
+++ b/features/org.eclipse.emf.cdo-feature/feature.xml
@@ -237,4 +237,12 @@
version="0.0.0"
unpack="false"/>
+ <plugin
+ id="org.eclipse.emf.cdo.ecore.retrofit"
+ download-size="0"
+ install-size="0"
+ version="0.0.0"
+ fragment="true"
+ unpack="false"/>
+
</feature>
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 9b7743880f..9db71b24d1 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
@@ -11,11 +11,16 @@
*/
package org.eclipse.emf.cdo.internal.common.model;
+import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.model.CDOClassInfo;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
+import org.eclipse.emf.cdo.spi.common.revision.StubCDORevision;
+
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
@@ -40,6 +45,8 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
{
private static final PersistenceFilter[] NO_FILTERS = {};
+ private final InternalCDORevision revisionWithoutID = new RevisionWithoutID(this);
+
private EClass eClass;
private final BitSet persistentBits = new BitSet();
@@ -74,6 +81,16 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
{
}
+ public InternalCDORevision getRevisionForID(CDOID id)
+ {
+ if (id == null)
+ {
+ return revisionWithoutID;
+ }
+
+ return new RevisionWithID(this, id);
+ }
+
public boolean isAdapterForType(Object type)
{
return type == CDOClassInfo.class;
@@ -357,4 +374,80 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
{
return eClass.toString();
}
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class RevisionWithoutID extends StubCDORevision
+ {
+ public RevisionWithoutID(InternalCDOClassInfo classInfo)
+ {
+ super(classInfo);
+ }
+
+ @Override
+ public CDOID getID()
+ {
+ return null;
+ }
+
+ @Override
+ public InternalCDORevision getRevisionForID(CDOID id)
+ {
+ if (id == null)
+ {
+ return this;
+ }
+
+ return new RevisionWithID(getClassInfo(), id);
+ }
+
+ @Override
+ public InternalCDORevision getProperRevision()
+ {
+ return null;
+ }
+ }
+
+ /**
+ * @author Eike Stepper
+ */
+ private static final class RevisionWithID extends StubCDORevision
+ {
+ private final CDOID id;
+
+ public RevisionWithID(InternalCDOClassInfo classInfo, CDOID id)
+ {
+ super(classInfo);
+ this.id = id;
+ }
+
+ @Override
+ public CDOID getID()
+ {
+ return id;
+ }
+
+ @Override
+ public InternalCDORevision getRevisionForID(CDOID id)
+ {
+ if (id == null)
+ {
+ return getClassInfo().getRevisionForID(null);
+ }
+
+ if (id.equals(this.id))
+ {
+ throw new ImplementationError(); // XXX Remove me
+ }
+
+ return new RevisionWithID(getClassInfo(), id);
+ }
+
+ @Override
+ public InternalCDORevision getProperRevision()
+ {
+ return null;
+ }
+ }
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOClassInfo.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOClassInfo.java
index 02f65a4a29..6abe7d62d5 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOClassInfo.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/model/InternalCDOClassInfo.java
@@ -10,9 +10,11 @@
*/
package org.eclipse.emf.cdo.spi.common.model;
+import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.model.CDOClassInfo;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl;
+import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -26,6 +28,8 @@ public interface InternalCDOClassInfo extends CDOClassInfo
{
public static final int NO_SLOT = EStore.NO_INDEX;
+ public InternalCDORevision getRevisionForID(CDOID id);
+
/**
* Returns the index of the specified {@link EStructuralFeature feature} in the {@link CDORevisionImpl#values} array, never {@link #NO_SLOT}.
*
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/AbstractCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/AbstractCDORevision.java
index c0b8b9de8d..8a476cd64a 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/AbstractCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/AbstractCDORevision.java
@@ -15,6 +15,7 @@ package org.eclipse.emf.cdo.spi.common.revision;
import org.eclipse.emf.cdo.common.branch.CDOBranch;
import org.eclipse.emf.cdo.common.branch.CDOBranchPoint;
+import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
@@ -22,6 +23,7 @@ import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo;
+import org.eclipse.net4j.util.ImplementationError;
import org.eclipse.net4j.util.ObjectUtil;
import org.eclipse.emf.ecore.EClass;
@@ -58,6 +60,14 @@ public abstract class AbstractCDORevision implements InternalCDORevision
/**
* @since 4.2
*/
+ protected AbstractCDORevision(InternalCDOClassInfo classInfo)
+ {
+ this.classInfo = classInfo;
+ }
+
+ /**
+ * @since 4.2
+ */
public final InternalCDOClassInfo getClassInfo()
{
return classInfo;
@@ -73,6 +83,27 @@ public abstract class AbstractCDORevision implements InternalCDORevision
return null;
}
+ /**
+ * @since 4.2
+ */
+ public InternalCDORevision getRevisionForID(CDOID id)
+ {
+ if (id != null && id.equals(getID()))
+ {
+ throw new ImplementationError(); // XXX Remove me!
+ }
+
+ return classInfo.getRevisionForID(id);
+ }
+
+ /**
+ * @since 4.2
+ */
+ public InternalCDORevision getProperRevision()
+ {
+ return this;
+ }
+
public boolean isResourceNode()
{
return classInfo.isResourceNode();
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.java
index 748ed652cd..1a2adc88fd 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/DelegatingCDORevision.java
@@ -44,6 +44,22 @@ public abstract class DelegatingCDORevision implements InternalCDORevision
public abstract InternalCDORevision getDelegate();
/**
+ * @since 4.2
+ */
+ public InternalCDORevision getRevisionForID(CDOID id)
+ {
+ return getDelegate().getRevisionForID(id);
+ }
+
+ /**
+ * @since 4.2
+ */
+ public InternalCDORevision getProperRevision()
+ {
+ return getDelegate().getProperRevision();
+ }
+
+ /**
* @since 4.0
*/
public boolean adjustReferences(CDOReferenceAdjuster referenceAdjuster)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
index 8e16a33dcd..a5c1e427a8 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/InternalCDORevision.java
@@ -42,6 +42,16 @@ public interface InternalCDORevision extends CDORevision, CDORevisionData, CDORe
*/
public InternalCDOClassInfo getClassInfo();
+ /**
+ * @since 4.2
+ */
+ public InternalCDORevision getRevisionForID(CDOID id);
+
+ /**
+ * @since 4.2
+ */
+ public InternalCDORevision getProperRevision();
+
public void setID(CDOID id);
public void setVersion(int version);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
index 356a5cadcb..b7f27d59ab 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/StubCDORevision.java
@@ -20,6 +20,7 @@ import org.eclipse.emf.cdo.common.revision.CDOList;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.common.security.CDOPermission;
+import org.eclipse.emf.cdo.spi.common.model.InternalCDOClassInfo;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -39,6 +40,14 @@ public class StubCDORevision extends AbstractCDORevision
super(eClass);
}
+ /**
+ * @since 4.2
+ */
+ protected StubCDORevision(InternalCDOClassInfo classInfo)
+ {
+ super(classInfo);
+ }
+
public int compareTo(CDOBranchPoint o)
{
throw new UnsupportedOperationException(getExceptionMessage());
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath
new file mode 100644
index 0000000000..64c5e31b7a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.classpath
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.pde.core.requiredPlugins"/>
+ <classpathentry kind="src" path="src"/>
+ <classpathentry kind="output" path="bin"/>
+</classpath>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project
new file mode 100644
index 0000000000..7ad32da298
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.project
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.emf.cdo.ecore.retrofit</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.ManifestBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.pde.api.tools.apiAnalysisBuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.emf.cdo.releng.version.VersionBuilder</name>
+ <arguments>
+ <dictionary>
+ <key>release.path</key>
+ <value>/org.eclipse.emf.cdo.releng.release/release.xml</value>
+ </dictionary>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.pde.PluginNature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.pde.api.tools.apiAnalysisNature</nature>
+ <nature>org.eclipse.emf.cdo.releng.version.VersionNature</nature>
+ </natures>
+</projectDescription>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 0000000000..77dea87f7a
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,90 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.annotation.missingNonNullByDefaultAnnotation=ignore
+org.eclipse.jdt.core.compiler.annotation.nonnull=org.eclipse.jdt.annotation.NonNull
+org.eclipse.jdt.core.compiler.annotation.nonnullbydefault=org.eclipse.jdt.annotation.NonNullByDefault
+org.eclipse.jdt.core.compiler.annotation.nullable=org.eclipse.jdt.annotation.Nullable
+org.eclipse.jdt.core.compiler.annotation.nullanalysis=disabled
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.annotationSuperInterface=warning
+org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
+org.eclipse.jdt.core.compiler.problem.autoboxing=ignore
+org.eclipse.jdt.core.compiler.problem.comparingIdentical=warning
+org.eclipse.jdt.core.compiler.problem.deadCode=warning
+org.eclipse.jdt.core.compiler.problem.deprecation=warning
+org.eclipse.jdt.core.compiler.problem.deprecationInDeprecatedCode=disabled
+org.eclipse.jdt.core.compiler.problem.deprecationWhenOverridingDeprecatedMethod=disabled
+org.eclipse.jdt.core.compiler.problem.discouragedReference=warning
+org.eclipse.jdt.core.compiler.problem.emptyStatement=warning
+org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
+org.eclipse.jdt.core.compiler.problem.explicitlyClosedAutoCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.fallthroughCase=warning
+org.eclipse.jdt.core.compiler.problem.fatalOptionalError=disabled
+org.eclipse.jdt.core.compiler.problem.fieldHiding=ignore
+org.eclipse.jdt.core.compiler.problem.finalParameterBound=warning
+org.eclipse.jdt.core.compiler.problem.finallyBlockNotCompletingNormally=warning
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=error
+org.eclipse.jdt.core.compiler.problem.hiddenCatchBlock=warning
+org.eclipse.jdt.core.compiler.problem.includeNullInfoFromAsserts=disabled
+org.eclipse.jdt.core.compiler.problem.incompatibleNonInheritedInterfaceMethod=warning
+org.eclipse.jdt.core.compiler.problem.incompleteEnumSwitch=warning
+org.eclipse.jdt.core.compiler.problem.indirectStaticAccess=ignore
+org.eclipse.jdt.core.compiler.problem.localVariableHiding=ignore
+org.eclipse.jdt.core.compiler.problem.methodWithConstructorName=warning
+org.eclipse.jdt.core.compiler.problem.missingDefaultCase=ignore
+org.eclipse.jdt.core.compiler.problem.missingDeprecatedAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingEnumCaseDespiteDefault=disabled
+org.eclipse.jdt.core.compiler.problem.missingHashCodeMethod=warning
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotation=ignore
+org.eclipse.jdt.core.compiler.problem.missingOverrideAnnotationForInterfaceMethodImplementation=enabled
+org.eclipse.jdt.core.compiler.problem.missingSerialVersion=warning
+org.eclipse.jdt.core.compiler.problem.missingSynchronizedOnInheritedMethod=warning
+org.eclipse.jdt.core.compiler.problem.noEffectAssignment=warning
+org.eclipse.jdt.core.compiler.problem.noImplicitStringConversion=warning
+org.eclipse.jdt.core.compiler.problem.nonExternalizedStringLiteral=warning
+org.eclipse.jdt.core.compiler.problem.nullAnnotationInferenceConflict=error
+org.eclipse.jdt.core.compiler.problem.nullReference=warning
+org.eclipse.jdt.core.compiler.problem.nullSpecViolation=error
+org.eclipse.jdt.core.compiler.problem.nullUncheckedConversion=warning
+org.eclipse.jdt.core.compiler.problem.overridingPackageDefaultMethod=warning
+org.eclipse.jdt.core.compiler.problem.parameterAssignment=ignore
+org.eclipse.jdt.core.compiler.problem.possibleAccidentalBooleanAssignment=warning
+org.eclipse.jdt.core.compiler.problem.potentialNullReference=warning
+org.eclipse.jdt.core.compiler.problem.potentiallyUnclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.rawTypeReference=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullAnnotation=warning
+org.eclipse.jdt.core.compiler.problem.redundantNullCheck=warning
+org.eclipse.jdt.core.compiler.problem.redundantSpecificationOfTypeArguments=ignore
+org.eclipse.jdt.core.compiler.problem.redundantSuperinterface=warning
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBePotentiallyStatic=ignore
+org.eclipse.jdt.core.compiler.problem.reportMethodCanBeStatic=ignore
+org.eclipse.jdt.core.compiler.problem.specialParameterHidingField=disabled
+org.eclipse.jdt.core.compiler.problem.staticAccessReceiver=warning
+org.eclipse.jdt.core.compiler.problem.suppressOptionalErrors=disabled
+org.eclipse.jdt.core.compiler.problem.suppressWarnings=enabled
+org.eclipse.jdt.core.compiler.problem.syntheticAccessEmulation=ignore
+org.eclipse.jdt.core.compiler.problem.typeParameterHiding=warning
+org.eclipse.jdt.core.compiler.problem.unavoidableGenericTypeProblems=enabled
+org.eclipse.jdt.core.compiler.problem.uncheckedTypeOperation=warning
+org.eclipse.jdt.core.compiler.problem.unclosedCloseable=ignore
+org.eclipse.jdt.core.compiler.problem.undocumentedEmptyBlock=ignore
+org.eclipse.jdt.core.compiler.problem.unhandledWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryElse=warning
+org.eclipse.jdt.core.compiler.problem.unnecessaryTypeCheck=warning
+org.eclipse.jdt.core.compiler.problem.unqualifiedFieldAccess=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownException=ignore
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionExemptExceptionAndThrowable=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedDeclaredThrownExceptionWhenOverriding=disabled
+org.eclipse.jdt.core.compiler.problem.unusedImport=warning
+org.eclipse.jdt.core.compiler.problem.unusedLabel=warning
+org.eclipse.jdt.core.compiler.problem.unusedLocal=warning
+org.eclipse.jdt.core.compiler.problem.unusedObjectAllocation=warning
+org.eclipse.jdt.core.compiler.problem.unusedParameter=ignore
+org.eclipse.jdt.core.compiler.problem.unusedParameterIncludeDocCommentReference=enabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenImplementingAbstract=disabled
+org.eclipse.jdt.core.compiler.problem.unusedParameterWhenOverridingConcrete=disabled
+org.eclipse.jdt.core.compiler.problem.unusedPrivateMember=warning
+org.eclipse.jdt.core.compiler.problem.unusedWarningToken=warning
+org.eclipse.jdt.core.compiler.problem.varargsArgumentNeedCast=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs
new file mode 100644
index 0000000000..d4dc66acb2
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/.settings/org.eclipse.pde.prefs
@@ -0,0 +1,32 @@
+compilers.f.unresolved-features=2
+compilers.f.unresolved-plugins=1
+compilers.incompatible-environment=1
+compilers.p.build=2
+compilers.p.build.bin.includes=1
+compilers.p.build.encodings=2
+compilers.p.build.java.compiler=2
+compilers.p.build.java.compliance=1
+compilers.p.build.missing.output=2
+compilers.p.build.output.library=1
+compilers.p.build.source.library=1
+compilers.p.build.src.includes=1
+compilers.p.deprecated=1
+compilers.p.discouraged-class=1
+compilers.p.internal=1
+compilers.p.missing-packages=1
+compilers.p.missing-version-export-package=2
+compilers.p.missing-version-import-package=1
+compilers.p.missing-version-require-bundle=1
+compilers.p.no-required-att=0
+compilers.p.not-externalized-att=1
+compilers.p.unknown-attribute=1
+compilers.p.unknown-class=1
+compilers.p.unknown-element=1
+compilers.p.unknown-identifier=1
+compilers.p.unknown-resource=1
+compilers.p.unresolved-ex-points=0
+compilers.p.unresolved-import=0
+compilers.s.create-docs=false
+compilers.s.doc-folder=doc
+compilers.s.open-tags=1
+eclipse.preferences.version=1
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF b/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF
new file mode 100644
index 0000000000..6ce6f64b35
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/META-INF/MANIFEST.MF
@@ -0,0 +1,10 @@
+Manifest-Version: 1.0
+Bundle-ManifestVersion: 2
+Bundle-Name: %pluginName
+Bundle-SymbolicName: org.eclipse.emf.cdo.ecore.retrofit;singleton:=true
+Bundle-Version: 4.2.0.qualifier
+Fragment-Host: org.eclipse.emf.ecore;bundle-version="[2.5.0,3.0.0)"
+Bundle-RequiredExecutionEnvironment: J2SE-1.5
+Bundle-Vendor: %providerName
+Bundle-Localization: fragment
+Export-Package: org.eclipse.emf.ecore.impl
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html
new file mode 100644
index 0000000000..d35d5aed64
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>June 5, 2007</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini
new file mode 100644
index 0000000000..32006ae5d6
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.ini
@@ -0,0 +1,15 @@
+# about.ini
+# contains information about a feature
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# "%key" are externalized strings defined in about.properties
+# This file does not need to be translated.
+
+# Property "aboutText" contains blurb for "About" dialog (translated)
+aboutText=%featureText
+
+# Property "featureImage" contains path to feature image (32x32)
+featureImage=modeling32.png
+
+# Property "appName" contains name of the application (translated)
+appName=%featureName
+
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings
new file mode 100644
index 0000000000..bddaab4310
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.mappings
@@ -0,0 +1,6 @@
+# about.mappings
+# contains fill-ins for about.properties
+# java.io.Properties file (ISO 8859-1 with "\" escapes)
+# This file does not need to be translated.
+
+0=@build@ \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties
new file mode 100644
index 0000000000..0967db9611
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/about.properties
@@ -0,0 +1,31 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+# ==============================================================================
+# Do not change the properties between this line and the last line containing:
+# %%% END OF TRANSLATED PROPERTIES %%%
+# Instead, either redefine an existing property, or create a new property,
+# append it to the end of the file, and change the code to use the new name.
+# ==============================================================================
+
+featureName = CDO Model Repository Client (Retrofit for EMF before 2.9)
+featureText = CDO Model Repository Client (Retrofit for EMF before 2.9)\n\
+Version: {featureVersion}\n\
+Build id: {0}\n\
+\n\
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, Germany) and others. All rights reserved.\n\
+\n\
+Visit http://www.eclipse.org/cdo
+
+# ==============================================================================
+# %%% END OF TRANSLATED PROPERTIES %%%
+# The above properties have been shipped for translation.
+# ==============================================================================
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties
new file mode 100644
index 0000000000..4c86a7c3db
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/build.properties
@@ -0,0 +1,26 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+# Eike Stepper - initial API and implementation
+
+# NLS_MESSAGEFORMAT_VAR
+
+source.. = src/
+output.. = bin/
+bin.includes = META-INF/,\
+ .,\
+ about.html,\
+ about.ini,\
+ about.mappings,\
+ about.properties,\
+ copyright.txt,\
+ fragment.properties,\
+ modeling32.png
+src.includes = about.html,\
+ copyright.txt
+
+generateSourceReferences = true
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt b/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt
new file mode 100644
index 0000000000..cea141de92
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/copyright.txt
@@ -0,0 +1,8 @@
+Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+ Martin Fluegge - initial API and implementation \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties b/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties
new file mode 100644
index 0000000000..cfe209dd1e
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/fragment.properties
@@ -0,0 +1,11 @@
+# Copyright (c) 2004 - 2012 Eike Stepper (Berlin, 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:
+# Martin Fluegge - initial API and implementation
+
+pluginName = CDO Model Repository Client (Retrofit for EMF before 2.9)
+providerName = Eclipse Modeling Project
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png b/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png
new file mode 100644
index 0000000000..6b08de2ada
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/modeling32.png
Binary files differ
diff --git a/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java b/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java
new file mode 100644
index 0000000000..8795228d7d
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo.ecore.retrofit/src/org/eclipse/emf/ecore/impl/MinimalEStoreEObjectImpl.java
@@ -0,0 +1,334 @@
+/**
+ * Copyright (c) 2002-2013 IBM Corporation 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:
+ * IBM - Initial API and implementation
+ */
+package org.eclipse.emf.ecore.impl;
+
+
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.util.BasicEMap;
+import org.eclipse.emf.common.util.EList;
+import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EClassifier;
+import org.eclipse.emf.ecore.EObject;
+import org.eclipse.emf.ecore.EReference;
+import org.eclipse.emf.ecore.EStructuralFeature;
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreEMap;
+import org.eclipse.emf.ecore.util.FeatureMap;
+import org.eclipse.emf.ecore.util.FeatureMapUtil;
+
+
+/**
+ * A minimal abstract implementation of '<em><b>EObject</b></em>' that delegates to a {@link org.eclipse.emf.ecore.InternalEObject.EStore store}.
+ * It's extends {@link MinimalEObjectImpl} and does <b>not</b> introduce any additional fields.
+ * Clients extending this class must specialize {@link #eStore()}.
+ * @since 2.9
+ */
+@SuppressWarnings("javadoc")
+public abstract class MinimalEStoreEObjectImpl extends MinimalEObjectImpl
+{
+ private static final EObservableAdapterList.Listener ADAPTERS_LISTENER = new EObservableAdapterList.Listener()
+ {
+ public void added(Notifier notifier, Adapter adapter)
+ {
+ MinimalEStoreEObjectImpl object = (MinimalEStoreEObjectImpl)notifier;
+ object.eAdapterAdded(adapter);
+ }
+
+ public void removed(Notifier notifier, Adapter adapter)
+ {
+ MinimalEStoreEObjectImpl object = (MinimalEStoreEObjectImpl)notifier;
+ object.eAdapterRemoved(adapter);
+ }
+ };
+
+ /**
+ * Creates a store-based EObject.
+ */
+ public MinimalEStoreEObjectImpl()
+ {
+ super();
+ }
+
+ /**
+ * Creates a store-based EObject.
+ */
+ public MinimalEStoreEObjectImpl(EClass eClass)
+ {
+ super();
+ eSetClass(eClass);
+ }
+
+ @Override
+ public abstract InternalEObject.EStore eStore();
+
+ protected boolean eIsCaching()
+ {
+ return true;
+ }
+
+ Object[] eDynamicSettings()
+ {
+ Object[] settings = eBasicSettings();
+ if (settings == null)
+ {
+ eSettings();
+ settings = eBasicSettings();
+ }
+ return settings;
+ }
+
+ @Override
+ public Object dynamicGet(int dynamicFeatureID)
+ {
+ Object[] eSettings = eDynamicSettings();
+ Object result = eSettings[dynamicFeatureID];
+ if (result == null)
+ {
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (!eStructuralFeature.isTransient())
+ {
+ if (FeatureMapUtil.isFeatureMap(eStructuralFeature))
+ {
+ eSettings[dynamicFeatureID] = result = createFeatureMap(eStructuralFeature);
+ }
+ else if (eStructuralFeature.isMany())
+ {
+ eSettings[dynamicFeatureID] = result = createList(eStructuralFeature);
+ }
+ else
+ {
+ result = eStore().get(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = result;
+ }
+ }
+ }
+ }
+ return result;
+ }
+
+ @Override
+ public void dynamicSet(int dynamicFeatureID, Object value)
+ {
+ Object[] eSettings = eDynamicSettings();
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (eStructuralFeature.isTransient())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ else
+ {
+ eStore().set(this, eStructuralFeature, InternalEObject.EStore.NO_INDEX, value);
+ if (eIsCaching())
+ {
+ eSettings[dynamicFeatureID] = value;
+ }
+ }
+ }
+
+ @Override
+ public void dynamicUnset(int dynamicFeatureID)
+ {
+ Object[] eSettings = eDynamicSettings();
+ EStructuralFeature eStructuralFeature = eDynamicFeature(dynamicFeatureID);
+ if (eStructuralFeature.isTransient())
+ {
+ eSettings[dynamicFeatureID] = null;
+ }
+ else
+ {
+ eStore().unset(this, eStructuralFeature);
+ eSettings[dynamicFeatureID] = null;
+ }
+ }
+
+ @Override
+ protected boolean eDynamicIsSet(int dynamicFeatureID, EStructuralFeature eFeature)
+ {
+ return
+ dynamicFeatureID < 0 ?
+ eOpenIsSet(eFeature) :
+ eFeature.isTransient() ?
+ eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), dynamicFeatureID) :
+ eStore().isSet(this, eFeature);
+ }
+
+ @SuppressWarnings("nls")
+ protected EList<?> createList(final EStructuralFeature eStructuralFeature)
+ {
+ final EClassifier eType = eStructuralFeature.getEType();
+ if (eType.getInstanceClassName() == "java.util.Map$Entry")
+ {
+ class EStoreEcoreEMap extends EcoreEMap<Object, Object>
+ {
+ private static final long serialVersionUID = 1L;
+
+ public EStoreEcoreEMap()
+ {
+ super
+ ((EClass)eType,
+ BasicEMap.Entry.class,
+ null);
+ delegateEList =
+ new EStoreEObjectImpl.BasicEStoreEList<BasicEMap.Entry<Object, Object>>(MinimalEStoreEObjectImpl.this, 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 EStoreEObjectImpl.BasicEStoreEList<Object>(this, eStructuralFeature);
+ }
+
+ protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
+ {
+ return new EStoreEObjectImpl.EStoreFeatureMap(this, eStructuralFeature, eStore());
+ }
+
+ /**
+ * Returns the container as cached by {@link MinimalEObjectImpl#eInternalContainer()}.
+ */
+ protected InternalEObject eBasicInternalContainer()
+ {
+ return super.eInternalContainer();
+ }
+
+ /**
+ * Returns the container as {@link InternalEObject.EStore#getContainer(InternalEObject) provided} by the store.
+ */
+ @Override
+ public InternalEObject eInternalContainer()
+ {
+ return eStore().getContainer(this);
+ }
+
+ /**
+ * Returns the container feature ID as cached by {@link MinimalEObjectImpl#eContainerFeatureID()}.
+ */
+ protected int eBasicContainerFeatureID()
+ {
+ return super.eContainerFeatureID();
+ }
+
+ /**
+ * Returns the container feature ID as computed from the container feature {@link InternalEObject.EStore#getContainingFeature(InternalEObject) provided} by the store.
+ */
+ @Override
+ public int eContainerFeatureID()
+ {
+ EObject eContainer = eInternalContainer();
+ if (eContainer != null)
+ {
+ EStructuralFeature eContainingFeature = eStore().getContainingFeature(this);
+ if (eContainingFeature instanceof EReference)
+ {
+ EReference eContainingReference = (EReference)eContainingFeature;
+ EReference eOpposite = eContainingReference.getEOpposite();
+ if (eOpposite != null)
+ {
+ return eClass().getFeatureID(eOpposite);
+ }
+ }
+
+ return EOPPOSITE_FEATURE_BASE - eContainer.eClass().getFeatureID(eContainingFeature);
+ }
+
+ return 0;
+ }
+
+ @Override
+ protected int eStaticFeatureCount()
+ {
+ return 0;
+ }
+
+ @Override
+ public int eDerivedStructuralFeatureID(EStructuralFeature eStructuralFeature)
+ {
+ return eClass().getFeatureID(eStructuralFeature);
+ }
+
+ @Override
+ protected void eBasicSetAdapterArray(Adapter[] adapters)
+ {
+ Adapter[] oldAdapters = eBasicAdapterArray();
+ if (adapters == null || adapters.length == 0)
+ {
+ adapters = null;// Optimize possibly empty array
+ if (oldAdapters != null) // Can't be empty array because of the optimization above
+ {
+ ((EObservableAdapterList)eAdapters()).removeListener(ADAPTERS_LISTENER);
+ }
+ }
+ else
+ {
+ if (oldAdapters == null) // Can't be empty array because of the optimization above
+ {
+ ((EObservableAdapterList)eAdapters()).addListener(ADAPTERS_LISTENER);
+ }
+ }
+ super.eBasicSetAdapterArray(adapters);
+ }
+
+ protected EObservableAdapterList.Listener[] eBasicAdapterListeners()
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ protected void eBasicSetAdapterListeners(EObservableAdapterList.Listener[] eAdapterListeners)
+ {
+ throw new UnsupportedOperationException();
+ }
+
+ protected void eAdapterAdded(Adapter adapter)
+ {
+ }
+
+ protected void eAdapterRemoved(Adapter adapter)
+ {
+ }
+} \ No newline at end of file
diff --git a/plugins/org.eclipse.emf.cdo/.settings/.api_filters b/plugins/org.eclipse.emf.cdo/.settings/.api_filters
index 1d5e02595d..9182fdb67d 100644
--- a/plugins/org.eclipse.emf.cdo/.settings/.api_filters
+++ b/plugins/org.eclipse.emf.cdo/.settings/.api_filters
@@ -172,6 +172,18 @@
<filter id="338792546">
<message_arguments>
<message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoDirectResource()"/>
+ </message_arguments>
+ </filter>
+ <filter id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoResource()"/>
+ </message_arguments>
+ </filter>
+ <filter id="338792546">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
<message_argument value="cdoSettings()"/>
</message_arguments>
</filter>
@@ -192,10 +204,16 @@
<message_argument value="org.eclipse.emf.cdo_4.2.0"/>
</message_arguments>
</filter>
- <filter id="421572723">
+ <filter id="421654647">
<message_arguments>
<message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
- <message_argument value="cdoSettings()"/>
+ <message_argument value="cdoConflict()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoDirectResource()"/>
</message_arguments>
</filter>
<filter id="421654647">
@@ -207,6 +225,114 @@
<filter id="421654647">
<message_arguments>
<message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalDynamicFeature(int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalInstance()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalPostAttach()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalPostInvalidate()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalPostLoad()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalPostRollback()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalPreCommit()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalSetID(CDOID)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalSetResource(CDOResource)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalSetRevision(CDORevision)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalSetState(CDOState)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInternalSetView(CDOView)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoInvalid()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoLockState()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoPrefetch(int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoReadLock()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoReload()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoResource()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
<message_argument value="cdoRevision()"/>
</message_arguments>
</filter>
@@ -225,9 +351,111 @@
<filter id="421654647">
<message_arguments>
<message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoWriteLock()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="cdoWriteOption()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="createFeatureMap(EStructuralFeature)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="createMap(EStructuralFeature)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="createUnorderedList(EStructuralFeature)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="dynamicGet(int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="dynamicSet(int, Object)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="dynamicUnset(int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eBasicSetContainer(InternalEObject, int)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eBasicSetContainer(InternalEObject, int, NotificationChain)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eContainerFeatureID()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eDynamicIsSet(int, EStructuralFeature)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eInternalContainer()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eInternalResource()"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
<message_argument value="eIsCaching()"/>
</message_arguments>
</filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eSetDirectResource(Resource.Internal)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eSetResource(Resource.Internal, NotificationChain)"/>
+ </message_arguments>
+ </filter>
+ <filter id="421654647">
+ <message_arguments>
+ <message_argument value="org.eclipse.emf.internal.cdo.CDOObjectImpl"/>
+ <message_argument value="eStore()"/>
+ </message_arguments>
+ </filter>
</resource>
<resource path="src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java" type="org.eclipse.emf.internal.cdo.CDOObjectImpl$CDOStoreEcoreEMap">
<filter id="337686583">
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 6156fa7679..3d5eaff79f 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
@@ -21,7 +21,6 @@ import org.eclipse.emf.cdo.common.lock.CDOLockState;
import org.eclipse.emf.cdo.common.model.CDOModelUtil;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.eresource.impl.CDOResourceImpl;
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;
@@ -41,6 +40,7 @@ import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.notify.Notifier;
+import org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EObservableAdapterList.Listener;
import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.BasicEMap;
import org.eclipse.emf.common.util.EList;
@@ -84,16 +84,18 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
{
public void added(Notifier notifier, Adapter adapter)
{
- ((CDOObjectImpl)notifier).adapterAdded(adapter);
+ CDOObjectImpl object = (CDOObjectImpl)notifier;
+ object.eAdapterAdded(adapter);
}
public void removed(Notifier notifier, Adapter adapter)
{
- ((CDOObjectImpl)notifier).adapterRemoved(adapter);
+ CDOObjectImpl object = (CDOObjectImpl)notifier;
+ object.eAdapterRemoved(adapter);
}
};
- private InternalCDOClassInfo classInfo;
+ private static final EObservableAdapterList.Listener[] ADAPTERS_LISTENERS = { ADAPTERS_LISTENER };
/**
* Optimized storage of {@link CDOObject#cdoView()} and {@link CDOObject#cdoState()}.
@@ -105,8 +107,9 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* Optimized storage of {@link CDOObject#cdoID()} and {@link CDOObject#cdoRevision()}.
* The idea is that, if a revision is set, the object's ID is equal to the {@link CDORevision revision's} ID.
+ * The same is true for the classInfo field.
*/
- private Object idOrRevision;
+ private InternalCDORevision revision;
/**
* Don't use the optional slot in MinimalEObject because a CDOObject always needs eSettings to store:
@@ -126,9 +129,9 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.2
*/
- public InternalCDOClassInfo cdoClassInfo()
+ public final InternalCDOClassInfo cdoClassInfo()
{
- return classInfo;
+ return revision.getClassInfo();
}
public final CDOState cdoState()
@@ -146,17 +149,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
public final CDOID cdoID()
{
- if (idOrRevision == null)
- {
- return null;
- }
-
- if (idOrRevision instanceof CDOID)
- {
- return (CDOID)idOrRevision;
- }
-
- return ((InternalCDORevision)idOrRevision).getID();
+ return revision.getID();
}
/**
@@ -164,20 +157,15 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
*/
public final InternalCDORevision cdoRevision()
{
- if (idOrRevision instanceof InternalCDORevision)
- {
- return (InternalCDORevision)idOrRevision;
- }
-
- return null;
+ return revision.getProperRevision();
}
- public CDOResourceImpl cdoResource()
+ public final CDOResource cdoResource()
{
Resource resource = eResource();
- if (resource instanceof CDOResourceImpl)
+ if (resource instanceof CDOResource)
{
- return (CDOResourceImpl)resource;
+ return (CDOResource)resource;
}
return null;
@@ -186,12 +174,12 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public CDOResourceImpl cdoDirectResource()
+ public final CDOResource cdoDirectResource()
{
Resource.Internal resource = eDirectResource();
- if (resource instanceof CDOResourceImpl)
+ if (resource instanceof CDOResource)
{
- return (CDOResourceImpl)resource;
+ return (CDOResource)resource;
}
return null;
@@ -200,13 +188,13 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 3.0
*/
- public void cdoPrefetch(int depth)
+ public final void cdoPrefetch(int depth)
{
CDOID id = cdoID();
viewAndState.view.prefetchRevisions(id, depth);
}
- public void cdoReload()
+ public final void cdoReload()
{
CDOStateMachine.INSTANCE.reload(this);
}
@@ -214,7 +202,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.2
*/
- public CDOObjectHistory cdoHistory()
+ public final CDOObjectHistory cdoHistory()
{
return viewAndState.view.getHistory(this);
}
@@ -222,7 +210,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public boolean cdoConflict()
+ public final boolean cdoConflict()
{
return FSMUtil.isConflict(this);
}
@@ -230,7 +218,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public boolean cdoInvalid()
+ public final boolean cdoInvalid()
{
return FSMUtil.isInvalid(this);
}
@@ -238,7 +226,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public CDOLock cdoReadLock()
+ public final CDOLock cdoReadLock()
{
return createLock(this, LockType.READ);
}
@@ -246,7 +234,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public CDOLock cdoWriteLock()
+ public final CDOLock cdoWriteLock()
{
return createLock(this, LockType.WRITE);
}
@@ -254,7 +242,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.1
*/
- public CDOLock cdoWriteOption()
+ public final CDOLock cdoWriteOption()
{
return createLock(this, LockType.OPTION);
}
@@ -262,12 +250,12 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.1
*/
- public CDOLockState cdoLockState()
+ public final CDOLockState cdoLockState()
{
return getLockState(this);
}
- public CDOState cdoInternalSetState(CDOState state)
+ public final CDOState cdoInternalSetState(CDOState state)
{
CDOState oldState = viewAndState.state;
if (oldState != state)
@@ -292,7 +280,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public void cdoInternalSetView(CDOView view)
+ public final void cdoInternalSetView(CDOView view)
{
InternalCDOView newView = (InternalCDOView)view;
if (newView != null)
@@ -305,23 +293,27 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
}
- public void cdoInternalSetID(CDOID id)
+ public final void cdoInternalSetID(CDOID id)
{
if (TRACER.isEnabled())
{
TRACER.format("Setting ID: {0}", id); //$NON-NLS-1$
}
- if (idOrRevision == null || id == null)
+ if (id == null)
+ {
+ revision = cdoClassInfo().getRevisionForID(null);
+ }
+ else
{
- idOrRevision = id;
+ revision = revision.getRevisionForID(id);
}
}
/**
* @since 2.0
*/
- public void cdoInternalSetRevision(CDORevision revision)
+ public final void cdoInternalSetRevision(CDORevision revision)
{
if (TRACER.isEnabled())
{
@@ -330,15 +322,17 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
if (revision == null)
{
- idOrRevision = cdoID();
+ InternalCDOClassInfo classInfo = cdoClassInfo();
+ CDOID id = this.revision.getID();
+ this.revision = classInfo.getRevisionForID(id);
}
else
{
- idOrRevision = revision;
+ this.revision = (InternalCDORevision)revision;
}
}
- public void cdoInternalSetResource(CDOResource resource)
+ public final void cdoInternalSetResource(CDOResource resource)
{
// Unsets direct resource and/or eContainer.
// Only intended to be called by CDOTransactionImpl.removeObject(CDOID, CDOObject).
@@ -363,15 +357,15 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
// Do nothing
}
- public void cdoInternalPostLoad()
+ 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.
- EClass eClass = eClass();
- int featureCount = eClass.getFeatureCount();
+ InternalCDOClassInfo classInfo = cdoClassInfo();
+ int featureCount = classInfo.getEClass().getFeatureCount();
for (int i = 0; i < featureCount; i++)
{
// We need to keep the existing list if possible.
@@ -391,12 +385,12 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 2.0
*/
- public void cdoInternalPostInvalidate()
+ public final void cdoInternalPostInvalidate()
{
// Do nothing
}
- public void cdoInternalPostAttach()
+ public final void cdoInternalPostAttach()
{
if (TRACER.isEnabled())
{
@@ -419,6 +413,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
if (eSettings != null)
{
+ InternalCDOClassInfo classInfo = cdoClassInfo();
EStructuralFeature[] allPersistentFeatures = classInfo.getAllPersistentFeatures();
int length = allPersistentFeatures.length;
for (int i = 0; i < length; i++)
@@ -461,6 +456,8 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
TRACER.format("Depopulating revision for {0}", this); //$NON-NLS-1$
}
+ InternalCDOClassInfo classInfo = cdoClassInfo();
+
CDOStore store = cdoStore();
super.eSetDirectResource((Resource.Internal)store.getResource(this));
eBasicSetContainer(store.getContainer(this));
@@ -488,23 +485,23 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 3.0
*/
- public void cdoInternalPostRollback()
+ public final void cdoInternalPostRollback()
{
// Do nothing
}
- public void cdoInternalPreCommit()
+ public final void cdoInternalPreCommit()
{
// Do nothing
}
- public InternalEObject cdoInternalInstance()
+ public final InternalEObject cdoInternalInstance()
{
return this;
}
@Deprecated
- public EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID)
+ public final EStructuralFeature cdoInternalDynamicFeature(int dynamicFeatureID)
{
throw new UnsupportedOperationException();
}
@@ -518,7 +515,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @since 2.0
*/
@Override
- public EStore eStore()
+ public final EStore eStore()
{
if (FSMUtil.isTransient(this))
{
@@ -543,7 +540,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
@Override
public final EClass eClass()
{
- return classInfo.getEClass();
+ return revision.getEClass();
}
@Override
@@ -567,7 +564,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- public Resource.Internal eInternalResource()
+ public final Resource.Internal eInternalResource()
{
if (FSMUtil.isInvalid(this))
{
@@ -578,8 +575,9 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- public Object dynamicGet(int dynamicFeatureID)
+ public final Object dynamicGet(int dynamicFeatureID)
{
+ InternalCDOClassInfo classInfo = cdoClassInfo();
int index = classInfo.getSettingsFeatureIndex(dynamicFeatureID);
if (index == InternalCDOClassInfo.NO_SLOT)
{
@@ -613,8 +611,9 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- public void dynamicSet(int dynamicFeatureID, Object value)
+ public final void dynamicSet(int dynamicFeatureID, Object value)
{
+ InternalCDOClassInfo classInfo = cdoClassInfo();
int index = classInfo.getSettingsFeatureIndex(dynamicFeatureID);
if (index == InternalCDOClassInfo.NO_SLOT)
{
@@ -632,8 +631,9 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- public void dynamicUnset(int dynamicFeatureID)
+ public final void dynamicUnset(int dynamicFeatureID)
{
+ InternalCDOClassInfo classInfo = cdoClassInfo();
int index = classInfo.getSettingsFeatureIndex(dynamicFeatureID);
if (index == InternalCDOClassInfo.NO_SLOT)
{
@@ -669,8 +669,28 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
}
+ /**
+ * @since 2.0
+ */
+ @Override
+ protected final boolean eDynamicIsSet(int dynamicFeatureID, EStructuralFeature eFeature)
+ {
+ if (dynamicFeatureID < 0)
+ {
+ return eOpenIsSet(eFeature);
+ }
+
+ InternalCDOClassInfo classInfo = cdoClassInfo();
+ if (classInfo.isPersistent(dynamicFeatureID))
+ {
+ return eStore().isSet(this, eFeature);
+ }
+
+ return eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), dynamicFeatureID);
+ }
+
@Override
- public InternalEObject eInternalContainer()
+ public final InternalEObject eInternalContainer()
{
if (FSMUtil.isTransient(this))
{
@@ -681,7 +701,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- public int eContainerFeatureID()
+ public final int eContainerFeatureID()
{
if (FSMUtil.isTransient(this))
{
@@ -699,7 +719,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @since 2.0
*/
@Override
- public NotificationChain eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID,
+ public final NotificationChain eBasicSetContainer(InternalEObject newContainer, int newContainerFeatureID,
NotificationChain msgs)
{
boolean isResourceRoot = this instanceof CDOResource && ((CDOResource)this).isRoot();
@@ -792,7 +812,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @since 2.0
*/
@Override
- public NotificationChain eSetResource(Resource.Internal resource, NotificationChain notifications)
+ public final NotificationChain eSetResource(Resource.Internal resource, NotificationChain notifications)
{
Resource.Internal oldResource = eDirectResource();
@@ -855,15 +875,15 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- protected void eSetDirectResource(Internal resource)
+ protected final void eSetDirectResource(Internal resource)
{
if (FSMUtil.isTransient(this))
{
super.eSetDirectResource(resource);
}
- else if (resource instanceof CDOResourceImpl || resource == null)
+ else if (resource == null || resource instanceof CDOResource)
{
- cdoStore().setContainer(this, (CDOResourceImpl)resource, eInternalContainer(), eContainerFeatureID());
+ cdoStore().setContainer(this, (CDOResource)resource, eInternalContainer(), eContainerFeatureID());
}
else
{
@@ -871,27 +891,8 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
}
- /**
- * @since 2.0
- */
- @Override
- protected boolean eDynamicIsSet(int dynamicFeatureID, EStructuralFeature eFeature)
- {
- if (dynamicFeatureID < 0)
- {
- return eOpenIsSet(eFeature);
- }
-
- if (classInfo.isPersistent(dynamicFeatureID))
- {
- return eStore().isSet(this, eFeature);
- }
-
- return eSettingDelegate(eFeature).dynamicIsSet(this, eSettings(), dynamicFeatureID);
- }
-
@Override
- protected void eBasicSetContainer(InternalEObject newEContainer, int newContainerFeatureID)
+ protected final void eBasicSetContainer(InternalEObject newEContainer, int newContainerFeatureID)
{
if (TRACER.isEnabled())
{
@@ -910,7 +911,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- protected int eDynamicFeatureID(EStructuralFeature eStructuralFeature)
+ protected final int eDynamicFeatureID(EStructuralFeature eStructuralFeature)
{
// CDOObjectImpl has no static features, so don't subract their count here:
EClass eClass = eClass();
@@ -918,7 +919,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- protected EStructuralFeature eDynamicFeature(int dynamicFeatureID)
+ protected final EStructuralFeature eDynamicFeature(int dynamicFeatureID)
{
// CDOObjectImpl has no static features, so don't add their count here:
EClass eClass = eClass();
@@ -926,10 +927,11 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- protected DynamicValueHolder eSettings()
+ protected final DynamicValueHolder eSettings()
{
if (!eHasSettings())
{
+ InternalCDOClassInfo classInfo = cdoClassInfo();
int size = classInfo.getSettingsFeatureCount();
if (FSMUtil.isTransient(this))
{
@@ -972,42 +974,70 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
return false;
}
+ /**
+ * This method is not called by the MinimalEStoreEObjectImpl in CDO's ecore.minimal (retrofitting) fragment
+ * but it is called by the normal MinimalEObjectImpl as of EMF 2.9.
+ *
+ * @since 4.2
+ */
@Override
- protected void eBasicSetAdapterArray(Adapter[] adapters)
+ protected final Listener[] eBasicAdapterListeners()
{
- Adapter[] oldAdapters = eBasicAdapterArray();
- if (ObjectUtil.isEmpty(adapters))
+ Listener[] listeners = super.eBasicAdapterListeners();
+ if (listeners == null)
{
- adapters = null;// Optimize possibly empty array
- if (oldAdapters != null) // Can't be empty array because of the optimization above
- {
- ((EObservableAdapterList)eAdapters()).removeListener(ADAPTERS_LISTENER);
- }
+ return ADAPTERS_LISTENERS;
}
- else
+
+ return listeners;
+ }
+
+ /**
+ * This method is not called by the MinimalEStoreEObjectImpl in CDO's ecore.minimal (retrofitting) fragment
+ * but it is called by the normal MinimalEObjectImpl as of EMF 2.9.
+ *
+ * @since 4.2
+ */
+ @Override
+ protected final void eBasicSetAdapterListeners(Listener[] eAdapterListeners)
+ {
+ if (eAdapterListeners != null)
{
- if (oldAdapters == null) // Can't be empty array because of the optimization above
+ if (eAdapterListeners.length == 1)
{
- ((EObservableAdapterList)eAdapters()).addListener(ADAPTERS_LISTENER);
+ // Because noone else can remove ADAPTERS_LISTENER this must be it
+ eAdapterListeners = null;
}
}
- super.eBasicSetAdapterArray(adapters);
+ super.eBasicSetAdapterListeners(eAdapterListeners);
}
- private void adapterAdded(Adapter newAdapter)
+ /**
+ * This method must not be private because the MinimalEStoreEObjectImpl in CDO's ecore.minimal (retrofitting) fragment
+ * introduces it as a protected method and calls it.
+ *
+ * @since 4.2
+ */
+ protected final void eAdapterAdded(Adapter adapter)
{
- if (!FSMUtil.isTransient(CDOObjectImpl.this))
+ if (!FSMUtil.isTransient(this))
{
- viewAndState.view.handleAddAdapter(CDOObjectImpl.this, newAdapter);
+ viewAndState.view.handleAddAdapter(this, adapter);
}
}
- private void adapterRemoved(Adapter oldAdapter)
+ /**
+ * This method must not be private because the MinimalEStoreEObjectImpl in CDO's ecore.minimal (retrofitting) fragment
+ * introduces it as a protected method and calls it.
+ *
+ * @since 4.2
+ */
+ protected final void eAdapterRemoved(Adapter adapter)
{
- if (!FSMUtil.isTransient(CDOObjectImpl.this))
+ if (!FSMUtil.isTransient(this))
{
- viewAndState.view.handleRemoveAdapter(CDOObjectImpl.this, oldAdapter);
+ viewAndState.view.handleRemoveAdapter(this, adapter);
}
}
@@ -1045,7 +1075,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
}
@Override
- protected FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
+ protected final FeatureMap createFeatureMap(EStructuralFeature eStructuralFeature)
{
return new CDOStoreFeatureMap(eStructuralFeature);
}
@@ -1053,7 +1083,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.1
*/
- protected CDOStoreEcoreEMap createMap(EStructuralFeature eStructuralFeature)
+ protected final CDOStoreEcoreEMap createMap(EStructuralFeature eStructuralFeature)
{
return new CDOStoreEcoreEMap(eStructuralFeature);
}
@@ -1061,7 +1091,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
/**
* @since 4.1
*/
- protected CDOStoreUnorderedEList<Object> createUnorderedList(EStructuralFeature eStructuralFeature)
+ protected final CDOStoreUnorderedEList<Object> createUnorderedList(EStructuralFeature eStructuralFeature)
{
return new CDOStoreUnorderedEList<Object>(eStructuralFeature);
}
@@ -1091,7 +1121,8 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
private void initClassInfo(EClass eClass)
{
- classInfo = (InternalCDOClassInfo)CDOModelUtil.getClassInfo(eClass);
+ InternalCDOClassInfo classInfo = (InternalCDOClassInfo)CDOModelUtil.getClassInfo(eClass);
+ revision = classInfo.getRevisionForID(null);
}
/**
@@ -1272,7 +1303,7 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
* @author Simon McDuff
* @since 2.0
*/
- private static class TransientStore implements InternalEObject.EStore
+ private static final class TransientStore implements InternalEObject.EStore
{
public static TransientStore INSTANCE = new TransientStore();
@@ -1319,7 +1350,8 @@ public class CDOObjectImpl extends MinimalEStoreEObjectImpl implements InternalC
private int getTransientFeatureIndex(InternalEObject eObject, EStructuralFeature feature)
{
CDOObjectImpl object = (CDOObjectImpl)eObject;
- return object.classInfo.getTransientFeatureIndex(feature);
+ InternalCDOClassInfo classInfo = object.cdoClassInfo();
+ return classInfo.getTransientFeatureIndex(feature);
}
public Object get(InternalEObject eObject, EStructuralFeature feature, int index)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
index 241814e843..131bb9c909 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java
@@ -588,7 +588,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
InternalCDOObject object = newInstance(revision.getEClass());
object.cdoInternalSetView(this);
object.cdoInternalSetRevision(revision);
- object.cdoInternalSetID(id);
object.cdoInternalSetState(CDOState.NEW);
object.cdoInternalPostLoad();
@@ -1239,9 +1238,8 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
});
}
- internal.cdoInternalSetID(null);
- internal.cdoInternalSetRevision(null);
internal.cdoInternalSetView(null);
+ internal.cdoInternalSetID(null);
}
private Set<CDOID> rollbackCompletely(CDOUserSavepoint savepoint)
@@ -1385,7 +1383,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
{
object.cdoInternalSetRevision(revision.copy());
object.cdoInternalSetView(this);
- object.cdoInternalSetID(revision.getID());
object.cdoInternalSetState(CDOState.NEW);
// Load the object from revision to EObject
@@ -2142,7 +2139,6 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private InternalCDOObject newInstance(InternalCDORevision revision)
{
InternalCDOObject object = newInstance(revision.getEClass());
- object.cdoInternalSetID(revision.getID());
object.cdoInternalSetRevision(revision);
object.cdoInternalSetState(CDOState.NEW);
object.cdoInternalSetView(this);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
index 58a6bc13ba..8ce98ab55a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
@@ -1095,7 +1095,6 @@ public abstract class AbstractCDOView extends CDOCommitHistoryProviderImpl<CDOOb
{
object.cdoInternalSetView(this);
object.cdoInternalSetRevision(revision);
- object.cdoInternalSetID(revision.getID());
object.cdoInternalSetState(CDOState.CLEAN);
object.cdoInternalPostLoad();
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
index e132e40dff..1589902ccc 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOStateMachine.java
@@ -298,7 +298,6 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
content.cdoInternalSetView(null);
content.cdoInternalSetID(null);
- content.cdoInternalSetRevision(null);
}
}
}
@@ -526,7 +525,6 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
savepoint = savepoint.getNextSavepoint();
}
- object.cdoInternalSetID(id);
object.cdoInternalSetView(transaction);
// Construct a new revision
@@ -616,7 +614,6 @@ public final class CDOStateMachine extends FiniteStateMachine<CDOState, CDOEvent
{
// Prepare object
CDOID id = transaction.createIDForNewObject(object.cdoInternalInstance());
- object.cdoInternalSetID(id);
object.cdoInternalSetView(transaction);
changeState(object, CDOState.PREPARED);

Back to the top