Title: Message
The synchronized wrapper isn't of type java.util.TreeSet, the only guarantee you get is that it implements the sorted set interface and that it's synchronized. The actual class is something different (java.util.Collections$SynchronizedSortedSet). If you're going to be taking advantage of the Set interface by using wrappers and such, you may want to use a factory instead of type="..." in your collection element.
 
Mocky
 
 
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Gary Moh
Sent: Thursday, September 29, 2005 1:51 PM
To: [email protected]
Subject: [jibx-users] ClassCastException

 
i'm getting a ClassCastException with the following:
 
Class SomeClass
{
  Set _set = Collections.synchronizedSortSet(new TreeSet());
}
 
<binding>
  <mapping name="a" class="SomeClass">
    <collection field="_set" type="java.util.TreeSet" item-type="AnotherClass"/>
  </mapping>
 ...
</binding>
 
any help?
 
 
thanks in advance,
gary
 

Reply via email to