summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-07-20 03:37:29 (EDT)
committerEike Stepper2007-07-20 03:37:29 (EDT)
commit570e063aef17b811865ec1348b9ae911c10a4c64 (patch)
treec9d428bd28b4ac3db8ec5fb4035303d94633ed41
parent5b739090f617abc783c9d7adfce8ceebed622931 (diff)
downloadcdo-570e063aef17b811865ec1348b9ae911c10a4c64.zip
cdo-570e063aef17b811865ec1348b9ae911c10a4c64.tar.gz
cdo-570e063aef17b811865ec1348b9ae911c10a4c64.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectAdapter.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java11
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java12
3 files changed, 14 insertions, 13 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectAdapter.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectAdapter.java
index 3f70f34..ce78965 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectAdapter.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOObjectAdapter.java
@@ -163,7 +163,7 @@ public class CDOObjectAdapter extends AdapterImpl implements InternalCDOObject
if (TRACER.isEnabled())
{
- TRACER.format("Setting ID: {0}", id);
+ TRACER.format("Setting ID: {0} for {1}", id, getTarget());
}
this.id = id;
@@ -235,7 +235,7 @@ public class CDOObjectAdapter extends AdapterImpl implements InternalCDOObject
CDOViewImpl view = (CDOViewImpl)cdoView();
CDOClassImpl cdoClass = revision.getCDOClass();
- System.out.println("TRANSFER " + cdoClass.getName());
+ System.out.println("TRANSFER " + cdoClass.getName() + ": " + target);
CDOFeatureImpl[] features = cdoClass.getAllFeatures();
for (int i = 0; i < features.length; i++)
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index c3fe4b0..2669693 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -94,13 +94,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
{
try
{
- Object converted = CDOViewImpl.this.convertToID(object);
- if (!(converted instanceof CDOID))
- {
- System.out.println(object);
- }
-
- CDOID id = (CDOID)converted;
+ CDOID id = (CDOID)CDOViewImpl.this.convertToID(object);
if (TRACER.isEnabled())
{
TRACER.format("Converted dangling reference: {0} --> {1}", object, id);
@@ -110,8 +104,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
catch (ClassCastException ex)
{
- ex.printStackTrace();
- throw new IllegalStateException("Dangling reference: " + object);
+ throw new IllegalStateException("Dangling reference: " + object, ex);
}
}
};
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
index 5144c94..89b3bdf 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ModelUtil.java
@@ -21,6 +21,7 @@ import org.eclipse.emf.cdo.internal.protocol.model.CDOTypeImpl;
import org.eclipse.emf.cdo.internal.protocol.model.core.CDOCorePackageImpl;
import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOResourceClassImpl;
import org.eclipse.emf.cdo.internal.protocol.model.resource.CDOResourcePackageImpl;
+import org.eclipse.emf.cdo.protocol.util.ImplementationError;
import org.eclipse.emf.cdo.util.EMFUtil;
import org.eclipse.emf.ecore.EClass;
@@ -46,7 +47,8 @@ public final class ModelUtil
{
if (eFeature instanceof EReference)
{
- return CDOTypeImpl.OBJECT;
+ throw new ImplementationError("Should only be called for attributes");
+ // return CDOTypeImpl.OBJECT;
}
EClassifier classifier = eFeature.getEType();
@@ -72,7 +74,13 @@ public final class ModelUtil
case EcorePackage.ELONG_OBJECT:
case EcorePackage.ESHORT:
case EcorePackage.ESHORT_OBJECT:
- return CDOTypeImpl.getType(classifierID);
+ CDOTypeImpl type = CDOTypeImpl.getType(classifierID);
+ if (type == CDOTypeImpl.OBJECT)
+ {
+ throw new ImplementationError("Attributes can not be of type OBJECT");
+ }
+
+ return type;
}
}