Apparently on any IResourceChangeEvent.POST_CHANGE we just burn some CPU time and generate some garbage for the GC to clean out later. I cannot see a reason why this code is still here. My memory says we did this in the past to notify the resource decorator that it needs to update, or we used it for our cache tree invalidation. Since this code has no side effect other than to waste time we can safely remove it, and cut our project down a little bit. Signed-off-by: Shawn O. Pearce <spearce@xxxxxxxxxxx> --- .../spearce/egit/core/project/GitProjectData.java | 64 -------------------- 1 files changed, 0 insertions(+), 64 deletions(-) diff --git a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java index 8754bd1..3d5424c 100644 --- a/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java +++ b/org.spearce.egit.core/src/org/spearce/egit/core/project/GitProjectData.java @@ -29,8 +29,6 @@ import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IResource; import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IResourceChangeListener; -import org.eclipse.core.resources.IResourceDelta; -import org.eclipse.core.resources.IResourceDeltaVisitor; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.core.runtime.CoreException; import org.eclipse.core.runtime.Preferences; @@ -61,10 +59,6 @@ public class GitProjectData { @SuppressWarnings("synthetic-access") public void resourceChanged(final IResourceChangeEvent event) { switch (event.getType()) { - case IResourceChangeEvent.POST_CHANGE: - projectsChanged(event.getDelta().getAffectedChildren( - IResourceDelta.CHANGED)); - break; case IResourceChangeEvent.PRE_CLOSE: uncache((IProject) event.getResource()); break; @@ -182,16 +176,6 @@ public class GitProjectData { Activator.trace("(GitProjectData) " + m); } - private static void projectsChanged(final IResourceDelta[] projDeltas) { - for (int k = 0; k < projDeltas.length; k++) { - final IResource r = projDeltas[k].getResource(); - final GitProjectData d = get((IProject) r); - if (d != null) { - d.notifyChanged(projDeltas[k]); - } - } - } - private synchronized static void cache(final IProject p, final GitProjectData d) { projectDataCache.put(p, d); @@ -380,54 +364,6 @@ public class GitProjectData { } } - private void notifyChanged(final IResourceDelta projDelta) { -// final Set affectedMappings = new HashSet(); - try { - projDelta.accept(new IResourceDeltaVisitor() { - public boolean visit(final IResourceDelta d) - throws CoreException { - final int f = d.getFlags(); - IResource res = d.getResource(); - IResource r = res; - if ((f & IResourceDelta.CONTENT) != 0 - || (f & IResourceDelta.ENCODING) != 0 - || r instanceof IContainer) { - String s = null; - RepositoryMapping m = null; - - while (r != null) { - m = getRepositoryMapping(r); - if (m != null) { - break; - } - - if (s != null) { - s = r.getName() + "/" + s; - } else { - s = r.getName(); - } - - r = r.getParent(); - } - - if (m == null) { - return false; - } else if (s == null) { - return true; - } - } - return false; - } - }); - } catch (CoreException ce) { - // We are in deep trouble. This should NOT have happend. Detach - // our listeners and forget it ever did. - // - detachFromWorkspace(); - Activator.logError(CoreText.GitProjectData_notifyChangedFailed, ce); - } - } - private File propertyFile() { return new File(getProject() .getWorkingLocation(Activator.getPluginId()).toFile(), -- 1.6.0.rc1.250.g9b5e2 -- To unsubscribe from this list: send the line "unsubscribe git" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html