[xstream-user] Request for small change in ReflectionConverter.java

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[xstream-user] Request for small change in ReflectionConverter.java

Björn Walther
Hello
 
We are using Hibernate to manage persistence and Hibernate has its own proyx classes that implements the java.util.List interface. The ReflectionConverter tries to cast collections to ArrayList which obviously is not compatible with the Hibernate implementations resulting in a ClassCastException. Changing ReflectionConverter to cast to a java.util.List instead of the ArrayList (line 50) solves our problem. We also believe that it is more correct to use the interface instead of the concrete implementation.
 
Would it be possibe to incorporate this small change in new versions?
 
Thanks
Björn Walther
Sogeti Sweden
 
 
Reply | Threaded
Open this post in threaded view
|

[xstream-user] Re: Request for small change in ReflectionConverter.java

Mauro Talevi
Bj?rn Walther wrote:
> Hello
>  
> We are using Hibernate to manage persistence and Hibernate has its own proyx classes that implements the java.util.List interface. The ReflectionConverter tries to cast collections to ArrayList which obviously is not compatible with the Hibernate implementations resulting in a ClassCastException. Changing ReflectionConverter to cast to a java.util.List instead of the ArrayList (line 50) solves our problem. We also believe that it is more correct to use the interface instead of the concrete implementation.
>  
> Would it be possibe to incorporate this small change in new versions?
>  

Don't see any problem in implementing this change.
Can you please raise a jira issue for this to help us track changes.

Cheers