Don't report bad method names on @Override

This commit is contained in:
Juan Martín Sotuyo Dodero
2016-06-08 19:59:58 -03:00
parent 426427e9f3
commit fda753813b
2 changed files with 15 additions and 0 deletions

View File

@ -509,6 +509,7 @@ MethodDeclarator[count(FormalParameters/FormalParameter) = 0 or $checkParameteri
[starts-with(@Image, 'get')]
and
ResultType/Type/PrimitiveType[@Image = 'boolean']
and not(../Annotation//Name[@Image = 'Override'])
]
]]>
</value>

View File

@ -35,6 +35,20 @@ public class Foo {
</test-code>
<test-code>
<description><![CDATA[
Should not match on methods annotated with @Override
]]></description>
<expected-problems>0</expected-problems>
<code><![CDATA[
public class Foo implements Toggleable {
@Override
public boolean getEnabled() {
return true;
}
}
]]></code>
</test-code>
<test-code>
<description><![CDATA[
Should match on multiple parameters when checkParameterizedMethods = true
]]></description>
<expected-problems>1</expected-problems>