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:35:48 UTC

[lucene-solr] branch branch_8x updated: Revert "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 d037957  Revert "disable Java 9 try-with-resources style in TestKoreanNumberFilter"
d037957 is described below

commit d037957f9b4f99e8725f0a587154004cad84997c
Author: Namgyu Kim <kn...@gmail.com>
AuthorDate: Mon Jun 10 01:35:06 2019 +0900

    Revert "disable Java 9 try-with-resources style in TestKoreanNumberFilter"
    
    This reverts commit ec7e38908775e4a3517c178595bf1944701d331d.
---
 .../org/apache/lucene/analysis/ko/TestKoreanNumberFilter.java  | 10 +++-------
 1 file changed, 3 insertions(+), 7 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 33c1c06..2534823 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,13 +48,9 @@ public class TestKoreanNumberFilter extends BaseTokenStreamTestCase {
     if (is == null) {
       throw new RuntimeException("Cannot find userdict.txt in test classpath!");
     }
-    try {
-      try {
-        Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
-        return UserDictionary.open(reader);
-      } finally {
-        is.close();
-      }
+    Reader reader = new InputStreamReader(is, StandardCharsets.UTF_8);
+    try (reader) {
+      return UserDictionary.open(reader);
     } catch (IOException ioe) {
       throw new RuntimeException(ioe);
     }