Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java21
1 files changed, 13 insertions, 8 deletions
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 0cf59764e5..7cde1248dc 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
@@ -88,6 +88,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
@Override
public CDOViewImpl cdoView()
{
+ // TODO Why is this lazy?
if (view == null)
{
view = CDOObjectImpl.getCDOView(this);
@@ -263,13 +264,13 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
if (containerID.isNull())
{
CDOID resourceID = revision.getResourceID();
- Resource.Internal resource = (Resource.Internal)view.lookupInstance(resourceID);
+ Resource.Internal resource = (Resource.Internal)view.lookupObject(resourceID);
transferResourceToInstance((BasicEObjectImpl)instance, resource);
}
else
{
int containingFeatureID = revision.getContainingFeatureID();
- InternalCDOObject container = view.lookupInstance(containerID);
+ InternalCDOObject container = view.lookupObject(containerID);
((BasicEObjectImpl)instance).eBasicSetContainer(container, containingFeatureID, null);
}
@@ -285,12 +286,7 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
InternalEList instanceList = (InternalEList)getInstanceValue(instance, feature);
if (instanceList != null)
{
- while (!instanceList.isEmpty())
- {
- Object toBeRemoved = instanceList.basicGet(0);
- instanceList.basicRemove(toBeRemoved, null);
- }
-
+ clearEList(instanceList);
List revisionList = (List)value;
for (Object toBeAdded : revisionList)
{
@@ -455,6 +451,15 @@ public abstract class CDOLegacyImpl extends CDOWrapperImpl
ReflectUtil.setValue(field, instance, value);
}
+ protected void clearEList(InternalEList list)
+ {
+ while (!list.isEmpty())
+ {
+ Object toBeRemoved = list.basicGet(0);
+ list.basicRemove(toBeRemoved, null);
+ }
+ }
+
protected static int getEFlagMask(Class<?> instanceClass, String flagName)
{
Field field = ReflectUtil.getField(instanceClass, flagName);

Back to the top