From: Antti Villberg Date: Tue, 18 Apr 2017 13:12:22 +0000 (+0300) Subject: Broken tab contribution sorting causes missing contributions X-Git-Tag: v1.29.0~106 X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=commitdiff_plain;h=4495707b888e893e0096b2c4aaf065f5e9b69e46;p=simantics%2Fplatform.git Broken tab contribution sorting causes missing contributions refs #7147 Change-Id: I82719519e4a1bcad541e1ce45db2ff16099cd17a --- diff --git a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java index 8dd72accd..2077a3a87 100644 --- a/bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java +++ b/bundles/org.simantics.selectionview/src/org/simantics/selectionview/ComparableTabContributor.java @@ -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