-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Failure to read AnnotatedField value in Jackson 2.11 #2789
Comments
Thank you for reporting this. It sounds like forcing of access is skipped for field It seems bit odd that |
This paradigm is common in the codebase I am working on; there are no setter methods. As such, it's easier to just place the annotations on the field directly so things are common between serialization and deserialization. Do you want me to take a stab at fixing it or do you already have a fix in mind? |
Ok. I am just asking because in this case it would seem preferable that getter was used for value access; normally this would just work with naming convention but here I do not have a fix in mind so feel free to propose a fix if that is easy enough to find. |
Just as a heads up I have not forgotten about this; the library upgrades that update my dependency on Jackson from 2.9.10 to 2.11.1 got sidelined for a little bit for a pressing business need. I'll take care of this next week once I get this change out the door. |
As per commit, added failing test from example above; might have a look to see if I can track down thge problem. |
Looks like the problem is due to short-circuit in if (_properties == null || _properties.isEmpty()) {
if (_anyGetter == null && _objectIdWriter == null) {
return null;
}
...
}
// ....
if (_typeId != null) { // force access
} which will prevent |
Fixed: specifically occurred only when there are no properties to write (not any-getter); will now modify access for typeId first (if any). |
Wow, thanks! I appreciate the fix! |
I am reporting this issue for tracking purposes; I fully intend to submit a PR once I narrow down the root cause and come up with an acceptable fix.
Version Information
Thankfully, this is failing in my unit tests on both my build environments so that makes this easy to debug.
EDIT: This test works fine with Jackson 2.9.10 (with 2.9.10.4).
The text was updated successfully, but these errors were encountered: