XStream
  1. XStream
  2. XSTR-399

null String array field deserialized incorrectly

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Cannot Reproduce
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      Sun 1.5.0_03 for Windows

      Description

      A String array field is declared in a class as follows:
      private String[] setPointCmds;

      In an instance of this class, the field is initialised to null, then serialised by XStream:
      setPointCmds = null;
      ...
      x = new XStream();
      x.toXML(instance, outputStream);

      The output is for that field is:
      <setPointCmds>
      <null/>
      </setPointCmds>

      When this is deserialized, it creates an instance of the class with the field setPointCmds set to an array of length one with the value at index 0 equal to null, instead of being initialised to null.

        People

        • Assignee:
          Unassigned
          Reporter:
          Bruce Sutherland
        • Votes:
          0 Vote for this issue
          Watchers:
          0 Start watching this issue

          Dates

          • Created:
            Updated:
            Resolved: