Can someone explain me in simple terms, why does this code throw an exception, \"Comparison method violates its general contract!\", and how do I fix it?
pri
I've seen this happen in a piece of code where the often recurring check for null values was performed:
if(( A==null ) && ( B==null ) return +1;//WRONG: two null values should return 0!!!