Browse Source

Merge pull request #7850 in DESIGN/design from feature/10.0 to feature/big-screen

* commit 'e20fda9004e189dfb041f0209f0a4b983770efbe':
  REPORT-66342 组件复用-设计器里在线组件页面一直显示加载中,日志没有报错;帆软市场web页面效果正常
feature/big-screen
superman 3 years ago
parent
commit
499dc74b16
  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