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
Fix for failing Guava Optional
test
#136
Conversation
I am guessing the same would need to be done for |
guava/src/main/java/com/fasterxml/jackson/datatype/guava/ser/GuavaBeanSerializerModifier.java
Outdated
Show resolved
Hide resolved
…uavaBeanSerializerModifier.java Co-authored-by: Kim, Joo Hyuk <beanskobe@gmail.com>
@@ -24,7 +28,13 @@ public List<BeanPropertyWriter> changeProperties(SerializationConfig config, | |||
{ | |||
for (int i = 0; i < beanProperties.size(); ++i) { | |||
final BeanPropertyWriter writer = beanProperties.get(i); | |||
if (Optional.class.isAssignableFrom(writer.getType().getRawClass())) { | |||
// [databind#0000] Since 2.17 : problem to solve + reason for matching Unwrapping....Writer | |||
if (writer instanceof UnwrappingBeanPropertyWriter) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh actually... shouldn't this only apply to Optional
type properties? I don't think we want to change standard UnwrappingBeanPropertyWriter for other types, otherwise it'd change behavior
So, I think this if statement should be inside if (Optional.class.isAssignableFrom(...))
, not at same level.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, excellent catch. I believe my initial PR was accurate. The error occurred when I attempted to rewrite it from memory the second time around. The issue has now been resolved. Thanks :)
Optional
test
Merged for inclusion in 2.17.0. Thank you @mukham12 ! |
No description provided.