summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2007-08-02 03:40:52 (EDT)
committerEike Stepper2007-08-02 03:40:52 (EDT)
commita05a79a4b6182ede1aa070d09fe524a41d2aade2 (patch)
tree6acd025bf22224224b15526ea17e913b6450eaff
parent1c3d4893d5a6ed82fd210daad4abe3352164a4d3 (diff)
downloadcdo-a05a79a4b6182ede1aa070d09fe524a41d2aade2.zip
cdo-a05a79a4b6182ede1aa070d09fe524a41d2aade2.tar.gz
cdo-a05a79a4b6182ede1aa070d09fe524a41d2aade2.tar.bz2
*** empty log message ***
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java2
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOLegacyImpl.java21
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java4
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/util/ProxyResolverResource.java2
4 files changed, 17 insertions, 12 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
index 1cec574..5d6467b 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/cdo/CDOView.java
@@ -45,7 +45,7 @@ public interface CDOView extends INotifier
*/
public CDOResource getResource(String path);
- public CDOObject lookupInstance(CDOID id);
+ public CDOObject lookupObject(CDOID id);
public CDORevision lookupRevision(CDOID id);
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 0cf5976..7cde124 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);
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
index 60056de..6b0491a 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/CDOViewImpl.java
@@ -212,7 +212,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
return (CDORevisionImpl)revisionManager.getRevision(id);
}
- public InternalCDOObject lookupInstance(CDOID id)
+ public InternalCDOObject lookupObject(CDOID id)
{
if (id.equals(lastLookupID))
{
@@ -346,7 +346,7 @@ public class CDOViewImpl extends org.eclipse.net4j.internal.util.event.Notifier
}
CDOID id = (CDOID)potentialID;
- InternalCDOObject result = lookupInstance(id);
+ InternalCDOObject result = lookupObject(id);
if (result == null)
{
throw new ImplementationError("ID not registered: " + id);
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 1034dee..c93b6c7 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
@@ -48,7 +48,7 @@ final class ProxyResolverResource implements Resource
public EObject getEObject(String uriFragment)
{
CDOID id = CDOIDImpl.create(Long.parseLong(uriFragment));
- InternalCDOObject object = view.lookupInstance(id);
+ InternalCDOObject object = view.lookupObject(id);
if (object instanceof CDOCallbackImpl)
{
CDOCallbackImpl callback = (CDOCallbackImpl)object;