Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2009-07-20 05:06:21 +0000
committerEike Stepper2009-07-20 05:06:21 +0000
commit8f84dfafb71b6634d1774f45773f994d7b81b8ea (patch)
tree4eba2b216bf9d1edb665021ef97935b7053fba0b /plugins/org.eclipse.emf.cdo
parent6e9da438713b73fae130737624b01cead345bb4c (diff)
downloadcdo-8f84dfafb71b6634d1774f45773f994d7b81b8ea.tar.gz
cdo-8f84dfafb71b6634d1774f45773f994d7b81b8ea.tar.xz
cdo-8f84dfafb71b6634d1774f45773f994d7b81b8ea.zip
[283945] Prevent EObjects from being passed to a repository
https://bugs.eclipse.org/bugs/show_bug.cgi?id=283945
Diffstat (limited to 'plugins/org.eclipse.emf.cdo')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOIDDangling.java38
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java3
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java195
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectImpl.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java17
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOTransactionImpl.java58
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java14
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java10
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java7
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java4
11 files changed, 333 insertions, 26 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOIDDangling.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOIDDangling.java
new file mode 100644
index 0000000000..44fcb27ec9
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOIDDangling.java
@@ -0,0 +1,38 @@
+/**
+ * Copyright (c) 2004 - 2009 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
+ */
+package org.eclipse.emf.cdo;
+
+import org.eclipse.emf.cdo.common.id.CDOID;
+
+import org.eclipse.emf.ecore.EObject;
+
+/**
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public interface CDOIDDangling extends CDOID
+{
+ public EObject getTarget();
+
+ // public List<Reference> getReferences();
+ //
+ // /**
+ // * @author Eike Stepper
+ // */
+ // public interface Reference
+ // {
+ // public CDOObject getSourceObject();
+ //
+ // public EStructuralFeature getSourceFeature();
+ //
+ // public CDOIDDangling getTargetID();
+ // }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java
index 0f3f913166..c0c9f77b26 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/util/CDOURIUtil.java
@@ -14,7 +14,6 @@ package org.eclipse.emf.cdo.util;
import org.eclipse.emf.cdo.common.id.CDOID;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.protocol.CDOProtocolConstants;
-import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalImpl;
import org.eclipse.emf.cdo.session.CDOSession;
import org.eclipse.emf.cdo.view.CDOView;
@@ -149,7 +148,7 @@ public class CDOURIUtil
CDOIDUtil.write(builder, newCDOID);
baseURI = baseURI.trimFragment().appendFragment(builder.toString());
- return new CDOIDExternalImpl(baseURI.toString());
+ return CDOIDUtil.createExternal(baseURI.toString());
}
public static List<String> analyzePath(URI uri)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java
new file mode 100644
index 0000000000..2447a7d473
--- /dev/null
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOIDDanglingImpl.java
@@ -0,0 +1,195 @@
+/**
+ * Copyright (c) 2004 - 2009 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
+ */
+package org.eclipse.emf.internal.cdo;
+
+import org.eclipse.emf.cdo.CDOIDDangling;
+import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.spi.common.id.AbstractCDOID;
+
+import org.eclipse.net4j.util.CheckUtil;
+import org.eclipse.net4j.util.io.ExtendedDataInput;
+import org.eclipse.net4j.util.io.ExtendedDataOutput;
+
+import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.EcoreUtil;
+
+import java.io.IOException;
+
+/**
+ * @author Eike Stepper
+ * @since 3.0
+ */
+public class CDOIDDanglingImpl extends AbstractCDOID implements CDOIDDangling
+{
+ private static final String NOT_SUPPORTED_MSG = "Not supported for CDOIDDangling"; //$NON-NLS-1$
+
+ private static final long serialVersionUID = 1L;
+
+ private InternalEObject target;
+
+ // private List<Reference> references = new ArrayList<Reference>();
+
+ public CDOIDDanglingImpl(InternalEObject target)
+ {
+ CheckUtil.checkArg(target, "target");
+ this.target = target;
+ }
+
+ public InternalEObject getTarget()
+ {
+ return target;
+ }
+
+ // public List<Reference> getReferences()
+ // {
+ // return references;
+ // }
+ //
+ // public void addReference(InternalCDOObject sourceObject, EStructuralFeature sourceFeature)
+ // {
+ // synchronized (references)
+ // {
+ // for (Reference reference : references)
+ // {
+ // if (reference.getSourceObject() == sourceObject && reference.getSourceFeature() == sourceFeature)
+ // {
+ // return;
+ // }
+ // }
+ //
+ // references.add(new ReferenceImpl(sourceObject, sourceFeature));
+ // }
+ // }
+ //
+ // public void dispose()
+ // {
+ // target = null;
+ // references.clear();
+ // }
+
+ public Type getType()
+ {
+ return Type.DANGLING_OBJECT;
+ }
+
+ public boolean isDangling()
+ {
+ return true;
+ }
+
+ public boolean isExternal()
+ {
+ return false;
+ }
+
+ public boolean isMeta()
+ {
+ return false;
+ }
+
+ public boolean isNull()
+ {
+ return false;
+ }
+
+ public boolean isObject()
+ {
+ return true;
+ }
+
+ public boolean isTemporary()
+ {
+ return false;
+ }
+
+ public String toURIFragment()
+ {
+ return EcoreUtil.getURI(target).fragment();
+ }
+
+ @Override
+ public void read(String fragmentPart)
+ {
+ throw new UnsupportedOperationException(NOT_SUPPORTED_MSG);
+ }
+
+ @Override
+ public void read(ExtendedDataInput in) throws IOException
+ {
+ throw new UnsupportedOperationException(NOT_SUPPORTED_MSG);
+ }
+
+ @Override
+ public void write(ExtendedDataOutput out) throws IOException
+ {
+ throw new UnsupportedOperationException(NOT_SUPPORTED_MSG);
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (obj == this)
+ {
+ return true;
+ }
+
+ if (obj instanceof CDOIDDangling)
+ {
+ CDOIDDangling that = (CDOIDDangling)obj;
+ return target == that.getTarget();
+ }
+
+ return false;
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return target.hashCode();
+ }
+
+ @Override
+ protected int doCompareTo(CDOID o) throws ClassCastException
+ {
+ return toURIFragment().compareTo(((CDOIDDanglingImpl)o).toURIFragment());
+ }
+
+ // /**
+ // * @author Eike Stepper
+ // */
+ // public final class ReferenceImpl implements Reference
+ // {
+ // private InternalCDOObject sourceObject;
+ //
+ // private EStructuralFeature sourceFeature;
+ //
+ // public ReferenceImpl(InternalCDOObject sourceObject, EStructuralFeature sourceFeature)
+ // {
+ // this.sourceObject = sourceObject;
+ // this.sourceFeature = sourceFeature;
+ // }
+ //
+ // public InternalCDOObject getSourceObject()
+ // {
+ // return sourceObject;
+ // }
+ //
+ // public EStructuralFeature getSourceFeature()
+ // {
+ // return sourceFeature;
+ // }
+ //
+ // public CDOIDDangling getTargetID()
+ // {
+ // return CDOIDDanglingImpl.this;
+ // }
+ // }
+}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java
index 0ef7829b6b..b6b999d0a7 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyWrapper.java
@@ -223,7 +223,7 @@ public abstract class CDOLegacyWrapper extends CDOObjectWrapper
protected void instanceToRevisionFeature(EStructuralFeature feature, CDOPackageRegistry packageRegistry)
{
Object instanceValue = getInstanceValue(instance, feature, packageRegistry);
- CDOObjectImpl.instanceToRevisionFeature(view, revision, feature, instanceValue);
+ CDOObjectImpl.instanceToRevisionFeature(view, this, feature, instanceValue);
}
/**
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 619f4e39eb..14dc08dfe5 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
@@ -323,7 +323,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
if (!eFeature.isTransient())
{
Object setting = cdoBasicSettings() != null ? cdoSettings()[i] : null;
- instanceToRevisionFeature(view, revision, eFeature, setting);
+ instanceToRevisionFeature(view, this, eFeature, setting);
}
}
@@ -1037,9 +1037,9 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
/**
- * @since 2.0
+ * @since 3.0
*/
- public static void instanceToRevisionFeature(InternalCDOView view, InternalCDORevision revision,
+ public static void instanceToRevisionFeature(InternalCDOView view, InternalCDOObject object,
EStructuralFeature feature, Object setting)
{
if (TRACER.isEnabled())
@@ -1048,6 +1048,7 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
}
CDOStore cdoStore = view.getStore();
+ InternalCDORevision revision = object.cdoRevision();
if (feature.isMany())
{
@@ -1058,14 +1059,14 @@ public class CDOObjectImpl extends EStoreEObjectImpl implements InternalCDOObjec
EList<Object> list = (EList<Object>)setting;
for (Object value : list)
{
- value = cdoStore.convertToCDO(feature, value);
+ value = cdoStore.convertToCDO(object, feature, value);
revision.add(feature, index++, value);
}
}
}
else
{
- setting = cdoStore.convertToCDO(feature, setting);
+ setting = cdoStore.convertToCDO(object, feature, setting);
revision.set(feature, 0, setting);
}
}
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
index 7538350f9e..7d93c435b4 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOStore.java
@@ -328,7 +328,7 @@ public final class CDOStore implements EStore
TRACER.format("set({0}, {1}, {2}, {3})", cdoObject, feature, index, value); //$NON-NLS-1$
}
- value = convertToCDO(feature, value);
+ value = convertToCDO(cdoObject, feature, value);
CDOFeatureDelta delta = new CDOSetFeatureDeltaImpl(feature, index, value);
InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
@@ -408,9 +408,9 @@ public final class CDOStore implements EStore
}
/**
- * @since 2.0
+ * @since 3.0
*/
- public Object convertToCDO(EStructuralFeature feature, Object value)
+ public Object convertToCDO(InternalCDOObject object, EStructuralFeature feature, Object value)
{
if (value != null)
{
@@ -423,6 +423,15 @@ public final class CDOStore implements EStore
// The EReference condition should be in the CDOType.convertToCDO. Since common package do not have access to
// InternalCDOView I kept it here.
value = view.convertObjectToID(value, true);
+ // TTT if (value instanceof InternalEObject)
+ // {
+ // CDOIDDangling id = view.convertDanglingObjectToID(object, feature, (InternalEObject)value);
+ // if (id != null)
+ // {
+ // // TODO assign at once from convertDanglingObjectToID() if dangling IDs are fully implemented
+ // value = id;
+ // }
+ // }
}
else if (FeatureMapUtil.isFeatureMap(feature))
{
@@ -471,7 +480,7 @@ public final class CDOStore implements EStore
TRACER.format("add({0}, {1}, {2}, {3})", cdoObject, feature, index, value); //$NON-NLS-1$
}
- value = convertToCDO(feature, value);
+ value = convertToCDO(cdoObject, feature, value);
CDOFeatureDelta delta = new CDOAddFeatureDeltaImpl(feature, index, value);
InternalCDORevision revision = getRevisionForWriting(cdoObject, delta);
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 538e32fe0f..b27eb24f2a 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
@@ -83,6 +83,7 @@ import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.Map.Entry;
+import java.util.concurrent.atomic.AtomicInteger;
import java.util.concurrent.locks.ReentrantLock;
/**
@@ -107,7 +108,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
private long lastCommitTime = CDORevision.UNSPECIFIED_DATE;
- private int lastTemporaryID;
+ private AtomicInteger lastTemporaryID = new AtomicInteger();
private CDOTransactionStrategy transactionStrategy;
@@ -320,7 +321,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
public CDOIDTemp getNextTemporaryID()
{
- return CDOIDUtil.createTempObject(++lastTemporaryID);
+ return CDOIDUtil.createTempObject(lastTemporaryID.incrementAndGet());
}
/**
@@ -544,6 +545,27 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
return null;
}
+ // TTT Map<InternalEObject, CDOIDDanglingImpl> danglingObjects = new HashMap<InternalEObject, CDOIDDanglingImpl>();
+ //
+ // @Override
+ // public CDOIDDangling convertDanglingObjectToID(InternalCDOObject source, EStructuralFeature feature,
+ // InternalEObject target)
+ // {
+ // CDOIDDanglingImpl id;
+ // synchronized (danglingObjects)
+ // {
+ // id = danglingObjects.get(target);
+ // if (id == null)
+ // {
+ // id = new CDOIDDanglingImpl(lastTemporaryID.incrementAndGet(), target);
+ // danglingObjects.put(target, id);
+ // }
+ // }
+ //
+ // id.addReference(source, feature);
+ // return id;
+ // }
+
/**
* @since 2.0
*/
@@ -595,6 +617,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
try
{
+ // TTT convertDanglingObjects();
getTransactionStrategy().commit(this, progressMonitor);
}
catch (TransactionException ex)
@@ -612,6 +635,35 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
commit(null);
}
+ // TTT private void convertDanglingObjects()
+ // {
+ // for (CDOIDDanglingImpl id : danglingObjects.values())
+ // {
+ //
+ // for (Reference reference : id.getReferences())
+ // {
+ // convertDanglingObject(reference.getSourceObject(), reference.getSourceFeature(), id);
+ // }
+ // }
+ // }
+ //
+ // private void convertDanglingObject(CDOObject object, EStructuralFeature feature, CDOIDDangling id)
+ // {
+ // InternalCDORevision revision = (InternalCDORevision)object.cdoRevision();
+ // Object value = revision.getValue(feature);
+ // if (value instanceof List<?>)
+ // {
+ // List<?> list = (List<?>)value;
+ // for (int i = 0; i < list.size(); i++)
+ // {
+ // if (list.get(i) == id)
+ // {
+ //
+ // }
+ // }
+ // }
+ // }
+
/**
* @since 2.0
*/
@@ -1148,7 +1200,7 @@ public class CDOTransactionImpl extends CDOViewImpl implements InternalCDOTransa
firstSavepoint.getSharedDetachedObjects().clear();
dirty = false;
conflict = 0;
- lastTemporaryID = 0;
+ lastTemporaryID.set(0);
}
public Map<CDOID, CDOObject> getDirtyObjects()
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
index d55c2dd1ac..29221b5e63 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/transaction/CDOXACommitContextImpl.java
@@ -16,7 +16,7 @@ import org.eclipse.emf.cdo.common.model.CDOPackageUnit;
import org.eclipse.emf.cdo.common.revision.CDOReferenceAdjuster;
import org.eclipse.emf.cdo.common.revision.delta.CDORevisionDelta;
import org.eclipse.emf.cdo.eresource.CDOResource;
-import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDTempObjectExternalImpl;
import org.eclipse.emf.cdo.util.CDOUtil;
import org.eclipse.emf.internal.cdo.messages.Messages;
@@ -54,9 +54,9 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
private InternalCDOCommitContext delegateCommitContext;
- private Map<CDOIDExternalTempImpl, InternalCDOTransaction> requestedIDs = new HashMap<CDOIDExternalTempImpl, InternalCDOTransaction>();
+ private Map<CDOIDTempObjectExternalImpl, InternalCDOTransaction> requestedIDs = new HashMap<CDOIDTempObjectExternalImpl, InternalCDOTransaction>();
- private Map<InternalCDOObject, CDOIDExternalTempImpl> objectToID = new HashMap<InternalCDOObject, CDOIDExternalTempImpl>();
+ private Map<InternalCDOObject, CDOIDTempObjectExternalImpl> objectToID = new HashMap<InternalCDOObject, CDOIDTempObjectExternalImpl>();
public CDOXACommitContextImpl(CDOXATransactionImpl manager, InternalCDOCommitContext commitContext)
{
@@ -99,7 +99,7 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
return delegateCommitContext.getTransaction();
}
- public Map<CDOIDExternalTempImpl, InternalCDOTransaction> getRequestedIDs()
+ public Map<CDOIDTempObjectExternalImpl, InternalCDOTransaction> getRequestedIDs()
{
return requestedIDs;
}
@@ -144,11 +144,11 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
{
CDOID id = getTransaction().provideCDOID(idOrObject);
- if (id instanceof CDOIDExternalTempImpl)
+ if (id instanceof CDOIDTempObjectExternalImpl)
{
if (idOrObject instanceof InternalEObject)
{
- CDOIDExternalTempImpl proxyTemp = (CDOIDExternalTempImpl)id;
+ CDOIDTempObjectExternalImpl proxyTemp = (CDOIDTempObjectExternalImpl)id;
if (!requestedIDs.containsKey(proxyTemp))
{
InternalCDOObject cdoObject = (InternalCDOObject)CDOUtil.getCDOObject((InternalEObject)idOrObject);
@@ -181,7 +181,7 @@ public class CDOXACommitContextImpl implements InternalCDOXACommitContext
{
public Object adjustReference(Object id)
{
- CDOIDExternalTempImpl externalID = objectToID.get(id);
+ CDOIDTempObjectExternalImpl externalID = objectToID.get(id);
if (externalID != null)
{
id = externalID;
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
index 960954773c..dc92af65b2 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/CDOViewImpl.java
@@ -910,7 +910,7 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
InternalCDOObject object = (InternalCDOObject)idOrObject;
if (object.cdoView() != null && FSMUtil.isNew(object))
{
- return CDOIDUtil.createExternalTemp(uri);
+ return CDOIDUtil.createTempObjectExternal(uri);
}
}
@@ -978,7 +978,13 @@ public class CDOViewImpl extends Lifecycle implements InternalCDOView
return potentialObject;
}
- protected CDOID getID(InternalCDOObject object, boolean onlyPersistedID)
+ // TTT public CDOIDDangling convertDanglingObjectToID(InternalCDOObject source, EStructuralFeature feature,
+ // InternalEObject target)
+ // {
+ // throw new IllegalStateException("Dangling objects not possible outside of a transaction");
+ // }
+
+ private CDOID getID(InternalCDOObject object, boolean onlyPersistedID)
{
if (onlyPersistedID)
{
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
index 1b491ffc84..23810ae61e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOView.java
@@ -92,6 +92,13 @@ public interface InternalCDOView extends CDOView, CDOIDProvider, ILifecycle
public Object convertObjectToID(Object potentialObject, boolean onlyPersistedID);
+ // TTT /**
+ // * @param target
+ // * @since 3.0
+ // */
+ // public CDOIDDangling convertDanglingObjectToID(InternalCDOObject source, EStructuralFeature feature,
+ // InternalEObject target);
+
public Object convertIDToObject(Object potentialID);
/**
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java
index d02d8983ce..225ef1bf16 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/spi/cdo/InternalCDOXATransaction.java
@@ -11,7 +11,7 @@
package org.eclipse.emf.spi.cdo;
import org.eclipse.emf.cdo.common.id.CDOIDProvider;
-import org.eclipse.emf.cdo.internal.common.id.CDOIDExternalTempImpl;
+import org.eclipse.emf.cdo.internal.common.id.CDOIDTempObjectExternalImpl;
import org.eclipse.emf.cdo.transaction.CDOTransaction;
import org.eclipse.emf.cdo.transaction.CDOXATransaction;
@@ -37,7 +37,7 @@ public interface InternalCDOXATransaction extends CDOXATransaction
{
public InternalCDOXATransaction getTransactionManager();
- public Map<CDOIDExternalTempImpl, InternalCDOTransaction> getRequestedIDs();
+ public Map<CDOIDTempObjectExternalImpl, InternalCDOTransaction> getRequestedIDs();
public CommitTransactionResult getResult();
}

Back to the top