Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
qa: address PMD SystemPrintln findings
Browse files Browse the repository at this point in the history
- suppress for LoggingContext.java and Terasology.java because logging not necessarily available yet there
- refactor for PathManager.java as logger is already in use in that context, also see previous discussion in #5036 (comment)
jdrueckert committed Aug 18, 2024
1 parent 1590001 commit a3df04a
Showing 3 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -25,6 +25,7 @@
/**
* Configures the underlying logback logging framework.
*/
@SuppressWarnings("PMD.SystemPrintln")
public final class LoggingContext {

/**
10 changes: 5 additions & 5 deletions engine/src/main/java/org/terasology/engine/core/PathManager.java
Original file line number Diff line number Diff line change
@@ -99,11 +99,11 @@ private static Path findInstallPath() {
}
}

System.err.printf(
"Native library installation directory not found. %n" +
"Things will almost certainly crash as a result, %n" +
"unless something else installed everything to java.library.path. %n" +
"Searched: %s%n", installationSearchPaths
LOGGER.error(
"Native library installation directory not found. /n" +
"Things will almost certainly crash as a result, /n" +
"unless something else installed everything to java.library.path. /n" +
"Searched: {}/n", installationSearchPaths
);
return currentDirectory;
}
Original file line number Diff line number Diff line change
@@ -318,6 +318,7 @@ private void populateSubsystems(TerasologyEngineBuilder builder) {
builder.add(new HibernationSubsystem());
}

@SuppressWarnings("PMD.SystemPrintln")
private void reportException(Throwable throwable) {
Path logPath = LoggingContext.getLoggingPath();

0 comments on commit a3df04a

Please sign in to comment.