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

Remove unnecessary NaN checks from LongRange#verifyAndEncode #12008

Merged
merged 3 commits into from
Dec 11, 2022

Conversation

gsmiller
Copy link
Contributor

Description

Minor tweak to logic that appears to have been copy/pasted from DoubleRange.

Copy link
Member

@rmuir rmuir left a comment

Choose a reason for hiding this comment

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

thanks, really crazy. We may want to investigate other places where we inadvertently do this, by uncommenting this line and setting to WARN and running gradlew check -Dvalidation.errorprone=true. I can't remember how many violations we have across the codebase: https://github.com/apache/lucene/blob/main/gradle/validation/error-prone.gradle#L381

@rmuir
Copy link
Member

rmuir commented Dec 10, 2022

I think we should open a followup issue to look into this check. I enabled the check (without your patch) to make sure it finds this bug, and it did, and it also finds other stuff:
log.txt

I think if we really intend to cast a long to a double, we can do it explicitly.

@gsmiller
Copy link
Contributor Author

gsmiller commented Dec 11, 2022

@rmuir done: #12009 . Thanks for the suggestion!

@gsmiller gsmiller merged commit e34234c into apache:main Dec 11, 2022
@gsmiller gsmiller deleted the GH/longpoint-validation-tweak branch December 11, 2022 20:55
@rmuir rmuir added this to the 9.5.0 milestone Jan 17, 2023
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