Merge branch 'ignore-method-name-on-override' of https://github.com/Monits/pmd into pr-97
This commit is contained in:
@ -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>
|
||||
|
@ -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>
|
||||
|
Reference in New Issue
Block a user