From: Anton v. S. <an...@ap...> - 2002-05-14 01:53:49
|
I was crashing trying to load a SortedSet, with "java.lang.RuntimeException: Hibernate failed trying to load a collection". The log showed that a ClassCastException was occurring in java.util.TreeMap.compare. It turned out that this was because the TreeMap in question didn't have a comparator, although I had specified one. I traced this to line 24 of SortedSet.java (in CVS & v0.9.11): java.util.SortedSet clonedSet = new TreeSet(); This looks to me as though it should read: java.util.SortedSet clonedSet = new TreeSet(comparator); ...which fixes the problem for me. There's an equivalent line in SortedMap which I expect suffers from the same problem. This problem presumably only occurs if the objects being compared don't support the Comparable interface - if they do, TreeMap.compare uses that. I won't make this my first change in CVS, since I haven't attempted to understand the SortedSet logic in any detail, and for all I know this change could affect something else. Anton |