#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>
|
||||
|
Reference in New Issue
Block a user