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

Fix for failing Guava Optional test #136

Merged
merged 3 commits into from Dec 18, 2023

Conversation

mukham12
Copy link
Contributor

No description provided.

@mukham12
Copy link
Contributor Author

mukham12 commented Dec 16, 2023

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>
@@ -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) {
Copy link
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
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
4 checks passed
@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
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.

None yet

3 participants