Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Stepper2012-09-15 07:08:22 +0000
committerEike Stepper2012-09-15 07:08:22 +0000
commit1d259077a25c67e5789b2b76074df799a01e3265 (patch)
treeadedf00654051300361fb171eee8c6496c304360 /plugins
parentf56576a379f5426e9ff504dbb51005cdf0e898e5 (diff)
downloadcdo-1d259077a25c67e5789b2b76074df799a01e3265.tar.gz
cdo-1d259077a25c67e5789b2b76074df799a01e3265.tar.xz
cdo-1d259077a25c67e5789b2b76074df799a01e3265.zip
Optimize AbstractCDOView.invalidate()
Diffstat (limited to 'plugins')
-rw-r--r--plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java19
1 files changed, 16 insertions, 3 deletions
diff --git a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
index 8b84a59bf5..72a548df02 100644
--- a/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
+++ b/plugins/org.eclipse.emf.cdo/src/org/eclipse/emf/internal/cdo/view/AbstractCDOView.java
@@ -1203,6 +1203,8 @@ public abstract class AbstractCDOView extends Lifecycle implements InternalCDOVi
}
}
+ private Map<String, CDOID> resourcePathCache = new HashMap<String, CDOID>();
+
/*
* Synchronized through InvlidationRunner.run()
*/
@@ -1210,6 +1212,9 @@ public abstract class AbstractCDOView extends Lifecycle implements InternalCDOVi
List<CDORevisionKey> allChangedObjects, List<CDOIDAndVersion> allDetachedObjects, List<CDORevisionDelta> deltas,
Map<CDOObject, CDORevisionDelta> revisionDeltas, Set<CDOObject> detachedObjects)
{
+ boolean hasConflictResolvers = this instanceof CDOTransaction
+ && ((CDOTransaction)this).options().getConflictResolvers().length != 0;
+
Map<CDOObject, Pair<CDORevision, CDORevisionDelta>> conflicts = null;
for (CDORevisionKey key : allChangedObjects)
{
@@ -1217,17 +1222,25 @@ public abstract class AbstractCDOView extends Lifecycle implements InternalCDOVi
if (key instanceof CDORevisionDelta)
{
delta = (CDORevisionDelta)key;
- // Copy the revision delta if we are a transaction, so that conflict resolvers can modify it.
- if (this instanceof CDOTransaction)
+ // Copy the revision delta so that conflict resolvers can modify it.
+ if (hasConflictResolvers)
{
delta = new CDORevisionDeltaImpl(delta, true);
}
deltas.add(delta);
+
+ if (resourcePathCache != null && EresourcePackage.Literals.CDO_RESOURCE_NODE.isSuperTypeOf(delta.getEClass()))
+ {
+ if (delta.getFeatureDelta(EresourcePackage.Literals.CDO_RESOURCE_NODE__FOLDER) != null
+ || delta.getFeatureDelta(EresourcePackage.Literals.CDO_RESOURCE_NODE__NAME) != null)
+ {
+ resourcePathCache.clear();
+ }
+ }
}
CDOObject changedObject = objects.get(key.getID());
-
if (changedObject != null)
{
Pair<CDORevision, CDORevisionDelta> oldInfo = new Pair<CDORevision, CDORevisionDelta>(

Back to the top