[java] SingularField: lombok.Data false positive
A source code analyzer
Brought to you by:
adangel,
juansotuyo
Should PMD take into accaunt using of lombok?
import lombok.Data;
@Data
public class MyClass {
private String field1;
public MyClass(String field1) {
this.field1 = field1;
}
}
MyClass.java:8: Perhaps 'field1' could be replaced by a local variable.
See also [#1420].
Related
Issues:
#1420This bug will be fixed with PMD 5.4.3, 5.5.2, and later.
Commit: https://github.com/pmd/pmd/commit/0c75e5123cc1c3441c035ef45f62b220769fe9e7
with PMD 5.7, I get following:
Private field 'id' could be made final; it is only initialized in the declaration or constructor.
The id could be later set using Setter method.
Last edit: Satya Reddy 2017-05-26
See https://github.com/pmd/pmd/issues/410