You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@lucene.apache.org by na...@apache.org on 2019/06/09 15:45:46 UTC
[lucene-solr] branch branch_8x updated: disable Java 9
try-with-resources style in TestKoreanNumberFilter
This is an automated email from the ASF dual-hosted git repository.
namgyu pushed a commit to branch branch_8x
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git
The following commit(s) were added to refs/heads/branch_8x by this push:
new ec7e389 disable Java 9 try-with-resources style in TestKoreanNumberFilter
ec7e389 is described below
commit ec7e38908775e4a3517c178595bf1944701d331d
Author: Namgyu Kim <na...@apache.org>
AuthorDate: Mon Jun 10 00:44:19 2019 +0900
disable Java 9 try-with-resources style in TestKoreanNumberFilter
Signed-off-by: Namgyu Kim <na...@apache.org>
---
.../org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java
index 2534823..33c1c06 100644
--- a/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java
+++ b/lucene/analysis/nori/src/test/org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java
@@ -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);
}