From a1a0b561cd4876bc955a57e1adfd7b04c14e7a58 Mon Sep 17 00:00:00 2001 From: Robert Muir Date: Fri, 9 May 2014 12:04:38 +0000 Subject: [PATCH] sync the buggy methods in LiveIWC, instead of all operations from all RIWs... git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1593517 13f79535-47bb-0310-9956-ffa450edef68 --- .../java/org/apache/lucene/index/LiveIndexWriterConfig.java | 4 ++-- .../src/java/org/apache/lucene/util/LuceneTestCase.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java index f3a3e780db1..7fd86614721 100644 --- a/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java +++ b/lucene/core/src/java/org/apache/lucene/index/LiveIndexWriterConfig.java @@ -248,7 +248,7 @@ public class LiveIndexWriterConfig { * if ramBufferSize is enabled but non-positive, or it disables * ramBufferSize when maxBufferedDocs is already disabled */ - public LiveIndexWriterConfig setRAMBufferSizeMB(double ramBufferSizeMB) { + public synchronized LiveIndexWriterConfig setRAMBufferSizeMB(double ramBufferSizeMB) { if (ramBufferSizeMB != IndexWriterConfig.DISABLE_AUTO_FLUSH && ramBufferSizeMB <= 0.0) { throw new IllegalArgumentException("ramBufferSize should be > 0.0 MB when enabled"); } @@ -289,7 +289,7 @@ public class LiveIndexWriterConfig { * if maxBufferedDocs is enabled but smaller than 2, or it disables * maxBufferedDocs when ramBufferSize is already disabled */ - public LiveIndexWriterConfig setMaxBufferedDocs(int maxBufferedDocs) { + public synchronized LiveIndexWriterConfig setMaxBufferedDocs(int maxBufferedDocs) { if (maxBufferedDocs != IndexWriterConfig.DISABLE_AUTO_FLUSH && maxBufferedDocs < 2) { throw new IllegalArgumentException("maxBufferedDocs must at least be 2 when enabled"); } diff --git a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java index 5c968e06018..11630254e69 100644 --- a/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java +++ b/lucene/test-framework/src/java/org/apache/lucene/util/LuceneTestCase.java @@ -1034,7 +1034,7 @@ public abstract class LuceneTestCase extends Assert { } // if you want it in LiveIndexWriterConfig: it must and will be tested here. - public static synchronized void maybeChangeLiveIndexWriterConfig(Random r, LiveIndexWriterConfig c) { + public static void maybeChangeLiveIndexWriterConfig(Random r, LiveIndexWriterConfig c) { boolean didChange = false; if (rarely(r)) {