DESCRIPTION

[sync] Simplify operations on change actions

Simplify operations when repository changed occurs. Also extracts and
reuses implementation of IResourceDeltaVisitor from IndexDiffCacheEntry
to ignore breakpoint toggling events.

Bug: 358898
Change-Id: I6ae88da36dffaa913dc37525aec5ad8dca240fe0
Signed-off-by: Leslie Stephenson xxx@xxx.xxx


COMMENTS

author: Leslie Stephenson
date: 2011-10-31 22:15:58.000000000

Uploaded patch set 3.

-------------------------------------
author: Brenden Conley
date: 2011-10-31 22:16:03.000000000

Patch Set 3:

Build Started https://hudson.eclipse.org/sandbox/job/egit.gerrit/1858/ 

-------------------------------------
author: Leslie Stephenson
date: 2011-10-31 22:18:01.000000000

Patch Set 3:

I've done only some quick test on file addition, removing and breakpoints toggling and now everything seams to be working fine ... now I need some sleep before tomorrows travel on ECE ...

-------------------------------------
author: Brenden Conley
date: 2011-10-31 22:30:18.000000000

Patch Set 3: Build Successful

Build Successful 
 
https://hudson.eclipse.org/sandbox/job/egit.gerrit/1858/ : SUCCESS

-------------------------------------
author: Jaylon Avila
date: 2011-10-31 23:23:16.000000000

Patch Set 3: I would prefer that you didn't submit this

(5 inline comments)

Yup, visiting the delta and/or iterating over the delta's children is the right approach for identifying marker changes on files.

Line:68, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Need null check here, getDelta() may return null per the API.

java.lang.NullPointerException
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext$2.resourceChanged(GitSubscriberMergeContext.java:68)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
	at org.eclipse.core.internal.events.NotificationManager.handleEvent(NotificationManager.java:249)
	at org.eclipse.core.internal.resources.Workspace.broadcastEvent(Workspace.java:390)
	at org.eclipse.core.internal.resources.Project.close(Project.java:199)
	at org.eclipse.ui.actions.CloseResourceAction.invokeOperation(CloseResourceAction.java:129)
	at org.eclipse.ui.actions.WorkspaceAction.execute(WorkspaceAction.java:164)
	at org.eclipse.ui.actions.WorkspaceAction$2.runInWorkspace(WorkspaceAction.java:485)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:38)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Line:70, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Need null check here. getMapping(IResource) can return null for inaccessible projects (closed).

java.lang.NullPointerException
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext$2.resourceChanged(GitSubscriberMergeContext.java:70)
	at org.eclipse.core.internal.events.NotificationManager$1.run(NotificationManager.java:291)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.NotificationManager.notify(NotificationManager.java:285)
	at org.eclipse.core.internal.events.NotificationManager.broadcastChanges(NotificationManager.java:149)
	at org.eclipse.core.internal.resources.Workspace.broadcastPostChange(Workspace.java:395)
	at org.eclipse.core.internal.resources.Workspace.endOperation(Workspace.java:1530)
	at org.eclipse.core.internal.resources.InternalWorkspaceJob.run(InternalWorkspaceJob.java:45)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

Line:130, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> The error(String, Throwable) returns an IStatus. We should actually log the error.

Line:145, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> No need to do a null check and isEmpty() every iteration. Should just do it once in the beginning of the method and then decide whether we need to iterate over the data or not.

Line:159, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> The error(String, Throwable) returns an IStatus. We should actually log the error.

-------------------------------------
author: Leslie Stephenson
date: 2011-11-01 04:51:57.000000000

Patch Set 3: (4 inline comments)



Line:68, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Done

Line:70, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Done

Line:130, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Done

Line:145, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> Done

-------------------------------------
