Rule: ImmutableField
Given a simple class like:
import lombok.Setter;
public class Junk {
@Setter
private String value = "abc";
public String something() {
return "blah" + value;
}
}
PMD 6.52.0 will report "Private field 'value' could be made final; it is only initialized in the declaration or constructor." This is a false positive because there is a generated setValue(String) method that can modify value.
Rule: ImmutableField
Given a simple class like:
PMD 6.52.0 will report "Private field 'value' could be made final; it is only initialized in the declaration or constructor." This is a false positive because there is a generated
setValue(String)method that can modifyvalue.