#1431 SuspiciousEqualsMethodName false positive
This commit is contained in:
@ -318,6 +318,7 @@ intention to override the equals(Object) method.
|
||||
count(FormalParameters/*) = 2
|
||||
and ../ResultType/Type/PrimitiveType[@Image = 'boolean']
|
||||
and FormalParameters//ClassOrInterfaceType[@Image = 'Object' or @Image = 'java.lang.Object']
|
||||
and not(../../Annotation/MarkerAnnotation/Name[@Image='Override'])
|
||||
)
|
||||
]
|
||||
| //MethodDeclarator[@Image = 'equal']
|
||||
|
@ -33,4 +33,17 @@ public class Foo {
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
|
||||
<test-code>
|
||||
<description>#1431 SuspiciousEqualsMethodName false positive</description>
|
||||
<expected-problems>0</expected-problems>
|
||||
<code><![CDATA[
|
||||
public class Demo implements org.hibernate.usertype.UserType {
|
||||
@Override
|
||||
public boolean equals(Object x, Object y) throws HibernateException {
|
||||
return x == null ? y == null : x.equals(y);
|
||||
}
|
||||
}
|
||||
]]></code>
|
||||
</test-code>
|
||||
</test-data>
|
||||
|
@ -23,6 +23,8 @@
|
||||
* [#1438](https://sourceforge.net/p/pmd/bugs/1438/): UseNotifyAllInsteadOfNotify gives false positive
|
||||
* java-finalizers/AvoidCallingFinalize
|
||||
* [#1440](https://sourceforge.net/p/pmd/bugs/1440/): NPE in AvoidCallingFinalize
|
||||
* java-naming/SuspiciousEqualsMethodName
|
||||
* [#1431](https://sourceforge.net/p/pmd/bugs/1431/): SuspiciousEqualsMethodName false positive
|
||||
* java-optimizations/RedundantFieldInitializer
|
||||
* [#1443](https://sourceforge.net/p/pmd/bugs/1443/): RedundantFieldInitializer: False positive for small floats
|
||||
* java-unusedcode/UnusedPrivateField
|
||||
|
Reference in New Issue
Block a user