Inspectopedia Help

Class references one of its subclasses

Reports classes which contain references to one of their subclasses. Such references may be confusing and violate several rules of object-oriented design.

Example:

class Entity { // Warning: the class references its subclass void compare(SimpleEntity entity) { ... } } class SimpleEntity extends Entity { ... }

Inspection Details

By default bundled with:

IntelliJ IDEA 2024.1, Qodana for JVM 2024.1,

Can be installed with plugin:

Java, 241.16690

Last modified: 29 April 2024