XStream
  1. XStream
  2. XSTR-178

Serialized inner class does not contain reference to outerclass.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.1
    • Component/s: None
    • Labels:
      None

      Description

      public class Outer {

      private String message;
      public Inner inner = new Inner();

      public Outer(String message)

      { this.message = message; }

      public class Inner {
      public void doStuff()

      { System.out.println(message); }


      }

      }

      Outer outer = new Outer("hello");
      Inner inner = outer.inner();

      inner.doStuff(); // prints "hello"

      // serialize and deserialize
      Inner inner2 = xstream.fromXml(xstream.toXml(inner));

      inner.doStuff(); // prints null

        People

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

          Dates

          • Created:
            Updated:
            Resolved: