#2160 (comment)
Affects PMD Version:
6.20.0
Rule:
LawOfDemeter.
Description:
Direct access of fields is flagged as static access. Direct access of fields should be permitted when allowed for package-private.
Code Sample demonstrating the issue:
import java.time.LocalDate;
public class Person {
LocalDate birthday;
public static int compareByAge(Person a, Person b) {
return a.birthday.compareTo(b.birthday);
}
}
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]
#2160 (comment)
Affects PMD Version:
6.20.0
Rule:
LawOfDemeter.
Description:
Direct access of fields is flagged as static access. Direct access of fields should be permitted when allowed for package-private.
Code Sample demonstrating the issue:
Running PMD through: [CLI | Ant | Maven | Gradle | Designer | Other]