Java 7 changed the sorting algorithm such that it throws an
java.lang.IllegalArgumentException: \"Comparison method violates its general contract!\"<
From the documentation:
IllegalArgumentException - (optional) if the natural ordering of the array elements is found to violate the Comparable contract
I didn't find much on the mentioned contract, but IMHO it should represent a total order (ie the relation defined by the compareTo method has to be transitive, antisymmetric, and total). If that requirement isn't met, sort might throw an IllegalArgumentException. (I say might because failure to meet this requirement could go unnoticed.)
EDIT: added links to the properties that make a relation a total order.