DESCRIPTION

Fix CommonUtils.STRING_ASCENDING_COMPARATOR for equal strings

Equal strings resulted in -1, but should return 0. The same applies when
comparing two empty strings.

This became apparent since the Switch-To menu uses this comparator now
(https://git.eclipse.org/r/#/c/22911/), which results in duplicated menu
entries.

Change-Id: I9ba316e9eb078b4f97c8c9e9d9749aadea0b5068
Signed-off-by: Kaden Henson xxx@xxx.xxx

COMMENTS

author: Kaden Henson
date: 2014-03-10 21:22:16.000000000

Uploaded patch set 1.

-------------------------------------
author: Brenden Conley
date: 2014-03-10 21:22:22.000000000

Patch Set 1:

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

-------------------------------------
author: Brenden Conley
date: 2014-03-10 21:37:12.000000000

Patch Set 1: Verified+1

Build Successful 

https://hudson.eclipse.org/egit/job/egit.gerrit/5603/ : SUCCESS

-------------------------------------
author: Clay Cameron
date: 2014-03-10 23:17:11.000000000

Patch Set 1: Code-Review-1

(4 comments)

Thanks for spotting this. Any chance for a test that reproduces the issue, proving the fix actually squashes the bug. Also see my inlined comments.

Line:85, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java -> Is that -0?

Line:35, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java -> Consider moving these assertions to separate method.

Line:86, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java -> Please use more descriptive name.

Line:87, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java -> Or even inline and drop the method.

-------------------------------------
author: Kaden Henson
date: 2014-03-10 23:48:56.000000000

Patch Set 1:

(3 comments)

I'll look into a test case for the switch-to menu tomorrow.

Line:85, org.eclipse.egit.ui/src/org/eclipse/egit/ui/internal/CommonUtils.java -> :-)

Line:35, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java -> Done

Line:87, org.eclipse.egit.ui.test/src/org/eclipse/egit/ui/internal/CommonUtilsTest.java -> Done

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