TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
 
TIOBE - Java Coding Standard
Search

Rule:  Basic18Checked automatically with code checker

Synopsis:Avoid instantiating Boolean objects; reference Boolean.TRUE or Boolean.FALSE
Language:Java
Severity Level:2
Category:Basic


Description:
Avoid instantiating Boolean objects; you can reference Boolean.TRUE or Boolean.FALSE.
public class Foo {
 Boolean bar = new Boolean("true"); // just do a Boolean bar = Boolean.TRUE;
 Boolean buz = Boolean.valueOf(false); // just do a Boolean buz = Boolean.FALSE;
}