XStream
  1. XStream
  2. XSTR-277

call to XStream constructor with Class Mapper results in Null Pointer

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      14

      Description

      Using an API from < 1.1.2 where a Class Mapper is passed into the XStream constructor now results in a null pointer.
      To wit:
      Caused by: java.lang.NullPointerException
      at com.thoughtworks.xstream.XStream.alias(XStream.java:531)
      at com.thoughtworks.xstream.XStream.setupAliases(XStream.java:239)
      at com.thoughtworks.xstream.XStream.<init>(XStream.java:194)
      at com.thoughtworks.xstream.XStream.<init>(XStream.java:181)

      The constructor calls setupAliases, which calls alias(String, Class) for a predetermined set of aliases.
      However, the method alias uses the field 'classAliasingMapper', which is ONLY set in the buildMapper method, which is NOT called when the constructor is given a class mapper.

        Issue Links

          People

          • Assignee:
            Unassigned
            Reporter:
            Robert O'Connell
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: