You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@commons.apache.org by gg...@apache.org on 2021/05/13 12:59:25 UTC

[commons-io] branch master updated: Use try-with-resources.

This is an automated email from the ASF dual-hosted git repository.

ggregory pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/commons-io.git


The following commit(s) were added to refs/heads/master by this push:
     new 7c01096  Use try-with-resources.
7c01096 is described below

commit 7c01096772cd3a17f30cf91edaa112e0b56d5efa
Author: Gary Gregory <ga...@gmail.com>
AuthorDate: Thu May 13 08:59:22 2021 -0400

    Use try-with-resources.
---
 .../org/apache/commons/io/input/CharacterSetFilterReaderTest.java   | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java b/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
index b76d3f0..54c2da4 100644
--- a/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
+++ b/src/test/java/org/apache/commons/io/input/CharacterSetFilterReaderTest.java
@@ -64,9 +64,9 @@ public class CharacterSetFilterReaderTest {
         try (StringReader input = new StringReader("a")) {
             final HashSet<Integer> codePoints = new HashSet<>();
             codePoints.add(Integer.valueOf('a'));
-            final CharacterSetFilterReader reader = new CharacterSetFilterReader(input, codePoints);
-            assertEquals(-1, reader.read());
-            reader.close();
+            try (final CharacterSetFilterReader reader = new CharacterSetFilterReader(input, codePoints)) {
+                assertEquals(-1, reader.read());
+            }
         }
     }