Menu ▾ ▴

#2 Null-Pointer Exception on null-String (Java)

open
nobody
None
5
2012-09-19
2012-09-19
Anonymous
No

I'm trying to serialize an object with an nullable String member.
I'd expect:
- serialized to empty tag
What I get:
- Nullpointer-exception and analog comment in XML

Version:
1.0

Additional Information:
I pinpointed it to the following lines:

SimpleWriter

461 else if (mapJavaToWOX.get(fields[i].getType())!=null){
462 String woxType = (String)mapJavaToWOX.get(value.getClass());
^^^^
null, therefore Exception

I guess a check for Null-Pointer is missing.

With kind regards

Discussion

  • Anonymous

    Anonymous - 2012-09-19
    • summary: Null-Pointer Exception on null-String --> Null-Pointer Exception on null-String (Java)
     

Log in to post a comment.