Skip to content

Apache Lucene open-source search software

sync the buggy methods in LiveIWC, instead of all operations from all RIWs...

Robert Muira1a0b561cd48
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)) {