XStream
  1. XStream
  2. XSTR-655

Externalizable classes generate wrong JSON

    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: Converters
    • Labels:
      None
    • JDK version and platform:
      1.6.0_20

      Description

      When converting a class that implements Externalizable with XStream, JSON with duplicate keys is generated.

        {
          "string": "文件名 +().mp3",
          "long": 690037,
          "null": {},
          "long": 0,
          "null": {},
          "double": 1.0,
          "null": {},
          "null": {}
        }
      

      Now, obj['long'] will be 0. I think you are looking for something like this:

        [
          [ "string", "文件名 +().mp3" ],
          [ "long", 690037 ],
          [ "null", {} ],
          [ "long", 0 ],
          [ "null", {} ],
          [ "double", 1.0 ],
          [ "null", {} ],
          [ "null", {} ]
        ]
      

        People

        • Assignee:
          Jörg Schaible
          Reporter:
          Johann Burkard
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: