Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

equals method fails for subtypes
equals method overrides equals in superclass and may not be symmetric
ToolVersionCheckerDescription
CodeSonar
Include Page
CodeSonar_V
CodeSonar_V
FB.BAD_PRACTICE.EQ_GETCLASS_AND_CLASS_CONSTANT
FB.CORRECTNESS.OVERRIDING_EQUALS_NOT_SYMMETRIC

JAVA.COMPARE.CTO.ASSYM
JAVA.IDEF.NOEQUALS
JAVA.IDEF.CTONOEQ
JAVA.IDEF.CTOEQ

Asymmetric compareTo (Java)
Missing Equals Override (Java)
compareTo without equals (Java)
compareTo/equals mismatch (Java)

Parasoft Jtest

Include Page
Parasoft_V
Parasoft_V

CERT.MET08.EQREFLMake sure implementation of Object.equals(Object) is reflexive
SonarQube
Include Page
SonarQube_V
SonarQube_V
S2162"equals" methods should be symmetric and work for subclasses


Related Guidelines

MITRE CWE

CWE-697, Insufficient Comparison

...