[java] SuspiciousEqualsMethodName: false positive
A source code analyzer
Brought to you by:
adangel,
juansotuyo
False positive on overriding interafaces that declare other equals method.
Example:
import ;
public class Demo implements org.hibernate.usertype.UserType {
// ... skipped ...
@Override
public boolean equals(Object x, Object y) throws HibernateException {
return x == null ? y == null : x.equals(y);
}
}
The interface defines an equals method with two parameters.
Proposed solution: skip this rule if there is an @Override tag (that verifies that you're truly and correctly overriding the method)
Methods that have the @Override annotation are ignored now.
This bug will be fixed with PMD 5.3.6.
Commit: https://github.com/pmd/pmd/commit/d621707e2fefa0aae5f9237f66bbf6a547f30cdf