From f963f76fd4849ea9048f01ff356df0c366ab0f69 Mon Sep 17 00:00:00 2001 From: Andreas Dangel Date: Sun, 26 Jul 2015 19:20:47 +0200 Subject: [PATCH] Update changelog, improve test for new CommentDefaultAccessModifier rule --- pmd-core/src/main/resources/rulesets/releases/540.xml | 1 + pmd-java/src/main/resources/rulesets/java/comments.xml | 2 +- .../java/rule/comments/xml/CommentDefaultAccessModifier.xml | 4 ++++ src/site/markdown/overview/changelog.md | 4 ++++ 4 files changed, 10 insertions(+), 1 deletion(-) diff --git a/pmd-core/src/main/resources/rulesets/releases/540.xml b/pmd-core/src/main/resources/rulesets/releases/540.xml index 1f8ac75d21..2d703b2286 100644 --- a/pmd-core/src/main/resources/rulesets/releases/540.xml +++ b/pmd-core/src/main/resources/rulesets/releases/540.xml @@ -8,6 +8,7 @@ This ruleset contains links to rules that are new in PMD v5.4.0 + diff --git a/pmd-java/src/main/resources/rulesets/java/comments.xml b/pmd-java/src/main/resources/rulesets/java/comments.xml index 9b9a2c03fa..a1ba9cd2e7 100755 --- a/pmd-java/src/main/resources/rulesets/java/comments.xml +++ b/pmd-java/src/main/resources/rulesets/java/comments.xml @@ -77,7 +77,7 @@ A rule for the politically correct... we don't want to offend anyone. diff --git a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/comments/xml/CommentDefaultAccessModifier.xml b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/comments/xml/CommentDefaultAccessModifier.xml index 094a335de2..bfe309f774 100755 --- a/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/comments/xml/CommentDefaultAccessModifier.xml +++ b/pmd-java/src/test/resources/net/sourceforge/pmd/lang/java/rule/comments/xml/CommentDefaultAccessModifier.xml @@ -24,6 +24,7 @@ public class Foo { Some methods and Fields with default access modifier in a class 2 + 3,10 @@ -47,6 +48,7 @@ public class Foo { All methods and Field with default access modifier in a class 6 + 2,3,4,6,9,12 @@ -106,6 +108,7 @@ public class Foo { Nested classes with default access modifier 2 + 7,10 @@ -130,6 +133,7 @@ public class Foo { Test own regex to default access modifier rule \/\*\s+package-private\s+\*\/ 3 + 2,4,13 \ No newline at end of file diff --git a/src/site/markdown/overview/changelog.md b/src/site/markdown/overview/changelog.md index 1d9a17280f..e55f0a03ec 100644 --- a/src/site/markdown/overview/changelog.md +++ b/src/site/markdown/overview/changelog.md @@ -29,6 +29,9 @@ the minimum required length of a variable name. * Modified Rule: rulesets/java/naming.xml/ShortMethodName: Additional property `minimum` to configure the minimum required length of a method name. +* New Rule: rulesets/java/comments.xml/CommentDefaultAccessModifier: In order to avoid mistakes with + forgotten access modifiers for methods, this rule ensures, that you explicitly mark the usage of the + default access modifier by placing a comment. **Pull Requests:** @@ -37,6 +40,7 @@ * [#54](https://github.com/pmd/pmd/pull/54): Add a new rulesets for Maven's POM rules * [#55](https://github.com/pmd/pmd/pull/55): Fix run.sh for paths with spaces * [#56](https://github.com/pmd/pmd/pull/56): Adding support for WSDL rules +* [#57](https://github.com/pmd/pmd/pull/57): Add default access modifier as comment rule **Bugfixes:**