Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -62,9 +62,10 @@ public RemoteSynonymFile(Environment env, Analyzer analyzer,

@Override
public SynonymMap reloadSynonymMap() {
Reader rulesReader = null;
try {
logger.info("start reload remote synonym from {}.", location);
Reader rulesReader = getReader();
rulesReader = getReader();
SynonymMap.Builder parser = null;

if ("wordnet".equalsIgnoreCase(format)) {
Expand All @@ -80,7 +81,13 @@ public SynonymMap reloadSynonymMap() {
throw new IllegalArgumentException(
"could not reload remote synonyms file to build synonyms",
e);
}
} finally {
try {
rulesReader.close();
} catch(Exception e) {
e.printStackTrace();
}
}
}

/**
Expand Down Expand Up @@ -129,9 +136,6 @@ public Reader getReader() {
"IOException while reading remote synonyms file", e);
} finally {
try {
if (response != null) {
response.close();
}
if (br != null) {
br.close();
}
Expand Down