CWE-581: Object Model Violation: Just One of Equals and Hashcode Defined

ID CWE-581
Abstraction Variant
Structure Simple
Status Draft
The product does not maintain equal hashcodes for equal objects.

Java objects are expected to obey a number of invariants related to equality. One of these invariants is that equal objects must have equal hashcodes. In other words, if a.equals(b) == true then a.hashCode() == b.hashCode().

Modes of Introduction

Phase Note
Implementation

Applicable Platforms

Type Class Name Prevalence
Language Java

Relationships

View Weakness
# ID View Status # ID Name Abstraction Structure Status
CWE-1000 Research Concepts Draft CWE-573 Improper Following of Specification by Caller Class Simple Draft
CWE-1000 Research Concepts Draft CWE-697 Incorrect Comparison Pillar Simple Incomplete
Loading...
Loading...