History | Log In     View a printable version of the current page.  
Issue Details (XML | Word | Printable)

Key: XSTR-250
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Assignee: Unassigned
Reporter: Tushar Phadke
Votes: 2
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
XStream

XStream is throwing NullPointerException

Created: 13/Oct/05 07:12 AM   Updated: 21/Sep/06 03:46 AM
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2

Issue Links:
Duplicate
 

JDK version and platform: JDK1.4


 Description  « Hide
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)


 All   Comments   Change History      Sort Order: Ascending order - Click to sort in descending order
Mauro Talevi - 13/Oct/05 07:36 AM
Could you please add a test to c.t.xstream.XStreamTest and attach the patch to this issue?

Thanks!
 

Joerg Schaible - 20/Mar/06 06:06 PM
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

dummy001 - 21/Sep/06 03:35 AM

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

Joerg Schaible - 21/Sep/06 03:46 AM
As stated, it is fixed for version 1.2 ...