MISC.FLV
Constant local variables should be declared as "final"
Description
This rule flags constant local variables that are not declared as "final".
Local variables that are initialized in a declaration whose values do not change throughout the block should be declared "final".
Example
package MISC;
public class FLV {
private void method () {
int size = 0; //violation
// do something but size's value do not change.
}
}
Repair
Make 'size' as a "final".
|