diff --git a/lucene/core/src/test/org/apache/lucene/util/TestOpenBitSet.java b/lucene/core/src/test/org/apache/lucene/util/TestOpenBitSet.java index 32e1b22baa0..4882bad72ef 100644 --- a/lucene/core/src/test/org/apache/lucene/util/TestOpenBitSet.java +++ b/lucene/core/src/test/org/apache/lucene/util/TestOpenBitSet.java @@ -349,7 +349,7 @@ public class TestOpenBitSet extends BaseDocIdSetTestCase { // test ensureCapacityWords int numWords = random().nextInt(10) + 2; // make sure we grow the array (at least 128 bits) bits.ensureCapacityWords(numWords); - bit = _TestUtil.nextInt(random(), 128, numWords << 6); // pick a higher bit than 128, but still within range + bit = _TestUtil.nextInt(random(), 127, (numWords << 6)-1); // pick a bit >= to 128, but still within range bits.fastSet(bit); assertTrue(bits.fastGet(bit)); bits.fastClear(bit);