XStream
  1. XStream
  2. XSTR-250

XStream is throwing NullPointerException

    Details

    • Type: Bug Bug
    • Status: Closed Closed
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.2
    • Component/s: None
    • Labels:
      None
    • JDK version and platform:
      JDK1.4

      Description

      The XStram is throing NullPointerException if XStream is instanciated with "XStream(ReflectionProvider reflectionProvider, ClassMapper classMapper, HierarchicalStreamDriver driver)" constructor.

      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)

        Issue Links

          Activity

          Hide
          Mauro Talevi added a comment -

          Could you please add a test to c.t.xstream.XStreamTest and attach the patch to this issue?

          Thanks!

          Show
          Mauro Talevi added a comment - Could you please add a test to c.t.xstream.XStreamTest and attach the patch to this issue? Thanks!
          Hide
          Jörg Schaible added a comment -

          Hi Tushar and Robert,

          it is now possible to use an own Mapper chain and provide it with the XStream ctor. The mappers are internally setup in a second step. If you omit mappers necessary for standard XStream functionality (such as the ClassAliasingMapper), you cannot use the appropriate XStream methods (e.g. XStream.alias), since XStream will throw an InitializationException. Please have a look at the latest SNAPSHOT, if the functionality meets your requirements now.

          • Jörg
          Show
          Jörg Schaible added a comment - Hi Tushar and Robert, it is now possible to use an own Mapper chain and provide it with the XStream ctor. The mappers are internally setup in a second step. If you omit mappers necessary for standard XStream functionality (such as the ClassAliasingMapper), you cannot use the appropriate XStream methods (e.g. XStream.alias), since XStream will throw an InitializationException. Please have a look at the latest SNAPSHOT, if the functionality meets your requirements now. Jörg
          Hide
          dummy001 added a comment -

          Jörg

          The Mapper chain functionality is not available with the XStream 1.1.x branch through - so surely this is still a valid bug?

          Can it not be fixed by refactoring the constructor to call buildMapper() with the user supplied mapper, otherwise with DefaultMapper?

          Niall

          Show
          dummy001 added a comment - Jörg The Mapper chain functionality is not available with the XStream 1.1.x branch through - so surely this is still a valid bug? Can it not be fixed by refactoring the constructor to call buildMapper() with the user supplied mapper, otherwise with DefaultMapper? Niall
          Hide
          Jörg Schaible added a comment -

          As stated, it is fixed for version 1.2 ...

          Show
          Jörg Schaible added a comment - As stated, it is fixed for version 1.2 ...

            People

            • Assignee:
              Unassigned
              Reporter:
              Tushar Phadke
            • Votes:
              2 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: