[TGEN-1] generators/shuffle violates contract of Comparable Created: 13/Oct/12 Updated: 14/Oct/12 Resolved: 14/Oct/12
|Reporter:||Ben Smith-Mannschott||Assignee:||Ben Smith-Mannschott|
Mac OS X 10.8.2
JDK 7's sort function is stricter about verifying that implementations of the comparison function actually obey their contract. It will even helpfully throw an exception when this is not the case:
java.lang.IllegalArgumentException: Comparison method violates its general contract!
The root cause is this gem:
Which does not work on JDK7 since TimSort is clever enough to detect that the ordering function is behaving inconsistently, resulting in the previously mentioned exception.
Also, this is just a bad idea:
|Comment by Ben Smith-Mannschott [ 14/Oct/12 11:13 AM ]|