Community
Participate
Working Groups
RemoteTargetSyncElement#getSyncKind(int,IProgressMonitor):int, which implements ILocalSyncElement#getSyncKind(int,IProgressMonitor):int, returns the ORed value of the appropriate public static final ints defined in ILocalSyncElement. However, it is used by SyncCompareInput#collectResourceChanges(...):IDiffElement to indirectly set the value of the fkind instance variable in DiffElement. This means that DiffElement#getKind():int, which is used by {Put,Get}SyncAction#run(...):SyncSet, returns values not defined in Differencer.
Created attachment 1731 [details] potential patch for bug 18208 that exposes this problem
How to see the effects of this bug in action: Apply the patch for 18208 included in this PR to the org.eclipse.team.ui project. Run a self-hosted Eclipse instance in Debug mode. Create a new folder in a fresh project. Deploy & upload this project to a Target site. Delete the folder locally. Synchronize the project and observe (in the debugger) what changed[i].getKind() returns for the newly deleted folder. What you will see: The value returned by changed[i].getKind() will be 6 (the result of the bitwise OR of 4 & 2). The problem: Since changed[i].getKind() is supposed to return a value defined in Differencer, this value is used to determine whether the change is a deletion or not. However, since a deletion is indicated by 2 (not 6), the function does not flag the change as a deletion & bad things ™ happen consequently.
Tony, was this patch ever applied?
I think James & I fixed this by consolidating the public static finals in the 2 different files to be the same by making one set redirect to the other & using the mask defined in one of the classes to prevent this from being a problem.
This should no longer be a problem.