Jtest logo




Contents  Previous  Next  Index

INIT.INITLV


Initialize all local variables explicitly

Description

This rule flags local variables that are not initialized in the declaration.

Example

 package INIT;
 public class LV {
     private method (int size) {
         int max;    // violation
         int count = size;
         for (int i = 0; i < count; i++ ) {
          // do something.
         }    
     }
 }

Repair

Initialize all local variables in declaration.


Contents  Previous  Next  Index

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