mirror of https://github.com/apache/lucene.git
LUCENE-1623: fix case that was swallowing IOException; use .clear() instead of creating new ArrayList/HashMap
git-svn-id: https://svn.apache.org/repos/asf/lucene/java/trunk@770839 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
582356dc2e
commit
a068b83719
|
@ -50,8 +50,8 @@ final class FieldInfos {
|
|||
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 @@ final class FieldInfos {
|
|||
// 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 {
|
||||
|
|
Loading…
Reference in New Issue