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

Rule:  Design3Checked automatically with code checker

Synopsis:Avoid unnecessary comparisons in boolean expressions
Language:Java
Severity Level:4
Category:Design


Description:
Avoid unnecessary comparisons in boolean expressions - this complicates simple code.
public class Bar {
 // can be simplified to
 // bar = isFoo();
 private boolean bar = (isFoo() == true);

 public isFoo() { return false;}
}