]> gerrit.simantics Code Review - simantics/platform.git/commitdiff
Broken tab contribution sorting causes missing contributions 21/421/4
authorAntti Villberg <antti.villberg@semantum.fi>
Tue, 18 Apr 2017 13:12:22 +0000 (16:12 +0300)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 18 Apr 2017 15:29:15 +0000 (18:29 +0300)
refs #7147

Change-Id: I82719519e4a1bcad541e1ce45db2ff16099cd17a

bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java

index 8dd72accd41729a69818f3e1b1935e6d944c5961..2077a3a87c2cdc8da744f155571b6b3355c4e958 100644 (file)
@@ -79,8 +79,9 @@ public class ComparableTabContributor implements PropertyTabContributor, Compara
 
     @Override
     public int compareTo(ComparableTabContributor o) {
-        double d = o.priority - priority;
-        return (d < 0) ? -1 : (d > 0) ? 1 : 0;
+        int comp = Double.compare(priority, o.priority);
+        if(comp != 0) return comp;
+        return id.compareTo(o.id);
     }
 
     @Override