History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XSTR-351
Type: Bug Bug
Status: Closed Closed
Resolution: Duplicate
Assignee: Unassigned
Reporter: Kenny Lai
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
XStream

XStream with Dom4J driver fail to handle self object reference

Created: 06/Oct/06 11:49 PM   Updated: 07/Oct/06 05:07 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.x Maintenance

File Attachments: 1. Java Source File XStreamCyclicReferenceTest.java (2 kb)

Issue Links:
Duplicate
 

JDK version and platform: sun jdk 1.5.0_07 for windows


 Description  « Hide
marshal object with follow member create wrong reference attribute in xml file
wrong xml output only occurs if dom4j driver is used.

class BadSelfReference implements Serializable {
private static final long serialVersionUID = 38772160335615698L;
private BadSelfReference owner = this;
private String aString = "1234";
private Long aLong = new Long(500);
// getter setter omitted
}

output
<testcase.BadSelfReference>
<owner reference=".."/>
<aString reference="..">1234</aString>
<aLong>500</aLong>
</testcase.BadSelfReference>

how ever, the following class can marshal correctly

class GoodSelfReference implements Serializable {
private static final long serialVersionUID = 38772160335615698L;
private String aString = "1234";
private Long aLong = new Long(500);
private GoodSelfReference owner = this;
// getter setter omitted
}

output

<testcase.GoodSelfReference>
<aString>1234</aString>
<aLong>500</aLong>
<owner reference=".."/>
</testcase.GoodSelfReference>



 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Joerg Schaible - 07/Oct/06 05:07 AM