Skip to content

Commit 13ebbaa

Browse files
committed
fix: close file stream with Files.walk
Signed-off-by: azerr <azerr@redhat.com>
1 parent 51b392c commit 13ebbaa

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

qute.ls/com.redhat.qute.ls/src/main/java/com/redhat/qute/project/documents/QuteClosedTextDocuments.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import java.util.Map;
1818
import java.util.logging.Level;
1919
import java.util.logging.Logger;
20+
import java.util.stream.Stream;
2021

2122
import com.redhat.qute.commons.FileUtils;
2223
import com.redhat.qute.commons.TemplateRootPath;
@@ -82,8 +83,8 @@ private void scan(Path basePath) {
8283
}
8384
// Scan all directories from src/main/resources/templates directory to collect
8485
// closed Templates
85-
try {
86-
Files.walk(basePath).forEach(path -> {
86+
try (Stream<Path> stream = Files.walk(basePath)) {
87+
stream.forEach(path -> {
8788
try {
8889
tryToAddClosedTemplate(path, false);
8990
} catch (Exception e) {

0 commit comments

Comments
 (0)