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:
Phillip Webb
2012-04-05 14:07:58 -07:00
parent d3ff99c239
commit 22b018e95a
54 changed files with 132 additions and 140 deletions

View File

@@ -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 + "]");
}