Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2020-04-11 06:14:52 +0000
committerEike Stepper2020-04-11 06:14:52 +0000
commita15e3037b02b0066d7dfe47e52430249bce07448 (patch)
tree9d426b0a21cb329eb20258cf369de420fba5f870 /plugins/org.eclipse.emf.cdo.common
parent595f4da41f3e034916d3071ffd88d66ed59ad288 (diff)
downloadcdo-a15e3037b02b0066d7dfe47e52430249bce07448.tar.gz
cdo-a15e3037b02b0066d7dfe47e52430249bce07448.tar.xz
cdo-a15e3037b02b0066d7dfe47e52430249bce07448.zip
[562011] Remove deprecated support for FeatureMaps
https://bugs.eclipse.org/bugs/show_bug.cgi?id=562011
Diffstat (limited to 'plugins/org.eclipse.emf.cdo.common')
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java24
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java13
-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/common/model/CDOModelUtil.java61
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java4
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java22
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOClassInfoImpl.java15
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java47
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOFeatureMapEntryImpl.java67
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java3
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java21
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java74
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java37
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java23
-rw-r--r--plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java5
16 files changed, 123 insertions, 313 deletions
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
index 4144c518ef..af666f1ca7 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOIDReference.java
@@ -14,6 +14,7 @@ import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.ecore.EClass;
+import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
import java.io.IOException;
@@ -32,15 +33,15 @@ public class CDOIDReference implements CDOReference<CDOID>
private CDOID sourceID;
- private EStructuralFeature sourceFeature;
+ private EReference sourceReference;
private int sourceIndex;
- public CDOIDReference(CDOID targetID, CDOID sourceID, EStructuralFeature sourceFeature, int sourceIndex)
+ public CDOIDReference(CDOID targetID, CDOID sourceID, EStructuralFeature sourceReference, int sourceIndex)
{
this.targetID = targetID;
this.sourceID = sourceID;
- this.sourceFeature = sourceFeature;
+ this.sourceReference = (EReference)sourceReference;
this.sourceIndex = sourceIndex;
}
@@ -51,7 +52,7 @@ public class CDOIDReference implements CDOReference<CDOID>
EClass eClass = (EClass)in.readCDOClassifierRefAndResolve();
String featureName = in.readString();
- sourceFeature = eClass.getEStructuralFeature(featureName);
+ sourceReference = (EReference)eClass.getEStructuralFeature(featureName);
sourceIndex = in.readXInt();
}
@@ -60,8 +61,8 @@ public class CDOIDReference implements CDOReference<CDOID>
{
out.writeCDOID(targetID);
out.writeCDOID(sourceID);
- out.writeCDOClassifierRef(sourceFeature.getEContainingClass());
- out.writeString(sourceFeature.getName());
+ out.writeCDOClassifierRef(sourceReference.getEContainingClass());
+ out.writeString(sourceReference.getName());
out.writeXInt(sourceIndex);
}
@@ -77,10 +78,17 @@ public class CDOIDReference implements CDOReference<CDOID>
return sourceID;
}
+ @Deprecated
@Override
public EStructuralFeature getSourceFeature()
{
- return sourceFeature;
+ return sourceReference;
+ }
+
+ @Override
+ public EReference getSourceReference()
+ {
+ return sourceReference;
}
@Override
@@ -95,7 +103,7 @@ public class CDOIDReference implements CDOReference<CDOID>
StringBuilder builder = new StringBuilder();
builder.append(sourceID);
builder.append(".");
- builder.append(sourceFeature.getName());
+ builder.append(sourceReference.getName());
if (sourceIndex != NO_INDEX)
{
builder.append("[");
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
index 977052f3b1..a76713dc06 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/id/CDOReference.java
@@ -11,10 +11,8 @@
package org.eclipse.emf.cdo.common.id;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
/**
* Represents a reference from one object to another object, possibly {@link CDOID} or CDOObject typed.
@@ -33,10 +31,17 @@ public interface CDOReference<OBJECT>
public OBJECT getSourceObject();
/**
- * Returns the source {@link EReference} or the source {@link EAttribute} if the source feature is a
- * {@link FeatureMap}.
+ * Returns the source {@link EReference}.
+ * @deprecated As of 4.10 use {@link #getSourceReference()}.
*/
+ @Deprecated
public EStructuralFeature getSourceFeature();
+ /**
+ * Returns the source {@link EReference}.
+ * @since 4.10
+ */
+ public EReference getSourceReference();
+
public int getSourceIndex();
}
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 9bbad98b40..ace54e4779 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
@@ -50,6 +50,11 @@ public interface CDOClassInfo extends Adapter
*/
public boolean hasPersistentOpposite(EStructuralFeature feature);
+ /**
+ * @since 4.10
+ */
+ public boolean hasPersistentFeatureMaps();
+
public EStructuralFeature[] getAllPersistentFeatures();
/**
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
index d075cb76a2..a8ee048496 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOModelUtil.java
@@ -15,6 +15,7 @@ package org.eclipse.emf.cdo.common.model;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.revision.CDORevision;
+import org.eclipse.emf.cdo.common.util.CDOException;
import org.eclipse.emf.cdo.internal.common.bundle.OM;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
import org.eclipse.emf.cdo.internal.common.model.CDOClassInfoImpl;
@@ -22,6 +23,7 @@ import org.eclipse.emf.cdo.internal.common.model.CDOPackageInfoImpl;
import org.eclipse.emf.cdo.internal.common.model.CDOPackageRegistryImpl;
import org.eclipse.emf.cdo.internal.common.model.CDOPackageUnitImpl;
import org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl;
+import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageUnit;
import org.eclipse.net4j.util.io.ExtendedDataInput;
import org.eclipse.net4j.util.io.ExtendedDataOutput;
@@ -44,7 +46,6 @@ import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
@@ -288,11 +289,6 @@ public final class CDOModelUtil implements CDOModelConstants
*/
public static CDOType getType(EStructuralFeature feature)
{
- if (FeatureMapUtil.isFeatureMap(feature))
- {
- return CDOType.FEATURE_MAP_ENTRY;
- }
-
return getType(feature.getEType());
}
@@ -524,11 +520,6 @@ public final class CDOModelUtil implements CDOModelConstants
return CDOType.BIG_INTEGER;
}
- if (object instanceof FeatureMap.Entry)
- {
- return CDOType.FEATURE_MAP_ENTRY;
- }
-
if (object instanceof Throwable)
{
return CDOType.EXCEPTION;
@@ -726,6 +717,54 @@ public final class CDOModelUtil implements CDOModelConstants
}
/**
+ * @since 4.10
+ */
+ public static void checkNoFeatureMaps(StringBuilder builder, EPackage ePackage, boolean checkFeatureMapEntries)
+ {
+ for (TreeIterator<EObject> it = ePackage.eAllContents(); it.hasNext();)
+ {
+ EObject packageElement = it.next();
+ if (checkFeatureMapEntries && packageElement instanceof EClassifier)
+ {
+ EClassifier classifier = (EClassifier)packageElement;
+ if (FeatureMapUtil.isFeatureMapEntry(classifier))
+ {
+ builder.append(String.format("Package '%s' contains feature map entry '%s'", ePackage.getNsURI(), classifier.getName()));
+ builder.append("\n");
+ }
+ }
+ else if (packageElement instanceof EStructuralFeature)
+ {
+ EStructuralFeature feature = (EStructuralFeature)packageElement;
+ if (FeatureMapUtil.isFeatureMap(feature))
+ {
+ EClass eClass = feature.getEContainingClass();
+ builder.append(String.format("Package '%s' contains feature map '%s.%s'", ePackage.getNsURI(), eClass.getName(), feature.getName()));
+ builder.append("\n");
+ }
+ }
+ }
+ }
+
+ /**
+ * @since 4.10
+ */
+ public static void checkNoFeatureMaps(InternalCDOPackageUnit[] packageUnits, boolean checkFeatureMapEntries) throws CDOException
+ {
+ StringBuilder builder = new StringBuilder();
+ for (InternalCDOPackageUnit packageUnit : packageUnits)
+ {
+ EPackage ePackage = packageUnit.getTopLevelPackageInfo().getEPackage();
+ checkNoFeatureMaps(builder, ePackage, checkFeatureMapEntries);
+ }
+
+ if (builder.length() != 0)
+ {
+ throw new CDOException(builder.toString());
+ }
+ }
+
+ /**
* @since 4.0
*/
public static Map<EClass, List<EClass>> getSubTypes(EPackage.Registry packageRegistry)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java
index a7fa69ffc5..66c4a34718 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/CDOType.java
@@ -133,8 +133,10 @@ public interface CDOType
/**
* @since 2.0
+ * @deprecated As of 4.5 {@link org.eclipse.emf.ecore.util.FeatureMap feature maps} are no longer supported.
*/
- public static final CDOType FEATURE_MAP_ENTRY = org.eclipse.emf.cdo.internal.common.model.CDOTypeImpl.FEATURE_MAP_ENTRY;
+ @Deprecated
+ public static final CDOType FEATURE_MAP_ENTRY = null;
/**
* @since 4.3
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
index dea292b4ee..31fb13e60d 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/model/EMFUtil.java
@@ -40,7 +40,6 @@ import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.FeatureMap;
import org.eclipse.emf.ecore.xmi.impl.EcoreResourceFactoryImpl;
import java.io.ByteArrayInputStream;
@@ -242,26 +241,7 @@ public final class EMFUtil
builder.append('@');
builder.append(eStructuralFeature.getName());
- if (eStructuralFeature instanceof EAttribute)
- {
- FeatureMap featureMap = (FeatureMap)container.eGet(eStructuralFeature, false);
- for (int i = 0, size = featureMap.size(); i < size; ++i)
- {
- if (featureMap.getValue(i) == eObject)
- {
- EStructuralFeature entryFeature = featureMap.getEStructuralFeature(i);
- if (entryFeature instanceof EReference && ((EReference)entryFeature).isContainment())
- {
- builder.append('.');
- builder.append(i);
- return builder.toString();
- }
- }
- }
-
- builder.append(".-1");
- }
- else if (eStructuralFeature.isMany())
+ if (eStructuralFeature.isMany())
{
EList<?> eList = (EList<?>)container.eGet(eStructuralFeature, false);
int index = eList.indexOf(eObject);
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
index 523cd380fd..f9bfd55125 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/common/revision/CDORevisionUtil.java
@@ -28,7 +28,6 @@ import org.eclipse.emf.cdo.common.util.CDOCommonUtil;
import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetDataImpl;
import org.eclipse.emf.cdo.internal.common.commit.CDOChangeSetImpl;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
-import org.eclipse.emf.cdo.internal.common.revision.CDOFeatureMapEntryImpl;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisableImpl;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheAuditing;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionCacheBranching;
@@ -37,7 +36,6 @@ import org.eclipse.emf.cdo.internal.common.revision.CDORevisionImpl;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionKeyImpl;
import org.eclipse.emf.cdo.internal.common.revision.CDORevisionManagerImpl;
import org.eclipse.emf.cdo.internal.common.revision.delta.CDORevisionDeltaImpl;
-import org.eclipse.emf.cdo.spi.common.revision.CDOFeatureMapEntry;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevision;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionDelta;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDORevisionManager;
@@ -46,7 +44,6 @@ import org.eclipse.emf.cdo.spi.common.revision.ManagedRevisionProvider;
import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
import java.io.ByteArrayOutputStream;
import java.io.PrintStream;
@@ -192,18 +189,22 @@ public final class CDORevisionUtil
/**
* @since 2.0
+ * @deprecated As of 4.5 {@link org.eclipse.emf.ecore.util.FeatureMap feature maps} are no longer supported.
*/
- public static FeatureMap.Entry createFeatureMapEntry(EStructuralFeature feature, Object value)
+ @Deprecated
+ public static org.eclipse.emf.ecore.util.FeatureMap.Entry createFeatureMapEntry(EStructuralFeature feature, Object value)
{
- return new CDOFeatureMapEntryImpl(feature, value);
+ throw new UnsupportedOperationException();
}
/**
* @since 3.0
+ * @deprecated As of 4.5 {@link org.eclipse.emf.ecore.util.FeatureMap feature maps} are no longer supported.
*/
- public static CDOFeatureMapEntry createCDOFeatureMapEntry()
+ @Deprecated
+ public static org.eclipse.emf.cdo.spi.common.revision.CDOFeatureMapEntry createCDOFeatureMapEntry()
{
- return new CDOFeatureMapEntryImpl();
+ throw new UnsupportedOperationException();
}
/**
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 f5b44b4037..9c8db801bb 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
@@ -57,6 +57,8 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
private EClass eClass;
+ private boolean hasPersistentFeatureMaps;
+
private final BitSet persistentBits = new BitSet();
private final BitSet persistentOppositeBits = new BitSet();
@@ -181,6 +183,12 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
}
@Override
+ public boolean hasPersistentFeatureMaps()
+ {
+ return hasPersistentFeatureMaps;
+ }
+
+ @Override
public EStructuralFeature[] getAllPersistentFeatures()
{
return allPersistentFeatures;
@@ -336,7 +344,12 @@ public final class CDOClassInfoImpl implements InternalCDOClassInfo, Adapter.Int
persistentMapFeatures.add(feature);
}
- if (feature.isMany() || FeatureMapUtil.isFeatureMap(feature))
+ if (FeatureMapUtil.isFeatureMap(feature))
+ {
+ hasPersistentFeatureMaps = true;
+ }
+
+ if (feature.isMany())
{
settingsFeatureIndices[i] = settingsFeatureCount++;
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
index 7f68ebfd8f..b471c6a17c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/model/CDOTypeImpl.java
@@ -23,7 +23,6 @@ import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.revision.CDORevision;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
-import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.internal.common.messages.Messages;
import org.eclipse.emf.cdo.spi.common.model.InternalCDOPackageRegistry;
import org.eclipse.emf.cdo.spi.common.revision.CDOReferenceAdjuster;
@@ -38,7 +37,6 @@ import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EStructuralFeature.Internal.DynamicValueHolder;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.util.EcoreUtil;
-import org.eclipse.emf.ecore.util.FeatureMap;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
@@ -470,51 +468,6 @@ public abstract class CDOTypeImpl implements CDOType
}
};
- public static final CDOType FEATURE_MAP_ENTRY = new CDOTypeImpl("FEATURE_MAP_ENTRY", EcorePackage.EFEATURE_MAP_ENTRY, //$NON-NLS-1$
- false)
- {
- @Override
- protected FeatureMap.Entry doCopyValue(Object value)
- {
- FeatureMap.Entry entry = (FeatureMap.Entry)value;
- EStructuralFeature innerFeature = entry.getEStructuralFeature();
- Object innerValue = entry.getValue();
- CDOType innerType = CDOModelUtil.getType(innerFeature.getEType());
-
- Object innerCopy = innerType.copyValue(innerValue);
- return CDORevisionUtil.createFeatureMapEntry(innerFeature, innerCopy);
- }
-
- @Override
- public void writeValue(CDODataOutput out, Object value) throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public FeatureMap.Entry readValue(CDODataInput in) throws IOException
- {
- throw new UnsupportedOperationException();
- }
-
- @Override
- public Object doAdjustReferences(CDOReferenceAdjuster adjuster, Object value, EStructuralFeature feature, int index)
- {
- FeatureMap.Entry entry = (FeatureMap.Entry)value;
- EStructuralFeature innerFeature = entry.getEStructuralFeature();
- Object innerValue = entry.getValue();
- CDOType innerType = CDOModelUtil.getType(innerFeature.getEType());
-
- Object innerCopy = innerType.adjustReferences(adjuster, innerValue, feature, index);
- if (innerCopy != innerValue) // Just an optimization for NOOP adjusters
- {
- value = CDORevisionUtil.createFeatureMapEntry(innerFeature, innerCopy);
- }
-
- return value;
- }
- };
-
public static final CDOType JAVA_CLASS = new ObjectType("JAVA_CLASS", EcorePackage.EJAVA_CLASS) //$NON-NLS-1$
{
@Override
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOFeatureMapEntryImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOFeatureMapEntryImpl.java
deleted file mode 100644
index 4cbcadd06d..0000000000
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/CDOFeatureMapEntryImpl.java
+++ /dev/null
@@ -1,67 +0,0 @@
-/*
- * Copyright (c) 2009, 2011, 2012, 2019 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:
- * Eike Stepper - initial API and implementation
- */
-package org.eclipse.emf.cdo.internal.common.revision;
-
-import org.eclipse.emf.cdo.spi.common.revision.CDOFeatureMapEntry;
-
-import org.eclipse.emf.ecore.EStructuralFeature;
-
-import java.text.MessageFormat;
-
-/**
- * @author Eike Stepper
- */
-public class CDOFeatureMapEntryImpl implements CDOFeatureMapEntry
-{
- private EStructuralFeature feature;
-
- private Object value;
-
- public CDOFeatureMapEntryImpl()
- {
- }
-
- public CDOFeatureMapEntryImpl(EStructuralFeature feature, Object value)
- {
- this.feature = feature;
- this.value = value;
- }
-
- @Override
- public EStructuralFeature getEStructuralFeature()
- {
- return feature;
- }
-
- @Override
- public void setEStructuralFeature(EStructuralFeature feature)
- {
- this.feature = feature;
- }
-
- @Override
- public Object getValue()
- {
- return value;
- }
-
- @Override
- public void setValue(Object value)
- {
- this.value = value;
- }
-
- @Override
- public String toString()
- {
- return MessageFormat.format("CDOFeatureMapEntry({0}, {1})", feature.getName(), value); //$NON-NLS-1$
- }
-}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java
index 39cf6e0b9a..8bd93805d1 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOListFeatureDeltaImpl.java
@@ -31,7 +31,6 @@ import org.eclipse.net4j.util.collection.Pair;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
import java.lang.reflect.Array;
@@ -233,7 +232,7 @@ public class CDOListFeatureDeltaImpl extends CDOFeatureDeltaImpl implements CDOL
{
case REMOVE:
{
- if (feature instanceof EReference || FeatureMapUtil.isFeatureMap(feature))
+ if (feature instanceof EReference)
{
Boolean result = cleanupWithNewRemoveDelta((CDORemoveFeatureDelta)featureDelta);
if (result != null)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
index 9a4c8ef6a1..871e5e3b5c 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/internal/common/revision/delta/CDOSingleValueFeatureDeltaImpl.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.protocol.CDODataInput;
import org.eclipse.emf.cdo.common.protocol.CDODataOutput;
import org.eclipse.emf.cdo.common.revision.CDORevisionData;
-import org.eclipse.emf.cdo.common.revision.CDORevisionUtil;
import org.eclipse.emf.cdo.spi.common.revision.CDOReferenceAdjuster;
import org.eclipse.emf.cdo.spi.common.revision.InternalCDOFeatureDelta.WithIndex;
@@ -25,8 +24,6 @@ import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
import java.text.MessageFormat;
@@ -76,16 +73,6 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl
}
EStructuralFeature feature = getFeature();
- if (FeatureMapUtil.isFeatureMap(feature))
- {
- FeatureMap.Entry entry = (FeatureMap.Entry)valueToWrite;
- feature = entry.getEStructuralFeature();
- valueToWrite = entry.getValue();
-
- int featureID = eClass.getFeatureID(feature);
- out.writeXInt(featureID);
- }
-
if (valueToWrite != null && valueToWrite != CDORevisionData.NIL && feature instanceof EReference)
{
valueToWrite = out.getIDProvider().provideCDOID(value);
@@ -97,14 +84,6 @@ public abstract class CDOSingleValueFeatureDeltaImpl extends CDOFeatureDeltaImpl
protected Object readValue(CDODataInput in, EClass eClass) throws IOException
{
EStructuralFeature feature = getFeature();
- if (FeatureMapUtil.isFeatureMap(feature))
- {
- int featureID = in.readXInt();
- feature = eClass.getEStructuralFeature(featureID);
- Object innerValue = in.readCDOFeatureValue(feature);
- return CDORevisionUtil.createFeatureMapEntry(feature, innerValue);
- }
-
return in.readCDOFeatureValue(feature);
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java
index 3bd52a7036..51160f3cbc 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataInputImpl.java
@@ -86,18 +86,12 @@ import org.eclipse.net4j.util.io.ExtendedDataInput;
import org.eclipse.net4j.util.io.StringIO;
import org.eclipse.net4j.util.om.trace.ContextTracer;
-import org.eclipse.emf.ecore.EAttribute;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
-import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.EcoreFactory;
-import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
-import org.eclipse.emf.ecore.xml.type.XMLTypePackage;
import java.io.IOException;
import java.text.MessageFormat;
@@ -532,13 +526,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
}
}
- Object value = null;
- CDOType type = null;
- boolean isFeatureMap = FeatureMapUtil.isFeatureMap(feature);
- if (!isFeatureMap)
- {
- type = CDOModelUtil.getType(feature.getEType());
- }
+ CDOType type = CDOModelUtil.getType(feature.getEType());
InternalCDOList list = (InternalCDOList)getListFactory().createList(size, size, referenceChunk);
if (feature instanceof EReference && list instanceof ConfigurableEquality)
@@ -548,64 +536,9 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
for (int j = 0; j < referenceChunk; j++)
{
- if (isFeatureMap)
- {
- EStructuralFeature innerFeature;
-
- boolean demandCreated = readBoolean();
- if (demandCreated)
- {
- EPackage ePackage = EcoreFactory.eINSTANCE.createEPackage();
- ePackage.setNsURI(readString());
-
- EClass eClass = EcoreFactory.eINSTANCE.createEClass();
- eClass.setName(readString());
- ePackage.getEClassifiers().add(eClass);
-
- if (readBoolean())
- {
- EReference eReference = EcoreFactory.eINSTANCE.createEReference();
- eReference.setEType(EcorePackage.Literals.EOBJECT);
- // if (isElement)
- // {
- // eReference.setContainment(true);
- // eReference.setResolveProxies(false);
- // }
- innerFeature = eReference;
- }
- else
- {
- EAttribute eAttribute = EcoreFactory.eINSTANCE.createEAttribute();
- eAttribute.setEType(XMLTypePackage.eINSTANCE.getAnySimpleType());
- innerFeature = eAttribute;
- }
-
- innerFeature.setName(readString());
- innerFeature.setDerived(true);
- innerFeature.setTransient(true);
- innerFeature.setVolatile(true);
- // if (isElement)
- // {
- // innerFeature.setUpperBound(ETypedElement.UNSPECIFIED_MULTIPLICITY);
- // }
- eClass.getEStructuralFeatures().add(innerFeature);
- }
- else
- {
- EClass eClass = (EClass)readCDOClassifierRefAndResolve();
- innerFeature = eClass.getEStructuralFeature(readXInt());
- }
-
- type = CDOModelUtil.getType(innerFeature.getEType());
- value = type.readValue(this);
- value = CDORevisionUtil.createFeatureMapEntry(innerFeature, value);
- }
- else
- {
- value = type.readValue(this);
- }
-
+ Object value = type.readValue(this);
list.set(j, value);
+
if (TRACER.isEnabled())
{
TRACER.trace(" " + value); //$NON-NLS-1$
@@ -619,6 +552,7 @@ public abstract class CDODataInputImpl extends ExtendedDataInput.Delegating impl
public Object readCDOFeatureValue(EStructuralFeature feature) throws IOException
{
CDOType type = CDOModelUtil.getType(feature);
+
Object value = type.readValue(this);
if (value instanceof CDOLob<?>)
{
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java
index 8fce04e48e..bc3c368297 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/protocol/CDODataOutputImpl.java
@@ -61,11 +61,8 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
-import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
import java.text.MessageFormat;
@@ -499,39 +496,11 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements
}
CDOIDProvider idProvider = getIDProvider();
- boolean isFeatureMap = FeatureMapUtil.isFeatureMap(feature);
+
for (int j = 0; j < size; j++)
{
Object value = list.get(j, false);
- EStructuralFeature innerFeature = feature; // Prepare for possible feature map
- if (isFeatureMap)
- {
- FeatureMap.Entry entry = (FeatureMap.Entry)value;
- innerFeature = entry.getEStructuralFeature();
- value = entry.getValue();
-
- EClass eClass = innerFeature.getEContainingClass();
- EPackage ePackage = eClass.getEPackage();
- if (ePackage.getName() == null)
- {
- // Probably a demand-created DocumentRoot feature
- writeBoolean(true);
- writeString(ePackage.getNsURI());
- writeString(eClass.getName());
- writeBoolean(innerFeature instanceof EReference);
- writeString(innerFeature.getName());
- }
- else
- {
- writeBoolean(false);
- writeCDOClassifierRef(eClass);
-
- int featureID = eClass.getFeatureID(innerFeature);
- writeXInt(featureID);
- }
- }
-
- if (value != null && innerFeature instanceof EReference)
+ if (value != null && feature instanceof EReference)
{
value = idProvider.provideCDOID(value);
}
@@ -541,7 +510,7 @@ public class CDODataOutputImpl extends ExtendedDataOutput.Delegating implements
TRACER.trace(" " + value); //$NON-NLS-1$
}
- writeCDOFeatureValue(innerFeature, value);
+ writeCDOFeatureValue(feature, value);
}
}
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
index a86907bb1c..c5c2b8033b 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/BaseCDORevision.java
@@ -53,9 +53,6 @@ import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
-import org.eclipse.emf.ecore.util.FeatureMap.Entry;
-import org.eclipse.emf.ecore.util.FeatureMapUtil;
import java.io.IOException;
import java.lang.reflect.Array;
@@ -429,7 +426,6 @@ public abstract class BaseCDORevision extends AbstractCDORevision
}
else
{
- checkNoFeatureMap(feature);
if (feature instanceof EReference)
{
value = out.getIDProvider().provideCDOID(value);
@@ -465,17 +461,10 @@ public abstract class BaseCDORevision extends AbstractCDORevision
CDOList list = getValueAsList(i);
if (list != null)
{
- boolean isFeatureMap = FeatureMapUtil.isFeatureMap(feature);
for (int j = 0; j < list.size(); j++)
{
Object value = list.get(j, false);
EStructuralFeature innerFeature = feature; // Prepare for possible feature map
- if (isFeatureMap)
- {
- Entry entry = (FeatureMap.Entry)value;
- innerFeature = entry.getEStructuralFeature();
- value = entry.getValue();
- }
if (value != null && innerFeature instanceof EReference)
{
@@ -490,7 +479,6 @@ public abstract class BaseCDORevision extends AbstractCDORevision
}
else
{
- checkNoFeatureMap(feature);
Object value = getValue(i);
if (value != null && feature instanceof EReference)
{
@@ -878,7 +866,7 @@ public abstract class BaseCDORevision extends AbstractCDORevision
for (int i = 0; i < features.length; i++)
{
EStructuralFeature feature = features[i];
- if (feature instanceof EReference || FeatureMapUtil.isFeatureMap(feature))
+ if (feature instanceof EReference)
{
if (feature.isMany())
{
@@ -1230,12 +1218,13 @@ public abstract class BaseCDORevision extends AbstractCDORevision
}
}
+ /**
+ * @deprecated As of 4.5 {@link org.eclipse.emf.ecore.util.FeatureMap feature maps} are no longer supported.
+ */
+ @Deprecated
public static void checkNoFeatureMap(EStructuralFeature feature)
{
- if (FeatureMapUtil.isFeatureMap(feature))
- {
- throw new UnsupportedOperationException("Single-valued feature maps not yet handled");
- }
+ throw new UnsupportedOperationException();
}
public static Object remapID(Object value, Map<CDOID, CDOID> idMappings, boolean allowUnmappedTempIDs)
diff --git a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java
index b7498231ec..e4a5de0943 100644
--- a/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java
+++ b/plugins/org.eclipse.emf.cdo.common/src/org/eclipse/emf/cdo/spi/common/revision/CDOFeatureMapEntry.java
@@ -11,15 +11,16 @@
package org.eclipse.emf.cdo.spi.common.revision;
import org.eclipse.emf.ecore.EStructuralFeature;
-import org.eclipse.emf.ecore.util.FeatureMap;
/**
* If the meaning of this type isn't clear, there really should be more of a description here...
*
* @since 3.0
+ * @deprecated As of 4.5 {@link org.eclipse.emf.ecore.util.FeatureMap feature maps} are no longer supported.
* @author Martin Taal
*/
-public interface CDOFeatureMapEntry extends FeatureMap.Entry
+@Deprecated
+public interface CDOFeatureMapEntry extends org.eclipse.emf.ecore.util.FeatureMap.Entry
{
public void setEStructuralFeature(EStructuralFeature feature);

Back to the top