LUCENE-750: fix one case that was not closing an IndexOutput with a try/finally

git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@488716 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Michael McCandless 2006-12-19 16:17:35 +00:00
parent 7c4b667f71
commit 19ba76b0d4
1 changed files with 7 additions and 4 deletions

View File

@ -260,10 +260,13 @@ public final class SegmentInfos extends Vector {
try {
output = directory.createOutput(IndexFileNames.SEGMENTS_GEN);
output.writeInt(FORMAT_LOCKLESS);
output.writeLong(generation);
output.writeLong(generation);
output.close();
try {
output.writeInt(FORMAT_LOCKLESS);
output.writeLong(generation);
output.writeLong(generation);
} finally {
output.close();
}
} catch (IOException e) {
// It's OK if we fail to write this file since it's
// used only as one of the retry fallbacks.