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 STORE_PAYLOADS = 0x20;
|
||||||
static final byte OMIT_TERM_FREQ_AND_POSITIONS = 0x40;
|
static final byte OMIT_TERM_FREQ_AND_POSITIONS = 0x40;
|
||||||
|
|
||||||
private ArrayList byNumber = new ArrayList();
|
private final ArrayList byNumber = new ArrayList();
|
||||||
private HashMap byName = new HashMap();
|
private final HashMap byName = new HashMap();
|
||||||
private int format;
|
private int format;
|
||||||
|
|
||||||
FieldInfos() { }
|
FieldInfos() { }
|
||||||
|
@ -75,14 +75,18 @@ final class FieldInfos {
|
||||||
// encoding; retry with input set to pre-utf8
|
// encoding; retry with input set to pre-utf8
|
||||||
input.seek(0);
|
input.seek(0);
|
||||||
input.setModifiedUTF8StringsMode();
|
input.setModifiedUTF8StringsMode();
|
||||||
byNumber = new ArrayList();
|
byNumber.clear();
|
||||||
byName = new HashMap();
|
byName.clear();
|
||||||
try {
|
try {
|
||||||
read(input, name);
|
read(input, name);
|
||||||
} catch (Throwable t) {
|
} catch (Throwable t) {
|
||||||
// Ignore any new exception & throw original IOE
|
// Ignore any new exception & throw original IOE
|
||||||
throw ioe;
|
throw ioe;
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
// The IOException cannot be caused by
|
||||||
|
// LUCENE-1623, so re-throw it
|
||||||
|
throw ioe;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} finally {
|
} finally {
|
||||||
|
|
Loading…
Reference in New Issue