summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCaspar De Groot2011-07-26 01:23:52 (EDT)
committerCaspar De Groot2011-07-26 01:23:52 (EDT)
commitd175de7e5770859d4375ce952eb419465430892e (patch)
treeb53a65331c6963c70952de5b733fabf45658e8be
parenta288ba669fa79bc5b1d87ab6daf74334c91e2c7a (diff)
downloadcdo-d175de7e5770859d4375ce952eb419465430892e.zip
cdo-d175de7e5770859d4375ce952eb419465430892e.tar.gz
cdo-d175de7e5770859d4375ce952eb419465430892e.tar.bz2
[352561] Support client assigned CDOIDs (UUIDs)
https://bugs.eclipse.org/bugs/show_bug.cgi?id=352561
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CommitIntegrityCheck.java19
1 files changed, 13 insertions, 6 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CommitIntegrityCheck.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CommitIntegrityCheck.java
index e8cd2b5..4185911 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CommitIntegrityCheck.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/CommitIntegrityCheck.java
@@ -13,7 +13,6 @@ package org.eclipse.emf.internal.cdo.util;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.CDOState;
import org.eclipse.emf.cdo.common.id.CDOID;
-import org.eclipse.emf.cdo.common.id.CDOIDTemp;
import org.eclipse.emf.cdo.common.id.CDOIDUtil;
import org.eclipse.emf.cdo.common.model.EMFUtil;
import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
@@ -308,15 +307,23 @@ public class CommitIntegrityCheck
private boolean isNew(Object idOrObject)
{
- if (idOrObject instanceof CDOIDTemp)
+ CDOObject object = null;
+ if (idOrObject instanceof CDOObject)
{
- return true;
+ object = (CDOObject)idOrObject;
+ }
+ else if (idOrObject instanceof EObject)
+ {
+ object = CDOUtil.getCDOObject((EObject)idOrObject);
+ }
+ else if (idOrObject instanceof CDOID)
+ {
+ object = transaction.getObject((CDOID)idOrObject);
}
- if (idOrObject instanceof EObject)
+ if (object != null)
{
- CDOObject obj = CDOUtil.getCDOObject((EObject)idOrObject);
- return obj.cdoState() == CDOState.NEW;
+ return object.cdoState() == CDOState.NEW;
}
return false;