Jtest logo




Contents  Previous  Next  Index

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.


Contents  Previous  Next  Index

ParaSoft logo
(888) 305-0041 info@parasoft.com Copyright © 1996-2001 ParaSoft