Query module HashedButNoHash

name
Hashed value without hashCode definition
description
Classes that define an ‘equals’ method but no ‘hashCode’ method, and whose instances are stored in a hashing data structure, can lead to unexpected results.
kind
problem
problem.severity
error
precision
very-high
id
java/hashing-without-hashcode
tags
reliability correctness

Imports

Equality
java

Provides all default Java QL imports.

Predicates

eqNoHash

A class that defines an equals method but no hashCode method.

hashingMethod
usedInHash

Holds if e is an expression in which t is used in a hashing data structure.