Details
-
Type: Bug
-
Status: Closed
-
Priority: Major
-
Resolution: Duplicate
-
Affects Version/s: 1.2.2
-
Fix Version/s: None
-
Component/s: Annotations
-
Labels:None
-
JDK version and platform:Sun 1.6.0_04 on Linux
Description
When using Annotations to structure the XML output, I have run across a "NullPointerException"
Stack information:
java.lang.NullPointerException
at com.thoughtworks.xstream.annotations.Annotations.getFieldParameterizedType(Annotations.java:232)
at com.thoughtworks.xstream.annotations.Annotations.configureClass(Annotations.java:161)
at com.thoughtworks.xstream.annotations.Annotations.configureAliases(Annotations.java:49)
Upon digging a bit into the source, it appears there should at least be a null check in the "Annotations.getFieldParameterizedType(Annotations.java:232)" method, with a more descriptive error (if it IS an error) relayed to the user.
Issue Links
- duplicates
-
XSTR-425 NPE thrown when @XStreamImplicit is used on collection with interface parameter type
A little more digging shows that Implicit Collections cause this one...
@XStreamImplicit(itemFieldName="history")
private SortedSet<IHistoryItem> statusHistory;
where "SortedSet" is an interface, and IHistoryItem is also an interface.