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.


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

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3


Java, 233.SNAPSHOT

Last modified: 13 July 2023