Skip to content
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

READ_ENUMS_USING_TO_STRING doesn't support null values #2309

Closed
andersonbd1 opened this issue Apr 20, 2019 · 7 comments
Closed

READ_ENUMS_USING_TO_STRING doesn't support null values #2309

andersonbd1 opened this issue Apr 20, 2019 · 7 comments
Milestone

Comments

@andersonbd1
Copy link

The test added in EnumDeserializationTest.java fails w/out the fix in EnumResolver.java.

https://github.com/FasterXML/jackson-databind/pull/2307/files

@andersonbd1
Copy link
Author

pull request for the fix is here:
#2307

@andersonbd1
Copy link
Author

issue posted to facebook-java-business-sdk as well:
facebook/facebook-java-business-sdk#235

@cowtowncoder
Copy link
Member

But is it even legal to return null from toString()?

I guess I could instead throw an exception to indicate bad return value. I am not sure I'm comfortable coercing null into "", although that is a reasonable suggestion in general.

@andersonbd1
Copy link
Author

@cowtowncoder - any word on this? I'm not saying my solution is the best/most correct, but can you introduce a way to make the failing test (that I demonstrate) work?

@cowtowncoder
Copy link
Member

@andersonbd1 I haven't had time to look but I'll add this to my todo list for another glance. Thank you for reminder.

@andersonbd1
Copy link
Author

Thanks @cowtowncoder . I just got a reply from facebook here - facebook/facebook-java-business-sdk#235 (comment)

Sounds like they're more concerned about supporting gson.

@cowtowncoder
Copy link
Member

@andersonbd1 that makes sense wrt Facebook, they don't really need to worry about json handling performance. :)

But regardless I am interested in Jackson side of things.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants