Boolean
constructor is inefficient, consider using Boolean.valueOf
instead JAVA-P0066Boolean
constructor is inefficient, use Boolean.valueOf
instead 53
54 Boolean getIsLocalFromConfigData(ConfigData configData) {
55 if (configData.getParams().get("thing1") == null) return null;
56 else return new Boolean(configData.getParams().get("thing1")); 57 }
58
59 /**
Creating new instances of java.lang.Boolean
wastes memory, since Boolean
objects are immutable and there are only two useful values of this type.
Boolean a = new Boolean(true);
Use the Boolean.valueOf
method (or autoboxing since Java 1.5) to create Boolean
objects instead.
Boolean a = true;
// or
Boolean b = Boolean.valueOf(true);
Note - This issue will be ignored within tests.