diff --git a/pmd-java/src/main/resources/category/java/design.xml b/pmd-java/src/main/resources/category/java/design.xml index ead5ceb07c..e69ded8f7e 100644 --- a/pmd-java/src/main/resources/category/java/design.xml +++ b/pmd-java/src/main/resources/category/java/design.xml @@ -1349,12 +1349,12 @@ Limitations: We can only check private fields for now. public class Foo { private int x; // this will be reported - public void foo(int y) { + public int foo(int y) { x = y + 5; // assigned before any read return x; } - public void fooOk(int y) { + public int fooOk(int y) { int z = y + 5; // might as well be a local like here return z; }