Bugs item #684963, was opened at 2003-02-11 17:44
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=684963&group_id=40712

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Jason Horne (jdhorne)
Assigned to: Nobody/Anonymous (nobody)
Summary: ClassCastException from SortedSet

Initial Comment:
I've attached details from a forum message, along with
a stack trace below

<snip source="forum">
I'm not sure if this is related, but we are getting a
ClassCastException because TreeMap is trying to cast
our objects into Comparables since it can't find a
Comparator. We defined a comparator, though, and it
looks like it's copied most of the time.

However, it looks like this constructor for SortedSet:

public SortedSet(SessionImplementor session,
java.util.SortedSet set) {
super(session, set);
}


..should copy the comparator as well. When this
constructor is called by SortedSetType.wrap(...), the
comparator isn't copied to the hibernate SortedSet
class from the java.util.SortedSet class.

Is this behavior intentional, or is this a bug?
</snip>

Here's the relevant portion of a stack trace:
java.lang.ClassCastException
        at java.util.TreeMap.compare(TreeMap.java:1081)
        at java.util.TreeMap.put(TreeMap.java:459)
        at java.util.TreeSet.add(TreeSet.java:205)
        at
cirrus.hibernate.collections.SortedSet.snapshot(SortedSet.java:29)
        at
cirrus.hibernate.collections.PersistentCollection.getSnapshot(PersistentCollection.java:174)
        at
cirrus.hibernate.impl.SessionImpl$CollectionEntry.postFlush(SessionImpl.java:265)
        at
cirrus.hibernate.impl.SessionImpl.postFlush(SessionImpl.java:1934)
        at
cirrus.hibernate.impl.SessionImpl.flush(SessionImpl.java:1611)
        at
cirrus.hibernate.transaction.JDBCTransaction.commit(JDBCTransaction.java:52)

I'm running JDK 1.4.1_01, and using Hibernate 1.2.3.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=428708&aid=684963&group_id=40712


-------------------------------------------------------
This SF.NET email is sponsored by:
SourceForge Enterprise Edition + IBM + LinuxWorld = Something 2 See!
http://www.vasoftware.com
_______________________________________________
hibernate-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/hibernate-devel


Reply via email to