Skip to content

Fix for failing Guava Optional test - #136

Merged
cowtowncoder merged 3 commits into
FasterXML:2.17from
mukham12:guava_failing_test_fix
Dec 18, 2023
Merged

Fix for failing Guava Optional test#136
cowtowncoder merged 3 commits into
FasterXML:2.17from
mukham12:guava_failing_test_fix

Conversation

@mukham12

Copy link
Copy Markdown
Contributor

No description provided.

@mukham12

mukham12 commented Dec 16, 2023

Copy link
Copy Markdown
Contributor Author

I am guessing the same would need to be done for jackson-modules-java8 repo as well, Tatu?

…uavaBeanSerializerModifier.java

Co-authored-by: Kim, Joo Hyuk <beanskobe@gmail.com>
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) {

@cowtowncoder cowtowncoder Dec 18, 2023

Copy link
Copy Markdown
Member

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.

Copy link
Copy Markdown
Contributor Author

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 :)

@cowtowncoder
cowtowncoder merged commit 968d981 into FasterXML:2.17 Dec 18, 2023
@cowtowncoder cowtowncoder changed the title Fix for failing Guava Optional test Fix for failing Guava Optional test Dec 18, 2023
cowtowncoder added a commit that referenced this pull request Dec 18, 2023
@mukham12
mukham12 deleted the guava_failing_test_fix branch December 18, 2023 02:25
@cowtowncoder

Copy link
Copy Markdown
Member

Merged for inclusion in 2.17.0. Thank you @mukham12 !

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

Successfully merging this pull request may close these issues.

3 participants