This rule is Obsolete | |
Synopsis: | If a field is only used by one method, consider making it a local variable |
Language: | Java |
Severity Level: | 4 |
Category: | Controversial |
Description: |
A field that's only used by one method could perhaps be replaced by a local variable.public class Foo { private int x; public void foo(int y) { x = y + 5; return x; } } |