Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.0
-
Fix Version/s: 1.0
-
Component/s: None
-
Labels:None
-
Environment:java 1.5, macOSX
-
Testcase included:yes
-
Number of attachments :
Description
array serialization inconsistent between array size=1 and size>1, see the following test snippet
public static void main(String[] args) {
class A{
int n;
}
A a =new A();
a.n=5;
A b =new A();
b.n=6;
A[] array=new A[]{a};
XStream xstream=XStreamDispenser.getJSONXStream();
System.out.println(xstream.toXML(array));
A[] array2=new A[]{a,b};
System.out.println(xstream.toXML(array2));
}
The first output is missing the '[' ']' which indedicates to the reader of an array of size 1.
Any chance you can submit tests/code that show this behavior using Jettison directly instead of XStream?