Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: None
-
Labels:None
-
JDK version and platform:1.5.0_11 windows
Description
A class field like this
@XStreamImplicit
private List<PersistedNode<V>> nodes = new ArrayList<PersistedNode<V>>();
causes a ClassCastException in method
com.thoughtworks.xstream.annotations.Annotations.getFieldParameterizedType(Field, XStream) [line 226]
because the result returned by ParameterizedType.getActualTypeArguments()[0] is of type java.lang.reflect.ParameterizedType, not java.lang.Class.
The workaround is to use raw types and unchecked casts.
Issue Links
- duplicates
-
XSTR-425 NPE thrown when @XStreamImplicit is used on collection with interface parameter type