dns-java
dns-java copied to clipboard
Local variable is shadowing class field
When I was going through one of the class AggregatingChangeNotifier, I saw there is a class field called records and there is a private method in the same class called aggregateSet(), in that method there is a local variable called records. This local variable will override the class field. Overriding or shadowing a variable declared in an outer scope can strongly impact the readability and maintainability, of a piece of code. Also there is a possibility of introducing a bug. So better to rename this local variable.
Screenshot for the same: