why does my compare method throw exception — Comparison method violates its general contract!

后端 未结 7 1716
别那么骄傲
别那么骄傲 2020-11-30 12:49

Why does this code

public class SponsoredComparator implements Comparator {

    public boolean equals(SRE arg0, SRE arg1){
        return arg0.g         


        
7条回答
  •  时光取名叫无心
    2020-11-30 13:09

    maybe you just have NaN values which you compare through Collections.sort... this has been a problem to me and i got that exception even having right implementation of compare(obj1, obj2) method! Check that!

提交回复
热议问题