Inspectopedia Help

'equals()' between objects of inconvertible types

Reports calls to equals() where the target and argument are of incompatible types.

While such a call might theoretically be useful, most likely it is a bug.

Example:

new HashSet<String>().equals(new TreeSet<Integer>());

Inspection options

Option

Type

Default

Warn if no mutual subclass found

Checkbox

true

Inspection Details

Available in:

IntelliJ IDEA 2023.3, Qodana for JVM 2023.3

Plugin:

Java, 233.SNAPSHOT

Last modified: 13 July 2023