PB.FEB
Avoid "for" statements with empty bodies
Description
This rule flags any "for" statement with an empty body.
"for" statements that are immediately followed by a closing statement (for example, a semicolon) are usually typos.
Example
package PB;
public class FEB {
void method () {
int i;
for (i = 0; i < 10; ++i) ;
System.out.println (i);
}
}
The `println()' will only be executed once when i==11.
Repair
Remove the unnecessary semicolon.
|