未验证 提交 9ba288ff 编写于 作者: O Oleg Nenashev 提交者: GitHub

Merge pull request #4237 from StefanSpieker/negating_result_compareto

Spotbugs: changed order for compare instead of negating result 
......@@ -1059,8 +1059,8 @@ public class Functions {
}
public int compareTo(Tag that) {
int r = Double.compare(this.ordinal, that.ordinal);
if (r!=0) return -r; // descending for ordinal
int r = Double.compare(that.ordinal, this.ordinal);
if (r!=0) return r; // descending for ordinal by reversing the order for compare
return this.hierarchy.compareTo(that.hierarchy);
}
}
......
......@@ -156,7 +156,7 @@ public final class RunMap<R extends Run<?,R>> extends AbstractLazyLoadRunMap<R>
@Deprecated
public static final Comparator<Comparable> COMPARATOR = new Comparator<Comparable>() {
public int compare(Comparable o1, Comparable o2) {
return -o1.compareTo(o2);
return o2.compareTo(o1);
}
};
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册