Home / Vulnerability Database / Java : Only one of method Equals() and GetHashCode() defined
Java
Java : Only one of method Equals() and GetHashCode() defined
Overview
Only one of the equals() and hashCode() methods is defined in the class. This violates the Java conventions and may lead to incorrect behavior when working with collections.
Equals() and hashCode() methods are defined in class Object. Class Object is the root of the class hierarchy. All objects implement the methods of this class. And If you override one, then you should override the other, otherwise, equal (in the sense of equals()) objects may have different values for hashCode().
LOW
DerScanner Severity Score
Do you want to fix Java : Only one of method Equals() and GetHashCode() defined in your application?
See also
Java
Java : Race condition
Java
Java : Text4Shell Vulnerability
Java
