Ref: add new static analyser rule: category/java/bestpractices.xml/LiteralsFirstInComparisons

This commit is contained in:
Laurent Clouet
2024-06-07 14:35:47 +00:00
parent 824dfe4ef6
commit 0a7f1f9f1b
14 changed files with 29 additions and 28 deletions

View File

@@ -346,7 +346,7 @@ public class Worker {
}
if (theme != null) {
if (!theme.equals("light") && !theme.equals("dark")) {
if ("light".equals(theme) == false && "dark".equals(theme) == false) {
System.err.println("ERROR: The entered theme (-theme parameter) doesn't exist. Please choose either 'light' or 'dark'");
System.exit(2);
}
@@ -406,7 +406,7 @@ public class Worker {
}
if (shutdownMode != null) {
if (shutdownMode.equalsIgnoreCase("wait") || shutdownMode.equalsIgnoreCase("hard")) {
if ("wait".equalsIgnoreCase(shutdownMode) || "hard".equalsIgnoreCase(shutdownMode)) {
config.setShutdownMode(shutdownMode.toLowerCase());
}
else {
@@ -425,7 +425,7 @@ public class Worker {
}
System.out.println("==============================================================================");
if (config.getShutdownMode().equals("wait")) {
if ("wait".equals(config.getShutdownMode())) {
System.out.println(String.format(
"WARNING!\n\nThe client will stop requesting new jobs at %s.\nTHE EFFECTIVE SHUTDOWN MIGHT OCCUR LATER THAN THE REQUESTED TIME AS THE UPLOAD\nQUEUE MUST BE FULLY UPLOADED BEFORE THE SHUTDOWN PROCESS STARTS.\n\nIf you want to shutdown the computer sharp at the specified time, please\ninclude the '-shutdown-mode hard' parameter in the application call",
shutdownTime));