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

Property ignorals cause BeanDeserializer to forget how to read from arrays (not copying _arrayDelegateDeserializer) #3022

Closed
gianm opened this issue Jan 21, 2021 · 2 comments
Milestone

Comments

@gianm
Copy link

gianm commented Jan 21, 2021

Describe the bug
When withIgnorableProperties is called on an already-resolved BeanDeserializer that is meant to read from an array, it uses a constructor that does not copy _arrayDelegateDeserializer, and so the deserializer "forgets" how to read from an array.

This can happen is in createContextual if any ignorals are set. When the deserializer returned by createContextual is then used on an array, it throws an error that it can't read from a START_ARRAY token.

Version information
I am using Jackson 2.10.5 but the problem seems to still exist in the latest master.

To Reproduce
I don't have a minimized test case handy, but hopefully the summary is enough to write one.

@gianm gianm added the to-evaluate Issue that has been received but not yet evaluated label Jan 21, 2021
@cowtowncoder
Copy link
Member

cowtowncoder commented Jan 21, 2021

An actual test case will be needed, I hope to have time to eventually tackle this (since setup is non-trivial, with delegate array deserializer that typically gets added via @JsonCreator). It does sound like a bug, but fix needs to be verified.

Thank you for reporting the issue!

@cowtowncoder cowtowncoder added 2.12 need-test-case To work on issue, a reproduction (ideally unit test) needed and removed to-evaluate Issue that has been received but not yet evaluated labels Jan 21, 2021
@cowtowncoder cowtowncoder changed the title Property ignorals cause BeanDeserializer to forget how to read from arrays Property ignorals cause BeanDeserializer to forget how to read from arrays (not copying _arrayDelegateDeserializer) Jan 21, 2021
@cowtowncoder cowtowncoder removed the need-test-case To work on issue, a reproduction (ideally unit test) needed label Jan 27, 2021
@cowtowncoder cowtowncoder added this to the 2.11.5 milestone Jan 27, 2021
@cowtowncoder
Copy link
Member

Although ideally really should have a regression tests, figured out that writing one is non-trivial, and that there are a few codepaths to cover; but on the other hand fix is easy enough to verify in other ways (made field final, observe where it is not passed -- cannot remain final due to one limitation but works for quick validation).
So, made the fix without ability to verify which is not optimal, for now.

@cowtowncoder cowtowncoder modified the milestones: 2.11.5, 2.12.2 Mar 4, 2021
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

No branches or pull requests

2 participants