diff --git a/pmd-java/src/main/resources/rulesets/java/naming.xml b/pmd-java/src/main/resources/rulesets/java/naming.xml index 0cf323ebcb..f0c09c6a80 100644 --- a/pmd-java/src/main/resources/rulesets/java/naming.xml +++ b/pmd-java/src/main/resources/rulesets/java/naming.xml @@ -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']) ] ]]> diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/naming/xml/BooleanGetMethodName.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/naming/xml/BooleanGetMethodName.xml index c3f7e47b05..a342649356 100644 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/naming/xml/BooleanGetMethodName.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/naming/xml/BooleanGetMethodName.xml @@ -35,6 +35,20 @@ public class Foo { + 0 + + + + 1 diff --git a/src/site/markdown/overview/changelog.md b/src/site/markdown/overview/changelog.md index c2d74a0239..898e0e6bcf 100644 --- a/src/site/markdown/overview/changelog.md +++ b/src/site/markdown/overview/changelog.md @@ -83,6 +83,7 @@ you'll need a java8 runtime environment. * [#94](https://github.com/pmd/pmd/pull/94): Added property, fixed code climate renderer output and deleted unused rulessets (Apex) * [#95](https://github.com/pmd/pmd/pull/95): Apex - New apex rule AvoidDmlStatementsInLoops * [#96](https://github.com/pmd/pmd/pull/96): Clean up Code Climate renderer +* [#97](https://github.com/pmd/pmd/pull/97): BooleanGetMethodName: Don't report bad method names on @Override **Bugfixes:**