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

[fastserde] Fix issue with generating schema fingerprint when NaN is default value. #511

Merged
merged 1 commit into from
Aug 30, 2023

Conversation

krisso-rtb
Copy link
Contributor

No description provided.

Comment on lines -220 to +219
if (!isAMathematicalInteger(numericValue)) {
if (!isAMathematicalInteger(defaultValue.getDecimalValue())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Is this the fix? I don't understand... isn't the code equivalent?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

If defaultType is DOUBLE or FLOAT and genericDefaultValue represents NaN then calling genericDefaultValue.decimalValue() is

  • not needed
  • throws NumberFormatException

In other words it's called too early.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Oooh I see. Ok, cool. Thanks for explaining, good catch.

Copy link
Collaborator

@FelixGV FelixGV left a comment

Choose a reason for hiding this comment

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

Thanks!

Comment on lines -220 to +219
if (!isAMathematicalInteger(numericValue)) {
if (!isAMathematicalInteger(defaultValue.getDecimalValue())) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Oooh I see. Ok, cool. Thanks for explaining, good catch.

@FelixGV FelixGV merged commit 4640b55 into linkedin:master Aug 30, 2023
2 checks passed
@krisso-rtb krisso-rtb deleted the bugfix/NaN-as-default branch August 30, 2023 15:50
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