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

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

posted @ 2015-10-05 11:06  廖东海  阅读(338)  评论(0编辑  收藏  举报