I am currently using PMD to check the code quality of my project and it shows numerous violations. Among them the one is saying me to "Reassigning values to parameters is a questionable practice. Use a temporary local variable instead.".
Is it really necessary to do that for good programming practice. How bad it is if we does not use local variables for function parameters ?
It shows such violation if i have a function like this:
public class Foo {
private void foo(String bar) {
bar = "something else";
}
}
Can anyone please explain me the cons violating that rule?
In which cases violating the rule cause the negative impacts?