ER-026 Avoid expressions like ? true : false

Severity2
Enabledyes
Waivable
RationaleSuch an expression is equivalent to itself and only clatters code and confuses maintainer
Violation
boolean b = i < RND_CHS_VAL ? true : false;
return b;
Fix
return i < RND_CHS_VAL;


Hammurapi 3 Copyright © 2004 Hammurapi Group. All Rights Reserved.