Use Boolean.parseBoolean() instead of str.equalsIgnoreCase("true")

The parseBoolean() is null safe so we can remove the null checks.
This commit is contained in:
Sergey Ponomarev 2025-07-20 11:40:58 +03:00 committed by Guus der Kinderen
parent 0d4987dc9b
commit 5349f7b519
3 changed files with 3 additions and 12 deletions

View File

@ -182,7 +182,7 @@ public class Default {
public static boolean getBoolean(String propertyName) {
String prop = getString(propertyName);
return prop != null && prop.trim().equals("true");
return prop != null && Boolean.parseBoolean(prop.trim());
}
public static ImageIcon getImageIcon(String imageName) {

View File

@ -51,7 +51,7 @@ final public class FormUtils {
* otherwise.
*/
public static boolean isTrue(String str) {
return (str != null && str.equalsIgnoreCase("true"));
return Boolean.parseBoolean(str);
}

View File

@ -19,18 +19,9 @@ package net.java.sipmack.common;
/**
* Creates and writes out messages.
*/
public class Log {
private static boolean debugger = false;
static {
if (System.getProperty("debugger") != null
&& System.getProperty("debugger").equals("true"))
debugger = true;
}
private static boolean debugger = Boolean.parseBoolean(System.getProperty("debugger"));
public static void debug(String message) {
if (debugger)