[java] Fix rule doc for SingularField

Closes pmd/pmd.github.io#14
Co-authored-by: Zustin <87302257+Zustin@users.noreply.github.com>
This commit is contained in:
Andreas Dangel
2023-04-04 18:30:00 +02:00
parent 36efe64586
commit 7a89f550d9

View File

@ -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;
}