mirror of https://github.com/apache/lucene.git
respect closeable
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1593385 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
31a05cebdd
commit
b943e47c99
|
@ -346,7 +346,9 @@ public class RandomIndexWriter implements Closeable {
|
|||
*/
|
||||
@Override
|
||||
public void close() throws IOException {
|
||||
LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
|
||||
if (!w.isClosed()) {
|
||||
LuceneTestCase.maybeChangeLiveIndexWriterConfig(r, w.getConfig());
|
||||
}
|
||||
// if someone isn't using getReader() API, we want to be sure to
|
||||
// forceMerge since presumably they might open a reader on the dir.
|
||||
if (getReaderCalled == false && r.nextInt(8) == 2) {
|
||||
|
|
Loading…
Reference in New Issue