码迷,mamicode.com
首页 > 编程语言 > 详细

java.lang.IllegalArgumentException: Comparison method violates its general contract!

时间:2015-10-05 11:40:05      阅读:292      评论:0      收藏:0      [点我收藏+]

标签:

Collections.sort(saleList, new Comparator<DbViewProductSale>() {
@Override
public int compare(DbViewProductSale paramT1, DbViewProductSale paramT2) {
// return paramT1.getSaleDate().before(paramT2.getSaleDate()) ? -1 : 1;
return paramT1.getSaleDate().compareTo(paramT2.getSaleDate());
}
});

 

ref : http://blog.csdn.net/ghsau/article/details/42012365

java.lang.IllegalArgumentException: Comparison method violates its general contract!

标签:

原文地址:http://www.cnblogs.com/shouwangzhe-/p/4855479.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!