Browse Source

Merge pull request #7848 in DESIGN/design from bugfix/10.0 to feature/10.0

* commit '61007dce855ad36ce5b939ec0fe24bb3de2615a6':
  REPORT-66342 组件复用-设计器里在线组件页面一直显示加载中,日志没有报错;帆软市场web页面效果正常
feature/10.0
superman 3 years ago
parent
commit
e20fda9004
  1. 6
      designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java

6
designer-form/src/main/java/com/fr/design/mainframe/share/sort/OnlineWidgetSortType.java

@ -27,7 +27,11 @@ public enum OnlineWidgetSortType implements SortType<OnlineShareWidget> {
public int compare(OnlineShareWidget o1, OnlineShareWidget o2) {
double t1 = getSortValue(o1, parameterMap);
double t2 = getSortValue(o2, parameterMap);
return ComparatorUtils.compareCommonType(t2, t1);
// Comparator中比较double/float相等时,不允许误差. 否则会违背 "若x = y , y = z, 则x = z"的约定。
// 因为允许误差的情况下,x和y间的误差在允许范围内,被判定相等,y和间的误差在允许范围内,被判定相等,
// 但x和z间的误差可能超出允许范围,从而不相等,因此会违背上述约定。
// 产生IllegalArgumentException: Comparison method violates its general contract!
return Double.compare(t2, t1);
}
});
}

Loading…
Cancel
Save