[jboss-dev-forums] [Design of JBossXB] - Re: SundayContentHandler: Don't add collections into collect

adrian@jboss.org do-not-reply at jboss.com
Tue Oct 10 09:43:01 EDT 2006


I was seeing error messages like:

java.lang.ClassCastExeption: ArrayList
at myCollecton.add
...

i.e. It was creating a new ArrayList, then trying to add it
into the parent collection instead of using the parent collection as a collection.

I tracked the problem down to where the ValueList always created a new ArrayList. Avoiding constructing of the ValueList meant it uses
my collection as a collection.

NOTE: This was a generic (it checks the types on add hence the ClassCast)
custom collection.

View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3977238#3977238

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3977238



More information about the jboss-dev-forums mailing list