On Sat, 9 Jul 2022 02:43:55 GMT, David Schlosnagle <d...@openjdk.org> wrote:
>> Roger Riggs has updated the pull request incrementally with one additional >> commit since the last revision: >> >> Cleanup of PipelineLeaksFD test improving error messages and source >> cleanup. > > test/jdk/java/lang/ProcessBuilder/PipelineLeaksFD.java line 130: > >> 128: }) >> 129: .filter(p1 -> p1.link().toString().startsWith("pipe:")) >> 130: .collect(Collectors.toSet()); > > Is this intentionally leaking the returned `DirectoryStream` from > `Files.walk` to trigger the previous failure mode or should this be > auto-closed (i.e. https://errorprone.info/bugpattern/StreamResourceLeak )? > > Suggestion: > > try (Stream<Path> s = Files.walk(path)) { > return s.filter(Files::isSymbolicLink) > .map(p -> { > try { > return new PipeRecord(p, > Files.readSymbolicLink(p)); > } catch (IOException ioe) { > } > return new PipeRecord(p, null); > }) > .filter(p1 -> p1.link().toString().startsWith("pipe:")) > .collect(Collectors.toSet()); > } @schlosna An oversight, thanks for the reminder. ------------- PR: https://git.openjdk.org/jdk/pull/9414