From 86ca6f86d7a48c2e47c43cad65f8d80962452959 Mon Sep 17 00:00:00 2001 From: Michael McCandless Date: Sat, 8 Dec 2007 14:17:07 +0000 Subject: [PATCH] fix intermittent thread-safety failure in contrib/benchmark unit test git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@602475 13f79535-47bb-0310-9956-ffa450edef68 --- .../org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java b/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java index 80e6ce8436e..1043f0dd8b1 100755 --- a/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java +++ b/contrib/benchmark/src/test/org/apache/lucene/benchmark/byTask/TestPerfTasksLogic.java @@ -347,7 +347,7 @@ public class TestPerfTasksLogic extends TestCase { /** use reuters and the exhaust mechanism, but to be faster, add 20 docs only... */ public static class Reuters20DocMaker extends ReutersDocMaker { private int nDocs=0; - protected DocData getNextDocData() throws Exception { + protected synchronized DocData getNextDocData() throws Exception { if (nDocs>=20 && !forever) { throw new NoMoreDataException(); }