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

后端 未结 7 1715
别那么骄傲
别那么骄傲 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

    I got the same problem today in a web application. Four calls working on the same array tried to sort it at the same time, effectively messing up for each other.

提交回复
热议问题