-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NullPointerException fix #61
base: master
Are you sure you want to change the base?
Conversation
@schurik, both Your commits contain lots of formatting changes that every other developer might want to reformat according to their preferences. Could undo the formatting changes? I'm also wondering in which situation that NPE reveals itslef. There are lots of tests for jackson module, probably I've missed smth. |
@atsu85 I will undo the formatting changes. |
@schurik, thanks for undoing the formatting changes. I tried to quickly reproduce the issue this PR should address, but i probably tried smth different, as everything seemed to work well, when I added public XMLGregorianCalendar _XMLGregorianCalendar; to DefinitionGeneratorTest.TestClass, the output included the field with
What did You do differently? Perhaps You could even create/update the test for this issue Yourself? |
In my case my model needs to be serialized as JSON and/or XML. My property has an addition This is my setup: and the output is: and while serializing _someDate I get NPE without the null check |
@schurik, thanks, I'll add the test myself. |
Hi @schurik, I had pretty-much forgotten this after failing to reproduce the NPE You reported and tried to fix with this PR. Please see my comments from the commit that tries to create the test for reproducing the NPE. Please help me to figure out how to reproduce this issue, so the test could be updated and i could merge the fix. |
in com.fasterxml.jackson.databind.ext.CoreXMLSerializers the visitor is passed with a null as JavaType. Because of this a NPE could be thrown in TSJsonFormatVisotorWrapper.expectStringFormat(null)