MISC.EFB
Each "for" statement should have a block
Description
This rule flags any "for" statement that does not have a block.
"for" statements are less error-prone when they have blocks.
Example
package MISC;
public class EFB {
int i = 3;
void method () {
for (int i = 0; i < 10; i++)
System.out.println (i * i);
System.out.println (i);
}
}
Repair
Provide a block for each "for" statement regardless of the number of statements intended to be executed within the block.
|