DESCRIPTION

[sync] Simplify operations on change actions

Simplify operations when repository changed occurs. Also use
IndexDiffChangedListener for retrieving information about changed
resource (in this case break point add/remove events are not
propagated).

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


COMMENTS

author: Leslie Stephenson
date: 2011-10-31 09:47:01.000000000

Uploaded patch set 2.

-------------------------------------
author: Brenden Conley
date: 2011-10-31 09:47:05.000000000

Patch Set 2:

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

-------------------------------------
author: Brenden Conley
date: 2011-10-31 10:01:35.000000000

Patch Set 2: Build Successful

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

-------------------------------------
author: Jaylon Avila
date: 2011-10-31 10:43:52.000000000

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

(2 inline comments)

I'm still seeing issues with file renames not being picked up. If I add a file to the file system and then refresh it in Eclipse to get it to show up, it does not show up in the 'Synchronize' view.

Line:110, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> NPE is still possible if getDefault() returns null.

Caused by: java.lang.NullPointerException
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.dispose(GitSubscriberMergeContext.java:110)
	at org.eclipse.team.ui.synchronize.ModelSynchronizeParticipant.dispose(ModelSynchronizeParticipant.java:253)
	at org.eclipse.team.internal.ui.synchronize.SynchronizeManager.dispose(SynchronizeManager.java:574)
	at org.eclipse.team.internal.ui.TeamUIPlugin.stop(TeamUIPlugin.java:250)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl$2.run(BundleContextImpl.java:771)
	at java.security.AccessController.doPrivileged(Native Method)
	at org.eclipse.osgi.framework.internal.core.BundleContextImpl.stop(BundleContextImpl.java:764)

Line:141, org.eclipse.egit.core/src/org/eclipse/egit/core/synchronize/GitSubscriberMergeContext.java -> A null check is needed also. An NPE will be thrown if reopening a very large project.

java.lang.NullPointerException
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.handleResourceChange(GitSubscriberMergeContext.java:141)
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext.access$1(GitSubscriberMergeContext.java:137)
	at org.eclipse.egit.core.synchronize.GitSubscriberMergeContext$2.indexDiffChanged(GitSubscriberMergeContext.java:69)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache.notifyListeners(IndexDiffCache.java:94)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache.access$0(IndexDiffCache.java:86)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCache$1.indexDiffChanged(IndexDiffCache.java:81)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.notifyListeners(IndexDiffCacheEntry.java:313)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry.access$6(IndexDiffCacheEntry.java:306)
	at org.eclipse.egit.core.internal.indexdiff.IndexDiffCacheEntry$3.run(IndexDiffCacheEntry.java:171)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)

-------------------------------------
author: Jaylon Avila
date: 2011-10-31 14:09:55.000000000

Patch Set 2: No score

Dariusz, if you find that the resource optimization is the problem between renamed files and resource changes outside of Eclipse not showing up in the view, please remove the optimization.

Let's focus on a) ensuring that marker (breakpoint) changes do not make the subscribers refresh and b) that the refresh operation initiated by the GitSubscriberMergeContext is not performed on the UI thread.

-------------------------------------
author: Leslie Stephenson
date: 2011-10-31 18:39:06.000000000

Patch Set 2:

Added resources are not shown in sync view because of race condition. Team framework calls GitResourceVariantTreeSubscriber.getSyncInfo before cache is refreshed in this situation GitSyncInfo will return IN_SYNC status because added resource is not in cache.

AFAIR we failed with filtering out breakpoint toggling events in previous patch sets.

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