jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • XStream
  • XSTR-351

XStream with Dom4J driver fail to handle self object reference

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Resolution: Duplicate
  • Affects Version/s: None
  • Fix Version/s: 1.x Maintenance
  • Component/s: None
  • Labels:
    None
  • JDK version and platform:
    sun jdk 1.5.0_07 for windows

Description

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>

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Java Source File
    XStreamCyclicReferenceTest.java
    06/Oct/06 11:49 PM
    2 kB
    Kenny Lai

Issue Links

duplicates

Bug - A problem which impairs or prevents the functions of the product. XSTR-345 Dom4JWriter.addAttribute work incorrect

  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • History
  • Activity
Hide
Permalink
Joerg Schaible added a comment - 07/Oct/06 5:07 AM

See XSTR-345

Show
Joerg Schaible added a comment - 07/Oct/06 5:07 AM See XSTR-345

People

  • Assignee:
    Unassigned
    Reporter:
    Kenny Lai
Vote (0)
Watch (0)

Dates

  • Created:
    06/Oct/06 11:49 PM
    Updated:
    07/Oct/06 5:07 AM
    Resolved:
    07/Oct/06 5:07 AM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.