XStream
  1. XStream
  2. XSTR-640

JettisonMappedXmlDriver does not correctly serialise java.util.TreeMap

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 1.3.1
    • Fix Version/s: 1.4
    • Component/s: IO
    • Labels:
      None

      Description

      Executing the following unit test against the svn trunk produces an assertion error and prints the json:
      {"tree-map":

      {"no-comparator":[""]}

      ,"entry":{"string":["a","b"]}}
      It seems the "entry" element should be part of the "tree-map" element, rather than at the top level

      public void testTreeMap()

      { TreeMap map = new TreeMap(); map.put("a", "b"); XStream xstream = new XStream(new JettisonMappedXmlDriver()); String json = xstream.toXML(map); System.out.println(json); Object o = xstream.fromXML(json); assertEquals(map, o); }

        Issue Links

          People

          • Assignee:
            Jörg Schaible
            Reporter:
            Travis Dixon
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: