MLOWP - Mixing Logical Operators Without Parentheses
An expression containing multiple logical operators together should be parenthesized properly.
Wrong
boolean a, b, c;
// do something
if ( a || b && c ) {
// do something
return;
}
}
Tip: Use parenthesis to clarify complex logical expression to reader.
Right
boolean a, b, c;
// do something
if ( a || (b && c) ) {
// do something
return;
}
}