Переглянути джерело

implement code suggestions

Jan Wittler 3 роки тому
батько
коміт
6e9ef4cb71

+ 1 - 1
cli/src/main/java/de/jplag/cli/CommandLineArgument.java

@@ -129,7 +129,7 @@ public enum CommandLineArgument {
      * @return the flag name of the command line argument without leading dashes and inner dashes replaced with underscores.
      */
     public String flagWithoutDash() {
-        return flag.replaceAll("^-+", "").replaceAll("-", "_");
+        return flag.replaceAll("^-+", "").replace("-", "_");
     }
 
     /**

+ 2 - 2
cli/src/main/java/de/jplag/cli/logger/CollectedLogger.java

@@ -27,7 +27,7 @@ public final class CollectedLogger extends MarkerIgnoringBase {
     private static final int LOG_LEVEL_WARN = LocationAwareLogger.WARN_INT;
     private static final int LOG_LEVEL_ERROR = LocationAwareLogger.ERROR_INT;
 
-    private final int currentLogLevel = LOG_LEVEL_INFO;
+    private static final int CURRENT_LOG_LEVEL = LOG_LEVEL_INFO;
 
     /**
      * The short name of this simple log instance
@@ -117,7 +117,7 @@ public final class CollectedLogger extends MarkerIgnoringBase {
     }
 
     private boolean isLevelEnabled(int logLevel) {
-        return logLevel >= currentLogLevel;
+        return logLevel >= CURRENT_LOG_LEVEL;
     }
 
     private String renderLevel(int level) {