-
-
Notifications
You must be signed in to change notification settings - Fork 767
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
ICU-22303 Support parsing infinity/NaN when decimal pattern match is required #2427
base: main
Are you sure you want to change the base?
ICU-22303 Support parsing infinity/NaN when decimal pattern match is required #2427
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Praise: Clean solution consistent with the architecture of NumberParser
There was a problem hiding this 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 too. I'll merge in a day or so, to give Markus time to check for CLAs.
93a09e9
1bdfa13
to
93a09e9
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
FYI, this PR had some merge conflicts due to the mavenization of the repo. I rebased onto the latest main branch with no changes needed and force pushed to resolve the conflicts. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fix still looks good.
…required If a DecimalFormat pattern contains a decimal point and setDecimalPatternMatchRequired is true, then DecimalFormat parse() fails to parse infinity/NaN representations. This is because infinity/NaN parsing does not set the HAS_DECIMAL_SEPARATOR_FLAG and so the RequireDecimalSeparatorValidator fails. This modifies the RequireDecimalSeparatorValidator so that it does not fail if the INFINITY or NAN flags are set, making it so decimal separators are not required if the infinity/NaN representations are parsed.
93a09e9
to
e7ca1a2
Compare
Notice: the branch changed across the force-push!
~ Your Friendly Jira-GitHub PR Checker Bot |
FYI, this PR was quite a bit behind main so I rebased it onto the latest master. |
If a DecimalFormat pattern contains a decimal point and setDecimalPatternMatchRequired is true, then DecimalFormat parse() fails to parse infinity/NaN representations. This is because infinfity/NAn parsing does not set the HAS_DECIMAL_SEPARATOR_FLAG and so the RequireDecimalSeparatorValidator fails.
This modifies the RequireDecimalSeparatorValidator so that it does not fail if the INFINITY or NAN flags are set, making it so decimal separators are not required if the infinity/NaN representations are parsed.
Checklist