Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue #614: Resolve CallToSystemExit, string formatting and string builder IDEA violations #644

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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