Why does this code
public class SponsoredComparator implements Comparator {
public boolean equals(SRE arg0, SRE arg1){
return arg0.g
I assume that you are using JDK 7. Check the following URL:
From http://www.oracle.com/technetwork/java/javase/compatibility-417013.html#source
Area: API: Utilities
Synopsis: Updated sort behavior for
Arrays
andCollections
may throw anIllegalArgumentException
Description: The sorting algorithm used by
java.util.Arrays.sort
and (indirectly) byjava.util.Collections.sort
has been replaced. The new sort implementation may throw anIllegalArgumentException
if it detects aComparable
that violates theComparable
contract. The previous implementation silently ignored such a situation. If the previous behavior is desired, you can use the new system property,java.util.Arrays.useLegacyMergeSort
, to restore previous mergesort behavior.Nature of Incompatibility: behavioral
RFE: 6804124
For more detailed info, see the bug database reference here.