mirror of https://github.com/apache/lucene.git
LUCENE-6124: fix double-close bug in BaseDirectoryWrapper
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1646897 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
199a90214b
commit
8cd8dbcb8f
|
@ -40,9 +40,11 @@ public class BaseDirectoryWrapper extends FilterDirectory {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void close() throws IOException {
|
public void close() throws IOException {
|
||||||
isOpen = false;
|
if (isOpen) {
|
||||||
if (checkIndexOnClose && DirectoryReader.indexExists(this)) {
|
isOpen = false;
|
||||||
TestUtil.checkIndex(this, crossCheckTermVectorsOnClose);
|
if (checkIndexOnClose && DirectoryReader.indexExists(this)) {
|
||||||
|
TestUtil.checkIndex(this, crossCheckTermVectorsOnClose);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
super.close();
|
super.close();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue