Details
-
Type:
Improvement
-
Status: Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: None
-
Fix Version/s: None
-
Component/s: checkstyle
-
Labels:None
Description
new Boolean(xxxx) should be avoided. There are only two Boolean states -- Boolean.TRUE and Boolean.FALSE. They can be tested directly using ==. When new Boolean(xxxx) is used, that introduces a new Object, and the Boolean object that is created can only be be tested using .valueOf() or .equals(), which is inefficient.