Accessing a non-public field of another object
Reports accesses to
protected fields of another object. Java allows access to such fields for objects of the same class as the current object but some coding styles discourage this use. Additionally, such direct access to
private fields may fail in component-oriented architectures, such as Spring or Hibernate, that expect all access to other objects to be through method calls so the framework can mediate access using proxies.
A quick-fix to encapsulate the field is available.
Configure the inspection:
Use the Ignore accesses from the same class option to ignore access from the same class and only report access from inner or outer classes.
To ignore access from inner classes as well, use the nested Ignore accesses from inner classes.
Use the Ignore accesses from 'equals()' method to ignore access from an
Ignore accesses from the same class
Ignore accesses from inner classes
Ignore accesses from 'equals()' method
IntelliJ IDEA 2023.3, Qodana for JVM 2023.3