On Mon, 2 Dec 2024 13:43:41 GMT, Severin Gehwolf <sgehw...@openjdk.org> wrote:
>> Jaikiran Pai has updated the pull request incrementally with four additional >> commits since the last revision: >> >> - remove unnecessary space >> - Path.of() instead of Paths.get() >> - fix formatting of try-with-resources in CgroupSubsystemController.java >> - leave out MethodUtil from the clean up > > src/java.base/linux/classes/jdk/internal/platform/CgroupSubsystemController.java > line 70: > >> 68: String line = bufferedReader.readLine(); >> 69: return line; >> 70: } catch (IOException e) { > > We can use `Files.lines` here right away: > > Suggestion: > > try (Stream<String> lines = Files.lines(filePath)) { > Optional<String> firstLine = lines.findFirst(); > return firstLine.orElse(null); > } catch (UncheckedIOException | IOException e) { Is the catch for `UncheckedIOException` due to some previously known failure resulting in the use of these APIs? ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/22478#discussion_r1865907116