HON - Hiding Of Names
Declarations of names should not hide other declarations of the same name. The option 'Formally' regulates whether hiding of names should be detected for parameter variable, if the only usage of it is to assign its value to the attribute with the same name.
Wrong
int index;
void func () {
int index;
// do something
}
void setIndex (int index) {
this.index = index;
}
}
Tip: Rename variable which hides attribute or another variable.
Right
int index;
void func () {
int index1;
// do something
}
void setIndex (int anIndex) {
this.index = anIndex;
}
}