PB.IEB
Avoid "if" statements with empty bodies
Description
This rule flags any "if" statement with an empty body.
"if" statements that are immediately followed by closing statements (for example, a semicolon) are usually typos.
Example
package PB;
public class IEB {
void method (int i) {
if (i < 0) ;
System.out.println("negative i");
}
}
The `println()' statement will always be executed regardless of the value of `i'.
Repair
Remove the unnecessary semicolon.
|