From 604acf25098cec9613613b9d4a0a563367d127e0 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Tue, 15 May 2018 19:50:16 +0100 Subject: [PATCH] Use Files.readAllLines --- .../net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java index 3cc8ae5..63653c4 100644 --- a/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java +++ b/builder/src/main/java/net/kemitix/checkstyle/ruleset/builder/ReadmeWriter.java @@ -32,7 +32,6 @@ import java.nio.file.Path; import java.nio.file.StandardOpenOption; import java.util.function.Predicate; import java.util.stream.Collectors; -import java.util.stream.Stream; /** * Writes the README file. @@ -95,9 +94,7 @@ class ReadmeWriter implements CommandLineRunner { } private String readFile(final Path file) throws IOException { - try (Stream lines = Files.lines(file, StandardCharsets.UTF_8)) { - return lines.collect(Collectors.joining(NEWLINE)); - } + return String.join(NEWLINE, Files.readAllLines(file, StandardCharsets.UTF_8)); } }