Skip to content

Check: Required Overrides

Madeline Kahn edited this page Mar 27, 2024 · 2 revisions
  • Name: "requiredOverrides"
  • Default: Enabled

Description

This check performs the following two validations for methods that imply other methods should be overridden:

  • Generates a warning for any class that extends the interface Comparable and implements compareTo(CLASS) (where CLASS is the type of the class itself), but does not also implement equals(Object).
  • Generates an error for any class that implements equals(Object) but does not also implement hashCode().