mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 03:34:43 +00:00
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:
parent
0d4987dc9b
commit
5349f7b519
@ -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) {
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user