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 |
Loading...