From 9f29e330542524d817c2fa4794af447cf6a1d1d4 Mon Sep 17 00:00:00 2001 From: Mike McCandless Date: Sat, 5 Mar 2016 04:57:14 -0500 Subject: [PATCH] fix very rare test bug that I somehow hit --- .../org/apache/lucene/facet/range/TestRangeFacetCounts.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java index e7e5d572088..9fde6e3ed9f 100644 --- a/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java +++ b/lucene/facet/src/test/org/apache/lucene/facet/range/TestRangeFacetCounts.java @@ -421,7 +421,10 @@ public class TestRangeFacetCounts extends FacetTestCase { } boolean minIncl; boolean maxIncl; - if (min == max) { + + // NOTE: max - min >= 0 is here to handle the common overflow case! + if (max - min >= 0 && max - min < 2) { + // If max == min or max == min+1, we always do inclusive, else we might pass an empty range and hit exc from LongRange's ctor: minIncl = true; maxIncl = true; } else {