RFR: Make sure Commits are closed when using Commits::stream

Erik Duveblad via github.com duke at openjdk.java.net
Fri Aug 30 11:03:38 UTC 2019

On Fri, 30 Aug 2019 10:21:32 GMT, Jorn Vernee via github.com <duke at openjdk.java.net> wrote:

> I noticed most places that are using `Commits::stream` are not actually closing the underlying resource.
> I've added an `onClose` handler to the returned stream, and also overrode `forEach` (from `Iterable`) to call close. Unfortunately, the stream `onClose` handler is not called automatically when a terminal operation occurs, so we still have to use try-with-resources when using `Commits::stream` (which I've addressed).
> ----------------
> Commits:
>  - 05de00bc:	Make sure `Commits` are closed when calling `Commits::stream`.
>  - a5687db1:	Add onClose operation to Commits::stream to avoid resource leaks
> Pull request:
> https://git.openjdk.java.net/skara/pull/111
> Webrev:
> https://webrevs.openjdk.java.net/skara/111/webrev.00
> Patch:
> https://git.openjdk.java.net/skara/pull/111.diff
> Fetch command:
> git fetch https://git.openjdk.java.net/skara pull/111/head:pull/111

This PR has been reviewed by Erik Duveblad via github.com - changes are approved. Review comment:

Looks good, thanks for fixing this!

PR: https://git.openjdk.java.net/skara/pull/111

More information about the skara-dev mailing list