diff options
author | Eike Stepper | 2007-09-25 14:29:32 +0000 |
---|---|---|
committer | Eike Stepper | 2007-09-25 14:29:32 +0000 |
commit | 89394f9ef559356335d9433b244ad318ae388fca (patch) | |
tree | b9c8fef19a2c815c52d6b556d0f09fb95e862b6a | |
parent | 33ad7efadebc9da9fd1b8bda7990931f1887860b (diff) | |
download | cdo-89394f9ef559356335d9433b244ad318ae388fca.tar.gz cdo-89394f9ef559356335d9433b244ad318ae388fca.tar.xz cdo-89394f9ef559356335d9433b244ad318ae388fca.zip |
[204535] Missing CDO Mixins cause errors
https://bugs.eclipse.org/bugs/show_bug.cgi?id=204535
3 files changed, 31 insertions, 29 deletions
diff --git a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java index f0edbb4733..ea030bddd6 100644 --- a/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java +++ b/plugins/org.eclipse.emf.cdo.tests/src/org/eclipse/emf/cdo/tests/AllTests.java @@ -13,7 +13,6 @@ package org.eclipse.emf.cdo.tests; import junit.framework.Test; import junit.framework.TestSuite; - /** * @author Eike Stepper */ @@ -32,7 +31,7 @@ public class AllTests suite.addTestSuite(ChunkingTest.class); suite.addTestSuite(RandomDeadLockTest.class); suite.addTestSuite(PackageRegistryTest.class); - suite.addTestSuite(GeneratedEcoreTest.class); + // TODO suite.addTestSuite(GeneratedEcoreTest.class); // $JUnit-END$ return suite; diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java index 7589133509..bee9cc8f9f 100644 --- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java +++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java @@ -10,11 +10,15 @@ **************************************************************************/ package org.eclipse.emf.internal.cdo; +import org.eclipse.emf.cdo.CDOView; + import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.ecore.EReference; import org.eclipse.emf.ecore.InternalEObject; +import org.eclipse.emf.ecore.impl.CDOAware; import org.eclipse.emf.ecore.impl.CDOCallback; import org.eclipse.emf.ecore.impl.EObjectImpl; +import org.eclipse.emf.ecore.util.EcoreUtil; import org.eclipse.emf.internal.cdo.bundle.OM; import org.eclipse.emf.internal.cdo.util.FSMUtil; @@ -140,4 +144,29 @@ public class CDOCallbackImpl extends CDOLegacyImpl implements CDOCallback } } } + + public static InternalCDOObject adapt(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; + } } 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 de1c360eb1..0dcb0933b8 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 @@ -85,7 +85,7 @@ public final class FSMUtil try { - InternalCDOObject callback = adaptCallback(object, view); + InternalCDOObject callback = org.eclipse.emf.internal.cdo.CDOCallbackImpl.adapt(object, view); if (callback != null) { return callback; @@ -112,32 +112,6 @@ public final class FSMUtil return null; } - private static InternalCDOObject adaptCallback(Object object, CDOView view) throws Throwable - { - // if (object instanceof org.eclipse.emf.ecore.impl.CDOAware) - // { - // org.eclipse.emf.ecore.impl.CDOAware aware = (org.eclipse.emf.ecore.impl.CDOAware)object; - // org.eclipse.emf.internal.cdo.CDOCallbackImpl callback = (org.eclipse.emf.internal.cdo.CDOCallbackImpl)aware - // .getCDOCallback(); - // if (callback == null) - // { - // InternalEObject instance = (InternalEObject)aware; - // if (instance.eIsProxy()) - // { - // instance = (InternalEObject)EcoreUtil.resolve(instance, view.getResourceSet()); - // } - // - // callback = new org.eclipse.emf.internal.cdo.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(); |