排序:这个坑,你要注意:Comparison method violates its general contract!
程序员文章站
2022-03-11 09:05:46
...
解决方法如下:
/**
* 对比类:根据持有金额
*/
private static class TenderCollectComparator implements Comparator<TenderCollect> {
public int compare(TenderCollect b1, TenderCollect b2) {
return b1.getTocollectmoney().compareTo(b2.getTocollectmoney());
}
}