LUCENE-1552: reset success to false in addIndexes(IndexReader[])

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@750162 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2009-03-04 21:34:53 +00:00
parent 480c2afd15
commit cf28799cb0
2 changed files with 3 additions and 7 deletions

View File

@ -3414,6 +3414,8 @@ public class IndexWriter {
sReader = SegmentReader.get(true, segmentInfos.info(0));
}
}
success = false;
try {
if (sReader != null)
@ -4458,8 +4460,6 @@ public class IndexWriter {
merger = new SegmentMerger(this, mergedName, merge);
boolean success = false;
// This is try/finally to make sure merger's readers are
// closed:
try {
@ -4482,8 +4482,6 @@ public class IndexWriter {
assert mergedDocCount == totDocCount;
success = true;
} finally {
// close readers before we attempt to delete
// now-obsolete segments
@ -4508,7 +4506,7 @@ public class IndexWriter {
commit(size);
}
success = false;
boolean success = false;
final String compoundFileName = mergedName + "." + IndexFileNames.COMPOUND_FILE_EXTENSION;
try {

View File

@ -179,10 +179,8 @@ public class MultiReader extends IndexReader implements Cloneable {
}
MultiReader mr = new MultiReader(newSubReaders);
mr.decrefOnClose = newDecrefOnClose;
success = true;
return mr;
} else {
success = true;
return this;
}
}