Jackson 2.16 fails attempting to obtain ObjectWriter
for an Enum
which some value returns null from toString()
#4355
Labels
2.16
Issues planned for 2.16
ObjectWriter
for an Enum
which some value returns null from toString()
#4355
Search before asking
Describe the bug
After upgrading to 2.16.1, I cannot obtain
ObjectWriter
for enum classes, which some of the value returnsnull
fromtoString()
.This used to work in 2.15.3
Version Information
2.16.0, 2.16.1
Reproduction
Following is the minimum JUnit 5 reproducer.
This works fine on 2.15.3 but exceptionally fails at
assertDoesNotThrow(..)
on 2.16.0 or 2.16.1.backtrace looks like:
Expected behavior
Be able to serialize Enums even though it's
#toString()
returnsnull
Additional context
Returning
null
fromtoString()
is probably bad practice, but such Enums are out there in the wild.From the 2.16.1 backtrace, it seems to be related to the change #4039
Building
EnumValues valuesByToString
regardless of theSerializationFeature.WRITE_ENUMS_USING_TO_STRING
config might be the issue?The text was updated successfully, but these errors were encountered: