mirror of https://github.com/apache/lucene.git
SOLR-10796: TestPointFields.testDoublePointFieldRangeFacet(): Guard against converting a double-valued '-Infinity' to BigDecimal
This commit is contained in:
parent
3f9e748202
commit
cff5e98583
|
@ -615,7 +615,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
|
|||
max = sortedValues.get(sortedValues.size() - 1);
|
||||
buffer = BigDecimal.valueOf(max).subtract(BigDecimal.valueOf(min))
|
||||
.divide(BigDecimal.valueOf(numValues / 2), RoundingMode.HALF_UP).doubleValue();
|
||||
gap = BigDecimal.valueOf(max + buffer).subtract(BigDecimal.valueOf(min - buffer))
|
||||
gap = BigDecimal.valueOf(max).subtract(BigDecimal.valueOf(min)).add(BigDecimal.valueOf(buffer * 2.0D))
|
||||
.divide(BigDecimal.valueOf(numBuckets), RoundingMode.HALF_UP).doubleValue();
|
||||
} while (max >= Double.MAX_VALUE - buffer || min <= -Double.MAX_VALUE + buffer);
|
||||
// System.err.println("min: " + min + " max: " + max + " gap: " + gap + " buffer: " + buffer);
|
||||
|
|
Loading…
Reference in New Issue