From dd9cc8d4d0a362848b5e58a9b2d984b8ac9045b8 Mon Sep 17 00:00:00 2001 From: Uwe Schindler Date: Sat, 10 Dec 2011 09:51:42 +0000 Subject: [PATCH] Merged revision(s) 1212754 from lucene/dev/branches/branch_3x: LUCENE-3630: Fixed naming of the internal method MultiReader.doOpenIfChanged(boolean doClone) that was overriding IndexReader.doOpenIfChanged(boolean readOnly), so changing the contract of the overridden method git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1212755 13f79535-47bb-0310-9956-ffa450edef68 --- lucene/CHANGES.txt | 6 ++++++ lucene/src/java/org/apache/lucene/index/MultiReader.java | 6 +++--- lucene/src/java/org/apache/lucene/index/ParallelReader.java | 2 +- 3 files changed, 10 insertions(+), 4 deletions(-) diff --git a/lucene/CHANGES.txt b/lucene/CHANGES.txt index 79ddabb06bc..e939ea00c37 100644 --- a/lucene/CHANGES.txt +++ b/lucene/CHANGES.txt @@ -711,6 +711,12 @@ Bug fixes * LUCENE-3627: Don't let an errant 0-byte segments_N file corrupt the index. (Ken McCracken via Mike McCandless) +* LUCENE-3630: The internal method MultiReader.doOpenIfChanged(boolean doClone) + was overriding IndexReader.doOpenIfChanged(boolean readOnly), so changing the + contract of the overridden method. This method was renamed and made private. + In ParallelReader the bug was not existent, but the implementation method + was also made private. (Uwe Schindler) + Documentation * LUCENE-3597: Fixed incorrect grouping documentation. (Martijn van Groningen, Robert Muir) diff --git a/lucene/src/java/org/apache/lucene/index/MultiReader.java b/lucene/src/java/org/apache/lucene/index/MultiReader.java index fdc364dfe4f..94f12da290e 100644 --- a/lucene/src/java/org/apache/lucene/index/MultiReader.java +++ b/lucene/src/java/org/apache/lucene/index/MultiReader.java @@ -108,7 +108,7 @@ public class MultiReader extends IndexReader implements Cloneable { */ @Override protected synchronized IndexReader doOpenIfChanged() throws CorruptIndexException, IOException { - return doOpenIfChanged(false); + return doReopen(false); } /** @@ -123,7 +123,7 @@ public class MultiReader extends IndexReader implements Cloneable { @Override public synchronized Object clone() { try { - return doOpenIfChanged(true); + return doReopen(true); } catch (Exception ex) { throw new RuntimeException(ex); } @@ -141,7 +141,7 @@ public class MultiReader extends IndexReader implements Cloneable { * @throws CorruptIndexException * @throws IOException */ - protected IndexReader doOpenIfChanged(boolean doClone) throws CorruptIndexException, IOException { + private IndexReader doReopen(boolean doClone) throws CorruptIndexException, IOException { ensureOpen(); boolean changed = false; diff --git a/lucene/src/java/org/apache/lucene/index/ParallelReader.java b/lucene/src/java/org/apache/lucene/index/ParallelReader.java index 8ce4258c3a8..7b7bd52366e 100644 --- a/lucene/src/java/org/apache/lucene/index/ParallelReader.java +++ b/lucene/src/java/org/apache/lucene/index/ParallelReader.java @@ -247,7 +247,7 @@ public class ParallelReader extends IndexReader { return doReopen(false); } - protected IndexReader doReopen(boolean doClone) throws CorruptIndexException, IOException { + private IndexReader doReopen(boolean doClone) throws CorruptIndexException, IOException { ensureOpen(); boolean reopened = false;