LUCENE-8812: disable Java 9 try-with-resources style in TestKoreanNumberFilter

Signed-off-by: Namgyu Kim <namgyu@apache.org>
This commit is contained in:
Namgyu Kim 2019-06-10 01:56:34 +09:00
parent 5a75b8a080
commit fe58b6f3a2
1 changed files with 7 additions and 3 deletions

View File

@ -48,9 +48,13 @@ public class TestKoreanNumberFilter extends BaseTokenStreamTestCase {
if (is == null) {
throw new RuntimeException("Cannot find userdict.txt in test classpath!");
}
Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
try (reader) {
return UserDictionary.open(reader);
try {
try {
Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
return UserDictionary.open(reader);
} finally {
is.close();
}
} catch (IOException ioe) {
throw new RuntimeException(ioe);
}