You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@lucene.apache.org by mi...@apache.org on 2006/12/19 17:17:36 UTC
svn commit: r488716 -
/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
Author: mikemccand
Date: Tue Dec 19 08:17:35 2006
New Revision: 488716
URL: http://svn.apache.org/viewvc?view=rev&rev=488716
Log:
LUCENE-750: fix one case that was not closing an IndexOutput with a try/finally
Modified:
lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
Modified: lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java?view=diff&rev=488716&r1=488715&r2=488716
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/SegmentInfos.java Tue Dec 19 08:17:35 2006
@@ -260,10 +260,13 @@
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.