Browse Source

Merge pull request #7847 in DESIGN/design from release/10.0 to bugfix/10.0

* commit 'e63507e24f7ff629a32fa90588c558de1bcf14e8':
  REPORT-66342 组件复用-设计器里在线组件页面一直显示加载中,日志没有报错;帆软市场web页面效果正常
bugfix/10.0
superman 3 years ago
parent
commit
61007dce85
  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) { public int compare(OnlineShareWidget o1, OnlineShareWidget o2) {
double t1 = getSortValue(o1, parameterMap); double t1 = getSortValue(o1, parameterMap);
double t2 = getSortValue(o2, 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