Skip to content

Commit 027bf25

Browse files
committed
[MPMD-343] - Upgrade to PMD 6.46.0
1 parent 3585936 commit 027bf25

File tree

7 files changed

+12
-32
lines changed

7 files changed

+12
-32
lines changed

pom.xml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ under the License.
8989
<doxiaVersion>1.11.1</doxiaVersion>
9090
<doxiaSitetoolsVersion>1.11.1</doxiaSitetoolsVersion>
9191
<javaVersion>8</javaVersion><!-- Because PMD 6.35.0+ requires Java 8 -->
92-
<pmdVersion>6.45.0</pmdVersion>
92+
<pmdVersion>6.46.0</pmdVersion>
9393
<slf4jVersion>1.7.36</slf4jVersion>
9494
<sitePluginVersion>3.12.0</sitePluginVersion>
9595
<projectInfoReportsPluginVersion>3.3.0</projectInfoReportsPluginVersion>
@@ -253,8 +253,8 @@ under the License.
253253
<dependency>
254254
<groupId>commons-io</groupId>
255255
<artifactId>commons-io</artifactId>
256-
<version>2.6</version>
257-
<!-- scope>test</scope> Required by PMD transitively. -->
256+
<version>2.11.0</version>
257+
<scope>test</scope>
258258
</dependency>
259259
<dependency>
260260
<groupId>org.slf4j</groupId>

src/it/mpmd-138/verify.groovy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ File buildLog = new File( basedir, 'build.log' )
2222
assert buildLog.exists()
2323

2424
// Module 1
25-
assert 1 == buildLog.getText().count('[INFO] PMD Failure: test.MyClass:27 Rule:EmptyStatementNotInLoop Priority:3 An empty statement (semicolon) not part of a loop')
25+
assert 1 == buildLog.getText().count('[INFO] PMD Failure: test.MyClass:27 Rule:UnnecessarySemicolon Priority:3 Unnecessary semicolon')
2626
assert 1 == buildLog.getText().count('[INFO] PMD Failure: test.MyClass:28 Rule:UnnecessaryReturn Priority:3 Avoid unnecessary return statements')
2727
assert 1 == buildLog.getText().count('[INFO] You have 2 PMD violations. For more details see:')
2828

src/main/resources/rulesets/java/maven-pmd-plugin-default.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -40,13 +40,15 @@ under the License.
4040
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
4141
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
4242

43+
<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
4344
<rule ref="category/java/codestyle.xml/ExtendsObject" />
4445
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
4546
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
4647
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
4748
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
4849
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
4950
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
51+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
5052
<rule ref="category/java/codestyle.xml/UselessParentheses" />
5153
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />
5254

@@ -63,15 +65,6 @@ under the License.
6365
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
6466
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
6567
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
66-
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
67-
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
68-
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
69-
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
70-
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
71-
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
72-
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
73-
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
74-
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
7568
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
7669
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
7770
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />

src/main/resources/rulesets/maven.xml

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,15 @@ under the License.
4141
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
4242
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
4343

44+
<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
4445
<rule ref="category/java/codestyle.xml/ExtendsObject" />
4546
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
4647
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
4748
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
4849
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
4950
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
5051
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
52+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
5153
<rule ref="category/java/codestyle.xml/UselessParentheses" />
5254
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />
5355

@@ -68,15 +70,6 @@ under the License.
6870
<property name="allowCommentedBlocks" value="true"/>
6971
</properties>
7072
</rule>
71-
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
72-
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
73-
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
74-
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
75-
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
76-
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
77-
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
78-
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
79-
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
8073
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
8174
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
8275
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />

src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ Upgrading PMD at Runtime
8888
*--------------------------------------------------------------------------------*--------------------------------------------------*
8989
| <<maven-pmd-plugin>> | <<PMD>> |
9090
*--------------------------------------------------------------------------------*--------------------------------------------------*
91-
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.17.0/}3.17.0}} | {{{https://pmd.github.io/pmd-6.45.0/}6.45.0}} |
91+
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.17.0/}3.17.0}} | {{{https://pmd.github.io/pmd-6.46.0/}6.46.0}} |
9292
*--------------------------------------------------------------------------------*--------------------------------------------------*
9393
| {{{https://maven.apache.org/plugins-archives/maven-pmd-plugin-3.16.0/}3.16.0}} | {{{https://pmd.github.io/pmd-6.42.0/}6.42.0}} |
9494
*--------------------------------------------------------------------------------*--------------------------------------------------*

src/site/apt/examples/usingRuleSets.apt.vm

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,15 @@ The default ruleset
102102
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
103103
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />
104104

105+
<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
105106
<rule ref="category/java/codestyle.xml/ExtendsObject" />
106107
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
107108
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
108109
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
109110
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
110111
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
111112
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
113+
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
112114
<rule ref="category/java/codestyle.xml/UselessParentheses" />
113115
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />
114116

@@ -125,15 +127,6 @@ The default ruleset
125127
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
126128
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
127129
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
128-
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
129-
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
130-
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
131-
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
132-
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
133-
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
134-
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
135-
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
136-
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
137130
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
138131
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
139132
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />

src/site/markdown/releasenotes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ under the License.
5252
* [MPMD-339](https://issues.apache.org/jira/browse/MPMD-339) - Upgrade plugins in ITs
5353
* [MPMD-340](https://issues.apache.org/jira/browse/MPMD-340) - Upgrade Maven Reporting API/Impl to 3.1.0
5454
* [MPMD-341](https://issues.apache.org/jira/browse/MPMD-341) - Upgrade Maven Plugin Test Harness to 3.3.0
55+
* [MPMD-343](https://issues.apache.org/jira/browse/MPMD-343) - Upgrade to PMD 6.46.0
5556

5657
## Version 3.16.0
5758

0 commit comments

Comments
 (0)