I need a PMD rule that will find “getters” in code. By “getter” I mean a method with any name that returns the value of an object field.
An example of a method that would violate this rule:
class A {
private B b;
// f() violates the rule
B f() { return b; }
}