lucene-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rm...@apache.org
Subject svn commit: r1393842 - in /lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x: SegmentTermEnum.java TermInfosReader.java
Date Thu, 04 Oct 2012 00:06:35 GMT
Author: rmuir
Date: Thu Oct  4 00:06:35 2012
New Revision: 1393842

URL: http://svn.apache.org/viewvc?rev=1393842&view=rev
Log:
close correctly

Modified:
    lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/SegmentTermEnum.java
    lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/TermInfosReader.java

Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/SegmentTermEnum.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/SegmentTermEnum.java?rev=1393842&r1=1393841&r2=1393842&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/SegmentTermEnum.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/SegmentTermEnum.java
Thu Oct  4 00:06:35 2012
@@ -17,6 +17,7 @@ package org.apache.lucene.codecs.lucene3
  * limitations under the License.
  */
 
+import java.io.Closeable;
 import java.io.IOException;
 import org.apache.lucene.store.IndexInput;
 import org.apache.lucene.index.FieldInfos;
@@ -31,7 +32,7 @@ import org.apache.lucene.index.IndexForm
  * @lucene.experimental */
 
 @Deprecated
-final class SegmentTermEnum implements Cloneable {
+final class SegmentTermEnum implements Cloneable,Closeable {
   private IndexInput input;
   FieldInfos fieldInfos;
   long size;

Modified: lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/TermInfosReader.java
URL: http://svn.apache.org/viewvc/lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/TermInfosReader.java?rev=1393842&r1=1393841&r2=1393842&view=diff
==============================================================================
--- lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/TermInfosReader.java
(original)
+++ lucene/dev/branches/branch_4x/lucene/core/src/java/org/apache/lucene/codecs/lucene3x/TermInfosReader.java
Thu Oct  4 00:06:35 2012
@@ -30,6 +30,7 @@ import org.apache.lucene.store.IOContext
 import org.apache.lucene.util.BytesRef;
 import org.apache.lucene.util.CloseableThreadLocal;
 import org.apache.lucene.util.DoubleBarrelLRUCache;
+import org.apache.lucene.util.IOUtils;
 
 /** This stores a monotonically increasing set of <Term, TermInfo> pairs in a
  * Directory.  Pairs are accessed either by Term or by ordinal position the
@@ -157,9 +158,7 @@ final class TermInfosReader implements C
   }
 
   public void close() throws IOException {
-    if (origEnum != null)
-      origEnum.close();
-    threadResources.close();
+    IOUtils.close(origEnum, threadResources);
   }
 
   /** Returns the number of term/value pairs in the set. */



Mime
View raw message