I have a variable that is used in one method. So my linter is telling me to make it local. However I like it being a class level variable in case it any one else modifies the code and needs to use that variable. If it is not class level they might miss it in the method and make a new duplicate variable?
Is my logic reasonable or should I just make it a local variable?
Here is the code :
public class CustomPasswordTransformationMethod extends PasswordTransformationMethod {
. . .
private final char DOT_CHAR = '●';
. . .
public char charAt(int index) {
if (index < ((length()) - unObfuscated)) return DOT_CHAR;
return mSource.charAt(index);
}
}