XStream
  1. XStream
  2. XSTR-155

Circular reference seems not to work.

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Won't Fix
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None

      Description

      Testcase:
      public void testConverter()

      { XStream xstream=new XStream(); xstream.setMode(XStream.ID_REFERENCES); InputStream is=ReferentieObjectConverterTest.class.getClassLoader().getResourceAsStream("Gebruikers.xml"); ReferentieObjectConverter converter=new ReferentieObjectConverter(); converter.setPersister(persister); xstream.registerConverter(converter); String xml = FileUtil.readStream(is); Object obj=xstream.fromXML(xml); System.out.println(obj); }

      Gebruikers.xml

      <java.util.ArrayList>

      <nl.politie.isc.h2o.framework.service.mock.domein.Kind id="nl.politie.isc.h2o.framework.service.mock.domein.Kind_1">
      <id>1</id>
      <naam>kindnaam </naam>
      <moeder reference="nl.politie.isc.h2o.framework.service.mock.domein.Moeder_1"/>
      </nl.politie.isc.h2o.framework.service.mock.domein.Kind>

      <nl.politie.isc.h2o.framework.service.mock.domein.Moeder id="nl.politie.isc.h2o.framework.service.mock.domein.Moeder_1">
      <id>1</id>
      <naam>moedernaam </naam>
      <kind reference="nl.politie.isc.h2o.framework.service.mock.domein.Kind_1"/>
      </nl.politie.isc.h2o.framework.service.mock.domein.Moeder>

      </java.util.ArrayList>

      In this case the 'Moeder' object has a reference to the 'Kind' object, but the other way arround the reference seems not to work only a null value can be found.

      It seems like I can only up in the xml document tree, but not down.

      What am I doing wrong. In the document circular reference is mentioned serveral times.

        People

        • Assignee:
          Unassigned
          Reporter:
          Pi Chen Lin
        • Votes:
          0 Vote for this issue
          Watchers:
          1 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: