DESCRIPTION

Bug 496747 - [Project Explorer] Fix path comparison

The comparison was erroneous and led to unexpected ordering. This fixes
the path comparison by using a segment-to-segment comparison rather than
a plain toString one (which fails at properly understanding the meaning
of a slash in path)

Bug: 496747
Change-Id: I7ee4d72b3656c407a4ab77e4a1b35d959d2667ef
Signed-off-by: Isis Velasquez xxx@xxx.xxx


COMMENTS

author: Isis Velasquez
date: 2016-06-27 16:29:35.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2016-06-27 16:29:41.000000000

Patch Set 1:

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9665/

-------------------------------------
author: Brenden Conley
date: 2016-06-27 16:52:51.000000000

Patch Set 1: Code-Review-1

Build Unstable 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9665/ : UNSTABLE

-------------------------------------
author: Mina Hurleyiddle
date: 2016-06-27 20:39:43.000000000

Patch Set 1:

Given that the IPath instances the PathComparator will be getting for comparison come from project.getLocation() on L74 of NestedProjectManager.refreshProjectsList(), we can safely assume that the IPath instances will cover the full range of all the possible IPath values - i.e. relative paths, absolute paths, paths with/without device, UNC paths, Windows paths, Posix paths, etc. 

If all those kinds of paths should be considered, then the proposed PathComparator fix is still not enough because: 
(1) it is not consistent with Path.equals() and 
(2) it does not impose a total ordering on all possible paths.

I have put together a set of tests that PathComparator should fulfill to satisfy both (1) and (2): https://github.com/ppalaga/eclipse.platform.ui/commit/dea16291c0cb00eb2b4d40c89bf2937e6214b415 (Some of the tests are discutable) Please feel free to adopt it in your fix.

-------------------------------------
author: Isis Velasquez
date: 2016-06-28 06:35:15.000000000

Patch Set 1:

Thanks a lote Peter. Do you mind if I simply grab your proposed test class and include it in this change (with relevant fixes)? I'll add you to the Sign-off-by and as author in the copyright header.

-------------------------------------
author: Brenden Conley
date: 2016-06-28 07:22:18.000000000

Patch Set 1: -Code-Review

Build Started https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9669/

-------------------------------------
author: Mina Hurleyiddle
date: 2016-06-28 07:33:47.000000000

Patch Set 1:

> Do you mind if I simply grab your proposed
 > test class and include it in this change (with relevant fixes)?

Of course, no problem at all. That was my intention :)

 > I'll add you to the Sign-off-by and as author in the copyright
 > header.

I just checked in my Eclipse Account, I have signed the Eclipse CLA.

-------------------------------------
author: Brenden Conley
date: 2016-06-28 07:49:40.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/platform/job/eclipse.platform.ui-Gerrit/9669/ : SUCCESS

-------------------------------------
author: Gerrit Code Review
date: 2016-06-28 16:44:53.000000000

Change has been successfully merged into the git repository by Isis Velasquez

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