Skip to main content
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2015-09-12 06:14:41 +0000
committerEike Stepper2015-09-12 06:30:31 +0000
commit57baf017e4dfe5513655ae0bdcfbb2b4fa17e70e (patch)
treeac11ee9fd0777c821103764e7a099a98d05c0a87
parent041ec81cd2e0a03fbd11a86508a2c7822320d71b (diff)
downloadcdo-57baf017e4dfe5513655ae0bdcfbb2b4fa17e70e.tar.gz
cdo-57baf017e4dfe5513655ae0bdcfbb2b4fa17e70e.tar.xz
cdo-57baf017e4dfe5513655ae0bdcfbb2b4fa17e70e.zip
[477252] ClassCastException in CDONotificationBuilder.createPrimitiveNotification()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=477252
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDONotificationBuilder.java24
1 files changed, 23 insertions, 1 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDONotificationBuilder.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDONotificationBuilder.java
index 7c1ef6a391..98f6a5a23b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDONotificationBuilder.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/object/CDONotificationBuilder.java
@@ -14,6 +14,8 @@ package org.eclipse.emf.internal.cdo.object;
import org.eclipse.emf.cdo.CDOObject;
import org.eclipse.emf.cdo.common.id.CDOID;
+import org.eclipse.emf.cdo.common.model.CDOModelUtil;
+import org.eclipse.emf.cdo.common.model.CDOType;
import org.eclipse.emf.cdo.common.revision.CDORevisionFactory;
import org.eclipse.emf.cdo.common.revision.delta.CDOAddFeatureDelta;
import org.eclipse.emf.cdo.common.revision.delta.CDOClearFeatureDelta;
@@ -32,6 +34,7 @@ import org.eclipse.net4j.util.ReflectUtil;
import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.common.notify.NotificationChain;
import org.eclipse.emf.common.notify.impl.NotificationChainImpl;
+import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.EcorePackage;
import org.eclipse.emf.ecore.InternalEObject;
@@ -288,7 +291,26 @@ public class CDONotificationBuilder extends CDOFeatureDeltaVisitorImpl
private CDODeltaNotificationImpl createNotification(int eventType, EStructuralFeature feature, Object oldValue,
Object newValue, int position)
{
- Class<?> instanceClass = feature.getEType().getInstanceClass();
+ EClassifier eType = feature.getEType();
+
+ if (oldValue != null || newValue != null)
+ {
+ CDOType type = CDOModelUtil.getType(eType);
+ if (type != null)
+ {
+ if (oldValue != null)
+ {
+ oldValue = type.convertToEMF(eType, oldValue);
+ }
+
+ if (newValue != null)
+ {
+ newValue = type.convertToEMF(eType, newValue);
+ }
+ }
+ }
+
+ Class<?> instanceClass = eType.getInstanceClass();
if (instanceClass.isPrimitive())
{
Object defaultValue = null;

Back to the top