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 16:57:09 UTC

[lucene-solr] branch master updated: LUCENE-8812: 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 master
in repository https://gitbox.apache.org/repos/asf/lucene-solr.git


The following commit(s) were added to refs/heads/master by this push:
     new fe58b6f  LUCENE-8812: disable Java 9 try-with-resources style in TestKoreanNumberFilter
fe58b6f is described below

commit fe58b6f3a27e1520054f74f06c3d7c2042ff4f79
Author: Namgyu Kim <na...@apache.org>
AuthorDate: Mon Jun 10 01:56:34 2019 +0900

    LUCENE-8812: 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);
     }