Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Critical Critical
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.6
    • Component/s: Core
    • Labels:
      None

      Description

      Code below:

      import com.thoughtworks.xstream.*;

      class MultRef
      {
      public Object s1 = new Object();
      public Object s2 = s1;
      }

      public class Test2
      {

      public static void main(String[] args)

      { MultRef multRef1 = new MultRef(); if (multRef1.s1 == multRef1.s2) System.out.println("multRef1: References"); else System.out.println("multRef1: NOT References"); XStream xstream = new XStream(); String xml = xstream.toXML(multRef1); System.out.println(xml); MultRef multRef2 = (MultRef)xstream.fromXML(xml); if (multRef2.s1 == multRef2.s2) System.out.println("multRef2: References"); else System.out.println("multRef2: NOT References"); }

      }

      Currently produces:

      multRef1: References
      <MultRef>
      <s1/>
      <s2 reference="../s1"/>
      </MultRef>
      multRef2: NOT References // WRONG!

      Reported by Jim Gentilesco.

        People

        • Assignee:
          Unassigned
          Reporter:
          Joe Walnes
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: