diff options
Diffstat (limited to 'bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java')
-rw-r--r-- | bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java index a3300cc62..60ad3d409 100644 --- a/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java +++ b/bundles/org.eclipse.team.cvs.core/src/org/eclipse/team/internal/ccvs/core/resources/EclipseSynchronizer.java @@ -1280,6 +1280,12 @@ public class EclipseSynchronizer { */ protected boolean setModified(IResource container, boolean modified) throws CVSException { String indicator = modified ? IS_DIRTY_INDICATOR : NOT_DIRTY_INDICATOR; + + // DECORATOR this state change check is error prone. it is quite possible that + // another thread updated the dirty state (e.g. the decorator) and thus the returned + // value from this method will be wrong and lead the caller to make assumptions + // that can be wrong. That the state has not changed, but it has just too quickly. + // if it's already set, no need to set the property or adjust the parents count if (indicator.equals(getDirtyIndicator(container))) return false; // set the dirty indicator and adjust the parent accordingly @@ -1406,7 +1412,10 @@ public class EclipseSynchronizer { } getSyncInfoCacheFor(resource).flushDirtyCache(resource); } finally { - flushDirtyCacheWithAncestors(resource.getParent()); + IContainer parent = resource.getParent(); + if(! alreadyflushed(parent)) { + flushDirtyCacheWithAncestors(parent); + } } } finally { endOperation(null); @@ -1414,6 +1423,14 @@ public class EclipseSynchronizer { } /** + * @param parent + * @return boolean + */ + private boolean alreadyflushed(IContainer resource) throws CVSException { + return getSyncInfoCacheFor(resource).isDirtyCacheFlushed(resource); + } + + /** * Method updated flags the objetc as having been modfied by the updated * handler. This flag is read during the resource delta to determine whether * the modification made the file dirty or not. |