Hi Dirk,

Dirk Schnelle-Walka wrote:

> Hey Jörg,
> 
> thanks for the quick answer. I wrote a unit test and it worked for me as
> well. Now, I digged into it and found the reason for this strange
> behavior. I had another class that was used prior to the array container
> for primitives annotated with @XStreamAlias("short").
> 
> So, I assume that this changed the way, how short primitives were
> handled in general. I changed it to @XStreamAlias("shortprimitive") and
> it worked.

XStream sets up quite some aliases for the types it handles (see code of 
XStream.setupAliases()). Normally you have a 1:1 relation between alias and 
type, but you can define 1:N. At marshalling time multiple types will be 
represented then with the same alias (this is what XStream.aliasType does 
for a type hierarchy), but at unmarshalling time the last definition is used 
to "convert" from the alias to the type again.

Regards,
Jörg



---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Reply via email to