]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java
Broken tab contribution sorting causes missing contributions
[simantics/platform.git] / 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