why does this:
import java.util.*;
public class my {
public static void main(String[] a) {
TreeMap<TreeSet<Integer>, String> map = new TreeMap<TreeSet<Integer>, String>();
TreeSet<Integer> set = new TreeSet<Integer>();
map.put(set, "lol");
}
}
work in Java 6? I mean that by specification putting TreeSet as a key of TreeMap without proper Comparator should lead to ClassCastException but it doesn't when running under Java 6. Was it a bug or there were some specification changes in Java 7 that made it work correctly (i.e. throw ClassCastException)?