Skip to content

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

Merged
dinomite merged 6 commits into
FasterXML:2.13from
k163377:fix-findValueInstantiator
Nov 26, 2021
Merged

Fixed an issue that could cause unexpected behavior when an instance that inherits from StdValueInstantiator is passed to defaultInstantiator.#521
dinomite merged 6 commits into
FasterXML:2.13from
k163377:fix-findValueInstantiator

Conversation

@k163377

@k163377 k163377 commented Nov 25, 2021

Copy link
Copy Markdown
Contributor

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.

@dinomite dinomite left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
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