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 #1757 and #2105: honor global default inclusion setting #2108

Closed
wants to merge 1 commit into from
Closed

Fix #1757 and #2105: honor global default inclusion setting #2108

wants to merge 1 commit into from

Conversation

bwaldvogel
Copy link

This fixes a regression that was introduced with 75098b7.

@cowtowncoder
Copy link
Member

I don't think this is correct. Could you please explain the logic for change?

This fixes a regression that was introduced with 75098b7.
@bwaldvogel
Copy link
Author

In 75098b7 you introduced the new flag _useRealPropertyDefaults which indicates if POJO property defaults are used to decide if a value should be suppressed for (de-)serialization.

As you mention in a comment, there are 3 possible levels of default inclusion definition/overrides:
(a) global
(b) per-type
(c) per-property

As far as I understand, the calculation of _useRealPropertyDefaults only takes (b) into account. Thus, a globally configured default inclusion (a) doesn’t work (anymore) and leads to the behavior change that was reported in #1757 and #2105. It is also shown by the new test case in my pull request.

My suggested fix sets _useRealPropertyDefaults to the merged combination of (a)+(b) instead of just using (b).

My suggested change doesn’t break an existing test in jackson-databind.
Do you have a specific situation in mind where you think this change is not correct?

@bwaldvogel
Copy link
Author

@cowtowncoder: Thanks for clarifying your point of view.

Sorry for the misunderstanding on my side. I didn’t expect that this behavior change was actually intended in a bug-fix release (2.8.3) and I didn’t notice that the documentation was changed in 2.7.0.

It would be nice if there would be a unit test for it and a hint in the release notes.

@bwaldvogel bwaldvogel closed this Aug 27, 2018
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.

2 participants