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:
Robert Muir 2014-12-19 22:31:01 +00:00
parent 199a90214b
commit 8cd8dbcb8f
1 changed files with 5 additions and 3 deletions

View File

@ -40,9 +40,11 @@ public class BaseDirectoryWrapper extends FilterDirectory {
@Override
public void close() throws IOException {
isOpen = false;
if (checkIndexOnClose && DirectoryReader.indexExists(this)) {
TestUtil.checkIndex(this, crossCheckTermVectorsOnClose);
if (isOpen) {
isOpen = false;
if (checkIndexOnClose && DirectoryReader.indexExists(this)) {
TestUtil.checkIndex(this, crossCheckTermVectorsOnClose);
}
}
super.close();
}