The lint should only trigger when both the shadowed variable and the variable that shadows it are used in the same method.
Alternative: Check how fields are referenced in other methods. If they are referenced by this. everywhere, then it is not that confusing to introduce a parameter/variable with the same name. Otherwise it could be confused.
Summary
The lint should only trigger when both the shadowed variable and the variable that shadows it are used in the same method.
Alternative: Check how fields are referenced in other methods. If they are referenced by
this.
everywhere, then it is not that confusing to introduce a parameter/variable with the same name. Otherwise it could be confused.Lint Name
AVOID_SHADOWING
Reproducer