Skip to content

Commit

Permalink
Issue checkstyle#614: Resolve CallToSystemExit, string formatting and…
Browse files Browse the repository at this point in the history
… string builder IDEA violations
  • Loading branch information
Vyom-Yadav committed Aug 27, 2022
1 parent d9d70be commit 9a9a99a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ private Main() {
* Entry point.
*
* @param args command line arguments.
* @noinspection CallToSystemExit
* @noinspectionreason CallToSystemExit - driver class must call exit
*/
public static void main(String... args) {
int errorCounter;
Expand Down Expand Up @@ -75,17 +77,17 @@ public static void main(String... args) {
}
if (errorCounter == 0) {
if (publicationErrors != null && !publicationErrors.isEmpty()) {
System.out.println(String.format("%nPublication ends with %d errors:",
publicationErrors.size()));
System.out.printf("%nPublication ends with %d errors:%n",
publicationErrors.size());
printListOf(publicationErrors);
}
else {
System.out.println(String.format("%nExecution succeeded!"));
System.out.printf("%nExecution succeeded!%n");
}
}
else {
System.out.println(String.format("%nGeneration ends with %d errors.",
errorCounter));
System.out.printf("%nGeneration ends with %d errors.%n",
errorCounter);
System.exit(ERROR_EXIT_CODE);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -336,7 +336,7 @@ private void assertFile(String actualName) {
}

private static String getFileContents(File file) throws IOException {
final StringBuilder result = new StringBuilder();
final StringBuilder result = new StringBuilder(256);

try (BufferedReader br = Files.newBufferedReader(file.toPath())) {
do {
Expand Down

0 comments on commit 9a9a99a

Please sign in to comment.