Skip to content

Commit 0d37a46

Browse files
committed
Fix to try-with-resources spotted by @tulinkry
1 parent bfa9802 commit 0d37a46

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

src/org/opensolaris/opengrok/index/PendingFileCompleter.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@
3030
import java.nio.file.Path;
3131
import java.nio.file.Paths;
3232
import java.nio.file.StandardCopyOption;
33-
import java.util.ArrayList;
3433
import java.util.Comparator;
3534
import java.util.HashSet;
3635
import java.util.List;
@@ -314,9 +313,8 @@ private void findFilelessChildren(SkeletonDirs skels, File directory) {
314313
boolean topLevelIneligible = false;
315314
boolean didLogFileTopLevelIneligible = false;
316315

317-
try {
318-
DirectoryStream<Path> directoryStream = Files.newDirectoryStream(
319-
Paths.get(dirPath));
316+
try (DirectoryStream<Path> directoryStream = Files.newDirectoryStream(
317+
Paths.get(dirPath))) {
320318
for (Path path : directoryStream) {
321319
File f = path.toFile();
322320
if (f.isFile()) {

0 commit comments

Comments
 (0)