SOLR-10796: TestPointFields.testDoublePointFieldRangeFacet(): Guard against converting a double-valued '-Infinity' to BigDecimal

This commit is contained in:
Steve Rowe 2017-08-05 10:59:11 -04:00
parent 3f9e748202
commit cff5e98583
1 changed files with 1 additions and 1 deletions

View File

@ -615,7 +615,7 @@ public class TestPointFields extends SolrTestCaseJ4 {
max = sortedValues.get(sortedValues.size() - 1); max = sortedValues.get(sortedValues.size() - 1);
buffer = BigDecimal.valueOf(max).subtract(BigDecimal.valueOf(min)) buffer = BigDecimal.valueOf(max).subtract(BigDecimal.valueOf(min))
.divide(BigDecimal.valueOf(numValues / 2), RoundingMode.HALF_UP).doubleValue(); .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(); .divide(BigDecimal.valueOf(numBuckets), RoundingMode.HALF_UP).doubleValue();
} while (max >= Double.MAX_VALUE - buffer || min <= -Double.MAX_VALUE + buffer); } while (max >= Double.MAX_VALUE - buffer || min <= -Double.MAX_VALUE + buffer);
// System.err.println("min: " + min + " max: " + max + " gap: " + gap + " buffer: " + buffer); // System.err.println("min: " + min + " max: " + max + " gap: " + gap + " buffer: " + buffer);