Skip to content

Commit

Permalink
Issue #614: Resolve CallToSystemExit, string formatting and string bu…
Browse files Browse the repository at this point in the history
…ilder IDEA violations
  • Loading branch information
Vyom-Yadav committed Aug 29, 2022
1 parent 99add3c commit ab675b6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ private Main() {
* Entry point.
*
* @param args command line arguments.
* @noinspection UseOfSystemOutOrSystemErr
* @noinspection UseOfSystemOutOrSystemErr, CallToSystemExit
* @noinspectionreason UseOfSystemOutOrSystemErr - used for CLI output
* @noinspectionreason CallToSystemExit - main method must exit with code
*/
public static void main(String... args) {
int errorCounter;
Expand Down Expand Up @@ -77,17 +78,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 ab675b6

Please sign in to comment.