Why this matters
Omitting @Override when overriding methods can lead to accidental method overloading instead of overriding, causing subtle bugs.
Ensure that all overridden methods explicitly use the @Override annotation.
Omitting @Override when overriding methods can lead to accidental method overloading instead of overriding, causing subtle bugs.
Side-by-side examples engineers can pattern-match during review.
public void equals(Object obj) {
// Incorrect override
}@Override
public void equals(Object obj) {
// Correct override
}From the same buckets as this rule.