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

Deserialize integer/long JSON into double single-arg constructors #4474

Merged
merged 5 commits into from
Apr 10, 2024

Conversation

davidmoten
Copy link
Contributor

@davidmoten davidmoten commented Apr 8, 2024

As discussed in #4453

This PR ensures that deserialization of integer/long json like 5 or 12345678901 occurs without error when the target class has a single argument constructor of argument type double. This ensures consistency with the treatment by Jackson of deserialization into multi-arg constructors (annotated with @JsonProperty).

Tests provided give full coverage of changed code and I've also tested that expected preferences are applied when multiple constructors are available.

Note that other types (like float at least) will be handled in another PR.

@davidmoten davidmoten changed the title Deserialize int/long into double single-arg constructors Deserialize integer/long JSON into double single-arg constructors Apr 8, 2024
@cowtowncoder cowtowncoder added the cla-needed PR looks good (although may also require code review), but CLA needed from submitter label Apr 8, 2024
@cowtowncoder
Copy link
Member

Thank you! I hope to review this soon, get it merged.

ONe process thing: if we haven't yet gotten a CLA (only needs to be done once so if there is one, that's good), we'd need one from:

https://github.com/FasterXML/jackson/blob/master/contributor-agreement.pdf

and the usual way is to print it, fill & sign, scan/photo, email to cla at fasterxml dot com.
Once it's done I can proceed with merge & cla is good for any and all future contributions.

@davidmoten
Copy link
Contributor Author

contributor agreement has been sent

@cowtowncoder
Copy link
Member

CLA received, hoping to merge tomorrow. Thank you for sending CLA so quickly!

@cowtowncoder cowtowncoder removed the cla-needed PR looks good (although may also require code review), but CLA needed from submitter label Apr 10, 2024
Copy link
Member

@cowtowncoder cowtowncoder left a comment

Choose a reason for hiding this comment

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

LGTM

@cowtowncoder
Copy link
Member

Ok looks good but will need to wait until tomorrow to merge (ran out of time tonight, wrt merge to master/3.0).

@cowtowncoder cowtowncoder merged commit 884af2e into FasterXML:2.18 Apr 10, 2024
4 checks passed
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