On Mon, 2 Dec 2024 14:07:45 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:

>> Is the catch for `UncheckedIOException` due to some previously known failure 
>> resulting in the use of these APIs?
>
> Without using `Files.lines()` no `UncheckedIOException` would be thrown. Just 
> `IOException` and `null` returned. This extra catch is there to avoid new 
> `UncheckedIOException` being thrown on `findFirst()`. I.e. to keep semantics 
> the same as before.

Thank you that's a good point. I hadn't taken into account exceptions 
propagated from `java.util.stream.Stream` operations.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/22478#discussion_r1865922009

Reply via email to