MISC.IFBLK
"if" statements should have a block
Description
This rule flags "if" statements that do not have a block.
"if" statements are less error-prone if they have a block.
Example
package MISC;
public class IFBLK {
public void method (boolean b) {
if (b) // violation
System.out.println ("inside of if");
if (b) {
System.out.println ("inside of if");
}
}
}
Repair
Provide a block for each "if" statements.
|