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

Fixed an issue that could cause unexpected behavior when an instance that inherits from StdValueInstantiator is passed to defaultInstantiator. #521

Merged
merged 6 commits into from
Nov 26, 2021

Conversation

k163377
Copy link
Contributor

@k163377 k163377 commented Nov 25, 2021

Reading the comments and the initialization process of the KotlinValueInstantiator, it looks like the defaultInstantiator of KotlinInstantiators.findValueInstantiator requires StdValueInstantiator.
On the other hand, this comparison is done with the is operator, which means that even if an instance that inherits StdValueInstantiator is passed, it will be treated as normal.

In this PR, this problem is fixed by comparing the Class.

Copy link
Member

@dinomite dinomite left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, would you add yourself a line in the CREDITS-2.x file?

@dinomite
Copy link
Member

I wrote a test for this, so I added the credits line. Merging now!

@dinomite dinomite merged commit 1bc121d into FasterXML:2.13 Nov 26, 2021
@k163377 k163377 deleted the fix-findValueInstantiator branch January 9, 2022 09:11
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