Skip to content

Commit

Permalink
Fix StreamResourceLeak error
Browse files Browse the repository at this point in the history
Fixes #4414

Change-Id: I06eac192b5be84bd84190980fbcd05574e3a4439
PiperOrigin-RevId: 181465165
  • Loading branch information
cushon authored and Copybara-Service committed Jan 10, 2018
1 parent efb3b59 commit 65c13dd
Showing 1 changed file with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ private ImmutableList<Path> findUnprocessed(String pathPrefix) throws IOExceptio
if (!Files.exists(rootPathPrefix.getParent())) {
return ImmutableList.of();
}
try (Stream<Path> paths =
Files.list(rootPathPrefix.getParent())
.filter(
path -> path.toString().startsWith(rootPathPrefixStr)
&& !existingPaths.contains(path))) {
return paths.collect(ImmutableList.toImmutableList());
try (Stream<Path> paths = Files.list(rootPathPrefix.getParent())) {
return paths
.filter(
path ->
path.toString().startsWith(rootPathPrefixStr) && !existingPaths.contains(path))
.collect(ImmutableList.toImmutableList());
}
}
}

0 comments on commit 65c13dd

Please sign in to comment.