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 00:44:19 +09:00
parent 36b90c6056
commit ec7e389087
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);
}