summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-09-25 09:26:44 (EDT)
committerEike Stepper2007-09-25 09:26:44 (EDT)
commitab831a3839aa36b876fbd14e54d453969b16ba60 (patch)
tree75e7074c66940c0157869d73c394f25cdea7551c
parent3df43a765bfacfadbf4ea9ce3870d5c5f8f8f452 (diff)
downloadcdo-ab831a3839aa36b876fbd14e54d453969b16ba60.zip
cdo-ab831a3839aa36b876fbd14e54d453969b16ba60.tar.gz
cdo-ab831a3839aa36b876fbd14e54d453969b16ba60.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/CDOAdapterImpl.java37
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOCallbackImpl.java8
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java53
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java3
4 files changed, 51 insertions, 50 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
index 19c84a3..0de8c82 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOAdapterImpl.java
@@ -10,16 +10,13 @@
**************************************************************************/
package org.eclipse.emf.internal.cdo;
-import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notification;
-import org.eclipse.emf.common.notify.Notifier;
-import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.internal.cdo.bundle.OM;
/**
* @author Eike Stepper
*/
-public class CDOAdapterImpl extends CDOLegacyImpl implements Adapter.Internal
+public class CDOAdapterImpl extends CDOLegacyImpl
{
public CDOAdapterImpl()
{
@@ -30,38 +27,6 @@ public class CDOAdapterImpl extends CDOLegacyImpl implements Adapter.Internal
return type == CDOAdapterImpl.class;
}
- public InternalEObject getTarget()
- {
- return instance;
- }
-
- public void setTarget(Notifier newTarget)
- {
- if (newTarget instanceof InternalEObject)
- {
- instance = (InternalEObject)newTarget;
- }
- else
- {
- throw new IllegalArgumentException("Not an InternalEObject: " + newTarget.getClass().getName());
- }
- }
-
- public void unsetTarget(Notifier oldTarget)
- {
- if (oldTarget instanceof InternalEObject)
- {
- if (instance == oldTarget)
- {
- instance = null;
- }
- }
- else
- {
- throw new IllegalArgumentException("Not an InternalEObject: " + oldTarget.getClass().getName());
- }
- }
-
public void notifyChanged(Notification msg)
{
try
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 497543d..7589133 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
@@ -23,7 +23,7 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public class CDOCallbackImpl extends CDOAdapterImpl implements CDOCallback
+public class CDOCallbackImpl extends CDOLegacyImpl implements CDOCallback
{
public CDOCallbackImpl(InternalEObject instance)
{
@@ -40,7 +40,11 @@ public class CDOCallbackImpl extends CDOAdapterImpl implements CDOCallback
CDOStateMachine.INSTANCE.write(this);
}
- @Override
+ public boolean isAdapterForType(Object type)
+ {
+ return type == CDOCallbackImpl.class;
+ }
+
public void notifyChanged(Notification msg)
{
try
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
index bb1b06b..fcf62e6 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java
@@ -21,11 +21,8 @@ import org.eclipse.emf.cdo.protocol.CDOProtocolConstants;
import org.eclipse.emf.cdo.protocol.model.CDOType;
import org.eclipse.emf.cdo.protocol.revision.CDORevision;
-import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
-import org.eclipse.net4j.util.ImplementationError;
-import org.eclipse.net4j.util.ReflectUtil;
-import org.eclipse.net4j.util.WrappedException;
-
+import org.eclipse.emf.common.notify.Adapter;
+import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.util.URI;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
@@ -43,6 +40,11 @@ import org.eclipse.emf.internal.cdo.bundle.OM;
import org.eclipse.emf.internal.cdo.util.GenUtil;
import org.eclipse.emf.internal.cdo.util.ModelUtil;
+import org.eclipse.net4j.internal.util.om.trace.ContextTracer;
+import org.eclipse.net4j.util.ImplementationError;
+import org.eclipse.net4j.util.ReflectUtil;
+import org.eclipse.net4j.util.WrappedException;
+
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
@@ -52,15 +54,15 @@ import java.util.List;
/**
* @author Eike Stepper
*/
-public abstract class CDOLegacyImpl extends CDOWrapperImpl
+public abstract class CDOLegacyImpl extends CDOWrapperImpl implements Adapter.Internal
{
private static final ContextTracer TRACER = new ContextTracer(OM.DEBUG_OBJECT, CDOLegacyImpl.class);
- protected CDOState state;
+ private CDOState state;
- protected CDOResourceImpl resource;
+ private CDOResourceImpl resource;
- protected CDORevisionImpl revision;
+ private CDORevisionImpl revision;
public CDOLegacyImpl()
{
@@ -155,7 +157,6 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
public void cdoInternalPostLoad()
{
transferRevisionToInstance();
- // cdoInternalSetState(CDOState.CLEAN);
}
@Override
@@ -169,6 +170,38 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
return eClass().getName() + "@" + id;
}
+ public InternalEObject getTarget()
+ {
+ return instance;
+ }
+
+ public void setTarget(Notifier newTarget)
+ {
+ if (newTarget instanceof InternalEObject)
+ {
+ instance = (InternalEObject)newTarget;
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not an InternalEObject: " + newTarget.getClass().getName());
+ }
+ }
+
+ public void unsetTarget(Notifier oldTarget)
+ {
+ if (oldTarget instanceof InternalEObject)
+ {
+ if (instance == oldTarget)
+ {
+ instance = null;
+ }
+ }
+ else
+ {
+ throw new IllegalArgumentException("Not an InternalEObject: " + oldTarget.getClass().getName());
+ }
+ }
+
protected void transferInstanceToRevision()
{
if (TRACER.isEnabled())
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
index f01741c..b98be7e 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java
@@ -14,7 +14,6 @@ import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.resource.Resource;
import org.eclipse.emf.ecore.resource.ResourceSet;
import org.eclipse.emf.internal.cdo.CDOAdapterImpl;
-import org.eclipse.emf.internal.cdo.CDOCallbackImpl;
import org.eclipse.emf.internal.cdo.CDOViewImpl;
import org.eclipse.emf.internal.cdo.InternalCDOObject;
@@ -51,7 +50,7 @@ final class ProxyResolverResource implements Resource
CDOID id = CDOIDImpl.create(Long.parseLong(uriFragment));
InternalCDOObject object = view.getObject(id);
InternalEObject instance = object.cdoInternalInstance();
- if (instance instanceof CDOAdapterImpl && !(instance instanceof CDOCallbackImpl))
+ if (instance instanceof CDOAdapterImpl)
{
if (object.cdoState() == CDOState.PROXY)
{