Merge branch 'ignore-method-name-on-override' of https://github.com/Monits/pmd into pr-97

This commit is contained in:
Andreas Dangel
2016-06-12 19:03:15 +02:00
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>