Update changelog, improve test for new CommentDefaultAccessModifier rule

This commit is contained in:
Andreas Dangel
2015-07-26 19:20:47 +02:00
parent 3b60cac700
commit f963f76fd4
4 changed files with 10 additions and 1 deletions

View File

@ -8,6 +8,7 @@
This ruleset contains links to rules that are new in PMD v5.4.0
</description>
<rule ref="rulesets/java/comments.xml/CommentDefaultAccessModifier"/>
<rule ref="rulesets/java/design.xml/SingleMethodSingleton"/>
<rule ref="rulesets/java/design.xml/SingletonClassReturningNewInstance"/>

View File

@ -77,7 +77,7 @@ A rule for the politically correct... we don't want to offend anyone.
</rule>
<rule name="CommentDefaultAccessModifier"
since="5.3.2"
since="5.4.0"
class="net.sourceforge.pmd.lang.java.rule.comments.CommentDefaultAccessModifierRule"
message="Missing commented default access modifier"
externalInfoUrl="${pmd.website.baseurl}/rules/java/comments.html#CommentDefaultAccessModifier">

View File

@ -24,6 +24,7 @@ public class Foo {
<test-code>
<description>Some methods and Fields with default access modifier in a class</description>
<expected-problems>2</expected-problems>
<expected-linenumbers>3,10</expected-linenumbers>
<code-ref id="some-methods-fields-with-default-access-modifier"/>
</test-code>
@ -47,6 +48,7 @@ public class Foo {
<test-code>
<description>All methods and Field with default access modifier in a class</description>
<expected-problems>6</expected-problems>
<expected-linenumbers>2,3,4,6,9,12</expected-linenumbers>
<code-ref id="all-methods-fields-with-default-access-modifier"/>
</test-code>
@ -106,6 +108,7 @@ public class Foo {
<test-code>
<description>Nested classes with default access modifier</description>
<expected-problems>2</expected-problems>
<expected-linenumbers>7,10</expected-linenumbers>
<code-ref id="nested-class-with-default-access-modifier"/>
</test-code>
@ -130,6 +133,7 @@ public class Foo {
<description>Test own regex to default access modifier rule</description>
<rule-property name="regex">\/\*\s+package-private\s+\*\/</rule-property>
<expected-problems>3</expected-problems>
<expected-linenumbers>2,4,13</expected-linenumbers>
<code-ref id="own-regex-to-default-access-modifier-rule"/>
</test-code>
</test-data>

View File

@ -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:**