While looking through the Java API source code I often see method parameters reassigned to local variables. Why is this ever done?
void foo(Object bar) {
Object baz = bar;
//...
}
This is in java.util.HashMap
public Collection<V> values() {
Collection<V> vs = values;
return (vs != null ? vs : (values = new Values()));
}