also set tvd/tvf to null after close

git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/branches/realtime_search@1097521 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2011-04-28 16:03:10 +00:00
parent 726654c1ab
commit 1a1060611c
1 changed files with 3 additions and 2 deletions

View File

@ -57,9 +57,10 @@ final class TermVectorsTermsWriter extends TermsHashConsumer {
tvx.close();
tvf.close();
tvd.close();
tvx = null;
if (4+((long) state.numDocs)*16 != state.directory.fileLength(idxName))
tvx = tvd = tvf = null;
if (4+((long) state.numDocs)*16 != state.directory.fileLength(idxName)) {
throw new RuntimeException("after flush: tvx size mismatch: " + state.numDocs + " docs vs " + state.directory.fileLength(idxName) + " length in bytes of " + idxName + " file exists?=" + state.directory.fileExists(idxName));
}
lastDocID = 0;
state.hasVectors = hasVectors;