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

Parse numbers as BigDecimal or BigInteger when needed. #766

Merged
merged 3 commits into from
Apr 12, 2021

Conversation

srchase
Copy link
Contributor

@srchase srchase commented Apr 8, 2021

Currently, numbers greater than 9223372036854775807 fail to be parsed from the IDL with NumberFormatException, even when the underlying implementation supports BigDecimal and BigInteger.

This PR updates the IdlModelParser and NodeHandler to use fall back to using BigDecimal or BigInteger where appropriate.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@srchase srchase changed the title Catch NumberFormatException to parse numbers as BigDecimal Parse numbers as BigDecimal or BigInteger when needed. Apr 9, 2021
Comment on lines +189 to +195
"com.example#bDecimal": 2E+308
}
},
"com.example#Z": {
"type": "string",
"traits": {
"com.example#bDecimal": 2E+308
Copy link
Contributor

Choose a reason for hiding this comment

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

I think one of these was supposed to use a lowercase e

@srchase srchase merged commit 2c0f6b4 into main Apr 12, 2021
@mtdowling mtdowling deleted the fix-parse-big-decimals branch April 21, 2021 05:00
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