Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2016-01-10 08:43:25 +0000
committerEike Stepper2016-01-10 08:43:25 +0000
commit5579f08d30afb9100e05e5a9cf95686621db3a2d (patch)
tree4bc5834ba44ee6820e361962eef84267adc5a2b0
parent3a3450b0674c078900bd1373ea075e040516c425 (diff)
downloadcdo-5579f08d30afb9100e05e5a9cf95686621db3a2d.tar.gz
cdo-5579f08d30afb9100e05e5a9cf95686621db3a2d.tar.xz
cdo-5579f08d30afb9100e05e5a9cf95686621db3a2d.zip
[485486] CDOStaleReferencePolicy.PROXY should support eContents() and eCrossReferences()
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485486
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java42
1 files changed, 32 insertions, 10 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
index 480f470940..e91b2d781d 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/view/CDOStaleReferencePolicy.java
@@ -25,13 +25,15 @@ import org.eclipse.net4j.util.om.trace.ContextTracer;
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.Notifier;
import org.eclipse.emf.common.notify.impl.BasicNotifierImpl.EAdapterList;
-import org.eclipse.emf.common.util.BasicEList;
import org.eclipse.emf.common.util.Logger;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EClassifier;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.InternalEObject;
+import org.eclipse.emf.ecore.util.BasicInternalEList;
+import org.eclipse.emf.ecore.util.EContentsEList;
+import org.eclipse.emf.ecore.util.ECrossReferenceEList;
import org.eclipse.emf.spi.cdo.InternalCDOObject;
import org.eclipse.emf.spi.cdo.InternalCDOView;
@@ -137,6 +139,16 @@ public interface CDOStaleReferencePolicy
return null;
}
+ if (name.equals("eContents")) //$NON-NLS-1$
+ {
+ return EContentsEList.emptyContentsEList();
+ }
+
+ if (name.equals("eCrossReferences")) //$NON-NLS-1$
+ {
+ return ECrossReferenceEList.emptyCrossReferenceEList();
+ }
+
if (name.equals("eInvoke")) //$NON-NLS-1$
{
return null;
@@ -147,7 +159,7 @@ public interface CDOStaleReferencePolicy
EStructuralFeature featureParam = (EStructuralFeature)args[0];
if (featureParam.isMany())
{
- return new BasicEList<Object>();
+ return new BasicInternalEList<Object>(Object.class);
}
return featureParam.getDefaultValue();
@@ -195,31 +207,38 @@ public interface CDOStaleReferencePolicy
{
return false;
}
- else if (returnType == char.class)
+
+ if (returnType == char.class)
{
return (char)0;
}
- else if (returnType == byte.class)
+
+ if (returnType == byte.class)
{
return (byte)0;
}
- else if (returnType == short.class)
+
+ if (returnType == short.class)
{
return (short)0;
}
- else if (returnType == int.class)
+
+ if (returnType == int.class)
{
return (int)0;
}
- else if (returnType == long.class)
+
+ if (returnType == long.class)
{
return (long)0;
}
- else if (returnType == float.class)
+
+ if (returnType == float.class)
{
return (float)0;
}
- else if (returnType == double.class)
+
+ if (returnType == double.class)
{
return (double)0;
}
@@ -227,7 +246,7 @@ public interface CDOStaleReferencePolicy
if (List.class.isAssignableFrom(returnType))
{
- return new BasicEList<Object>();
+ return new BasicInternalEList<Object>(Object.class);
}
return null;
@@ -237,6 +256,9 @@ public interface CDOStaleReferencePolicy
Class<?> instanceClass = type.getInstanceClass();
Class<?>[] interfaces = null;
+ int xxx;
+ System.out.println(instanceClass);
+
// Be sure to have only interface
if (instanceClass.isInterface())
{

Back to the top