Menu

#1431 [java] SuspiciousEqualsMethodName: false positive

PMD-5.3.6
closed
java (55)
PMD
3-Major
Bug
5.3.3
SuspiciousEqualsMethodName
2016-06-25
2015-10-21
No

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)

Discussion

  • Andreas Dangel

    Andreas Dangel - 2015-11-19
    • status: open --> closed
    • assigned_to: Andreas Dangel
    • Milestone: PMD-5.3.3 --> PMD-5.3.6
     
  • Andreas Dangel

    Andreas Dangel - 2016-06-25
    • labels: --> java
    • summary: SuspiciousEqualsMethodName false positive --> [java] SuspiciousEqualsMethodName: false positive
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.