Merge pull request #89 from kemitix/sonar-close-try-resources

Sonar close try resources
This commit is contained in:
Paul Campbell 2018-05-16 06:50:57 +01:00 committed by GitHub
commit 92c98da897
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -94,8 +94,7 @@ class ReadmeWriter implements CommandLineRunner {
} }
private String readFile(final Path file) throws IOException { private String readFile(final Path file) throws IOException {
return Files.lines(file, StandardCharsets.UTF_8) return String.join(NEWLINE, Files.readAllLines(file, StandardCharsets.UTF_8));
.collect(Collectors.joining(NEWLINE));
} }
} }