Query module DefineEqualsWhenAddingFields

name
Inherited equals() in subclass with added fields
description
If a class overrides ‘Object.equals’, and a subclass defines additional fields to those it inherits but does not re-define ‘equals’, the results of ‘equals’ may be wrong.
kind
problem
problem.severity
warning
precision
low
id
java/inherited-equals-with-added-fields
tags
reliability correctness

Imports

java

Provides all default Java QL imports.

Predicates

checksReferenceEquality

Holds if method em implements a reference equality check.

okForEquals
overridesDelegateEquals
readsOwnField
unsupportedEquals