Wednesday, 21 August 2013

Debug "Comparison method violates its general contract!"

Debug "Comparison method violates its general contract!"

I have an own, relatively sophisticated string comparator and a large list
of strings (~100 strings, already tried to reduce but then the problem is
not reproducible) where sorting them produces the above error when trying
to sort with Java 7. I guess, that the rule
if a < b and b < c then a < c
might be violated. What is the best way to find out a sample which
violates the contract?

No comments:

Post a Comment