lucene-java-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mikemcc...@apache.org
Subject svn commit: r770839 - /lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
Date Fri, 01 May 2009 22:08:43 GMT
Author: mikemccand
Date: Fri May  1 22:08:43 2009
New Revision: 770839

URL: http://svn.apache.org/viewvc?rev=770839&view=rev
Log:
LUCENE-1623: fix case that was swallowing IOException; use .clear() instead of creating new
ArrayList/HashMap

Modified:
    lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java

Modified: lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java
URL: http://svn.apache.org/viewvc/lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java?rev=770839&r1=770838&r2=770839&view=diff
==============================================================================
--- lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java (original)
+++ lucene/java/trunk/src/java/org/apache/lucene/index/FieldInfos.java Fri May  1 22:08:43
2009
@@ -50,8 +50,8 @@
   static final byte STORE_PAYLOADS = 0x20;
   static final byte OMIT_TERM_FREQ_AND_POSITIONS = 0x40;
   
-  private ArrayList byNumber = new ArrayList();
-  private HashMap byName = new HashMap();
+  private final ArrayList byNumber = new ArrayList();
+  private final HashMap byName = new HashMap();
   private int format;
 
   FieldInfos() { }
@@ -75,14 +75,18 @@
           // encoding; retry with input set to pre-utf8
           input.seek(0);
           input.setModifiedUTF8StringsMode();
-          byNumber = new ArrayList();
-          byName = new HashMap();
+          byNumber.clear();
+          byName.clear();
           try {
             read(input, name);
           } catch (Throwable t) {
             // Ignore any new exception & throw original IOE
             throw ioe;
           }
+        } else {
+          // The IOException cannot be caused by
+          // LUCENE-1623, so re-throw it
+          throw ioe;
         }
       }
     } finally {



Mime
View raw message