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.
|