mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-10-29 19:57:28 +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) {
|
public static boolean getBoolean(String propertyName) {
|
||||||
String prop = getString(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) {
|
public static ImageIcon getImageIcon(String imageName) {
|
||||||
|
|||||||
@ -51,7 +51,7 @@ final public class FormUtils {
|
|||||||
* otherwise.
|
* otherwise.
|
||||||
*/
|
*/
|
||||||
public static boolean isTrue(String str) {
|
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.
|
* Creates and writes out messages.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class Log {
|
public class Log {
|
||||||
|
|
||||||
private static boolean debugger = false;
|
private static boolean debugger = Boolean.parseBoolean(System.getProperty("debugger"));
|
||||||
|
|
||||||
static {
|
|
||||||
|
|
||||||
if (System.getProperty("debugger") != null
|
|
||||||
&& System.getProperty("debugger").equals("true"))
|
|
||||||
debugger = true;
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public static void debug(String message) {
|
public static void debug(String message) {
|
||||||
if (debugger)
|
if (debugger)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user