Skip to content

Apache Lucene open-source search software

LUCENE-4410: use thread local random to prevent exceptions when threads share the same FilterStrategy

Simon Willnauerbcb88e741eaf
diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java b/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java
index a4947c5e2c6..a5d105b497e 100644
--- a/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java
+++ b/lucene/test-framework/src/java/org/apache/lucene/util/_TestUtil.java
@@ -991,7 +991,7 @@ public class _TestUtil {
return new FilteredQuery.RandomAccessFilterStrategy() {
@Override
protected boolean useRandomAccess(Bits bits, int firstFilterDoc) {
- return random.nextBoolean();
+ return LuceneTestCase.random().nextBoolean();
}
};
case 3: