Make use of Java 5 auto boxing
Reviewed and replaced when possible: - new Integer - intValue() - new Boolean - booleanValue() - Boolean.TRUE - Boolean.FALSE - new Long - longValue() Issues: SWF-1532
This commit is contained in:
@@ -50,13 +50,13 @@ public class StringToBoolean extends StringToObject {
|
||||
|
||||
protected Object toObject(String string, Class<?> targetClass) throws Exception {
|
||||
if (trueString != null && string.equals(trueString)) {
|
||||
return Boolean.TRUE;
|
||||
return true;
|
||||
} else if (falseString != null && string.equals(falseString)) {
|
||||
return Boolean.FALSE;
|
||||
return false;
|
||||
} else if (trueString == null && string.equals(VALUE_TRUE)) {
|
||||
return Boolean.TRUE;
|
||||
return true;
|
||||
} else if (falseString == null && string.equals(VALUE_FALSE)) {
|
||||
return Boolean.FALSE;
|
||||
return false;
|
||||
} else {
|
||||
throw new IllegalArgumentException("Invalid boolean value [" + string + "]");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user