From fb70c7c06c5118eea00d61a63f23ec2a5b86eeb5 Mon Sep 17 00:00:00 2001 From: Shai Erera Date: Sun, 17 Jul 2011 06:00:30 +0000 Subject: [PATCH] random.nextInt does not take '0' as a valid argument, so ensure numBits is never 0 git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1147534 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java b/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java index b9344f55468..181e28f32bd 100644 --- a/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java +++ b/lucene/src/test/org/apache/lucene/util/TestFixedBitSet.java @@ -197,7 +197,7 @@ public class TestFixedBitSet extends LuceneTestCase { */ public void testEquals() { - final int numBits = random.nextInt(2000); + final int numBits = random.nextInt(2000) + 1 /* numBits cannot be 0 */; FixedBitSet b1 = new FixedBitSet(numBits); FixedBitSet b2 = new FixedBitSet(numBits); assertTrue(b1.equals(b2));