-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Resolve minbound maxbound NullPointerException #64091
Resolve minbound maxbound NullPointerException #64091
Conversation
@@ -194,11 +194,17 @@ public HistogramAggregationBuilder offset(double offset) { | |||
|
|||
/** Get the current minimum bound that is set on this builder. */ | |||
public double minBound() { | |||
if (extendedBounds.getMin() == null) { | |||
return Double.NEGATIVE_INFINITY; |
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.
I think this should be other way around: POSITIVE_INFINITY
for min and NEGATIVE_INFiNITY
for max. Otherwise specifying null extended bounds would mean we want bounds to extend bounds to the entire range. This should be also consistent with the behaviour which was before this issues was introduced in #60556.
Please also note that extendedBounds themselves can be null, so I would suggest using DoubleBounds#getEffectiveMin
instead.
@elasticmachine test this please |
@elasticmachine update branch |
@elasticmachine test this please |
@elasticmachine run elasticsearch-ci/packaging-sample-unix |
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. Thank you for the contribution and working patiently on improving the PR!
Pinging @elastic/es-analytics-geo (:Analytics/Aggregations) |
Resolved nullPointerException in minbound and maxbound methods. Fixes elastic#62934
Resolved nullPointerException in minbound and maxbound methods. Fixes #62934 Co-authored-by: Alisha <[email protected]>
This PR resolves the NullPointerException when min/max bounds are set to null by returning -/+
Infinity