summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-25 07:57:12 (EDT)
committerEike Stepper2007-09-25 07:57:12 (EDT)
commit2aafae08123258b4cd33f5981067a0a35c27b7bc (patch)
tree7a68ecc246e5dab9f571fbf54645da0dcc78df3f
parent25b2f4acc5271e5f2da8b19cba9c90686940adff (diff)
downloadcdo-2aafae08123258b4cd33f5981067a0a35c27b7bc.zip
cdo-2aafae08123258b4cd33f5981067a0a35c27b7bc.tar.gz
cdo-2aafae08123258b4cd33f5981067a0a35c27b7bc.tar.bz2
[204535] Missing CDO Mixins cause errors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204535
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java44
1 files changed, 27 insertions, 17 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
index 44eb106..b25cfc5 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/FSMUtil.java
@@ -20,7 +20,6 @@ import org.eclipse.emf.common.util.EList;
import org.eclipse.emf.ecore.EGenericType;
import org.eclipse.emf.ecore.EModelElement;
import org.eclipse.emf.ecore.InternalEObject;
-import org.eclipse.emf.ecore.impl.CDOAware;
import org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.emf.internal.cdo.CDOAdapterImpl;
@@ -87,23 +86,9 @@ public final class FSMUtil
try
{
- if (object instanceof CDOAware)
+ InternalCDOObject callback = adaptCallback(object, view);
+ if (callback != null)
{
- CDOAware aware = (CDOAware)object;
- CDOCallbackImpl callback = (CDOCallbackImpl)aware.getCDOCallback();
- if (callback == null)
- {
- InternalEObject instance = (InternalEObject)aware;
- if (instance.eIsProxy())
- {
- instance = (InternalEObject)EcoreUtil.resolve(instance, view.getResourceSet());
- }
-
- callback = new CDOCallbackImpl(instance);
- aware.setCDOCallback(callback);
- instance.eAdapters().add(callback);
- }
-
return callback;
}
}
@@ -128,6 +113,31 @@ public final class FSMUtil
return null;
}
+ private static InternalCDOObject adaptCallback(Object object, CDOView view) throws Throwable
+ {
+ if (object instanceof CDOAware)
+ {
+ CDOAware aware = (CDOAware)object;
+ CDOCallbackImpl callback = (CDOCallbackImpl)aware.getCDOCallback();
+ if (callback == null)
+ {
+ InternalEObject instance = (InternalEObject)aware;
+ if (instance.eIsProxy())
+ {
+ instance = (InternalEObject)EcoreUtil.resolve(instance, view.getResourceSet());
+ }
+
+ callback = new CDOCallbackImpl(instance);
+ aware.setCDOCallback(callback);
+ instance.eAdapters().add(callback);
+ }
+
+ return callback;
+ }
+
+ return null;
+ }
+
public static Iterator<InternalCDOObject> iterator(Collection<?> instances, final CDOViewImpl view)
{
final Iterator<?> delegate = instances.iterator();