Boolean
constructor is inefficient, consider using Boolean.valueOf
instead JAVA-P0066Creating 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.