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 50e74345 [IO-811] Files.walk() direct and indirect callers fail to 
close the returned Stream<Path>
50e74345 is described below

commit 50e743458ac8ea66cc0baa739438f08255d0d192
Author: Gary Gregory <garydgreg...@gmail.com>
AuthorDate: Sat Sep 30 08:43:50 2023 -0400

    [IO-811] Files.walk() direct and indirect callers fail to close the
    returned Stream<Path>
    
    - Release resource in test
---
 src/test/java/org/apache/commons/io/file/FilesUncheckTest.java | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/test/java/org/apache/commons/io/file/FilesUncheckTest.java 
b/src/test/java/org/apache/commons/io/file/FilesUncheckTest.java
index 917de24f..607d6aad 100644
--- a/src/test/java/org/apache/commons/io/file/FilesUncheckTest.java
+++ b/src/test/java/org/apache/commons/io/file/FilesUncheckTest.java
@@ -220,7 +220,9 @@ public class FilesUncheckTest {
 
     @Test
     public void testList() {
-        assertEquals(1, 
FilesUncheck.list(Paths.get("src/test/resources/org/apache/commons/io/dirs-1-file-size-0")).count());
+        try (Stream<Path> stream = 
FilesUncheck.list(Paths.get("src/test/resources/org/apache/commons/io/dirs-1-file-size-0")))
 {
+            assertEquals(1, stream.count());
+        }
     }
 
     @Test

Reply via email to