suchgr8heights
Jan 12, 2005
It's driving me mad that on the homepage, the online users are not in alpha.
If you don't specify a Comparator, it uses "natural order" (for anything that sorts. You could fix this by instantiating the TreeMap with the following Comparator:
public class IgnoreCaseStringComparator implements Comparator {
public int compare(Object o1, Object o2) {
((String)o1).compareToIgnoreCase((String)o2);
}
}
also check if they are null in the comparator, and if they are both String objects.
(I love Comparators)