Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MPMD-343] - Upgrade to PMD 6.46.0 #71

Merged
merged 1 commit into from May 31, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions pom.xml
Expand Up @@ -89,7 +89,7 @@ under the License.
<doxiaVersion>1.11.1</doxiaVersion>
<doxiaSitetoolsVersion>1.11.1</doxiaSitetoolsVersion>
<javaVersion>8</javaVersion><!-- Because PMD 6.35.0+ requires Java 8 -->
<pmdVersion>6.45.0</pmdVersion>
<pmdVersion>6.46.0</pmdVersion>
<slf4jVersion>1.7.36</slf4jVersion>
<sitePluginVersion>3.12.0</sitePluginVersion>
<projectInfoReportsPluginVersion>3.3.0</projectInfoReportsPluginVersion>
Expand Down Expand Up @@ -253,8 +253,8 @@ under the License.
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<!-- scope>test</scope> Required by PMD transitively. -->
<version>2.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
Expand Down
2 changes: 1 addition & 1 deletion src/it/mpmd-138/verify.groovy
Expand Up @@ -22,7 +22,7 @@ File buildLog = new File( basedir, 'build.log' )
assert buildLog.exists()

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

Expand Down
11 changes: 2 additions & 9 deletions src/main/resources/rulesets/java/maven-pmd-plugin-default.xml
Expand Up @@ -40,13 +40,15 @@ under the License.
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />

<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
<rule ref="category/java/codestyle.xml/ExtendsObject" />
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
<rule ref="category/java/codestyle.xml/UselessParentheses" />
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />

Expand All @@ -63,15 +65,6 @@ under the License.
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
Expand Down
11 changes: 2 additions & 9 deletions src/main/resources/rulesets/maven.xml
Expand Up @@ -41,13 +41,15 @@ under the License.
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />

<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
<rule ref="category/java/codestyle.xml/ExtendsObject" />
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
<rule ref="category/java/codestyle.xml/UselessParentheses" />
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />

Expand All @@ -68,15 +70,6 @@ under the License.
<property name="allowCommentedBlocks" value="true"/>
</properties>
</rule>
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
Expand Down
2 changes: 1 addition & 1 deletion src/site/apt/examples/upgrading-PMD-at-runtime.apt.vm
Expand Up @@ -88,7 +88,7 @@ Upgrading PMD at Runtime
*--------------------------------------------------------------------------------*--------------------------------------------------*
| <<maven-pmd-plugin>> | <<PMD>> |
*--------------------------------------------------------------------------------*--------------------------------------------------*
| {{{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}} |
| {{{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}} |
*--------------------------------------------------------------------------------*--------------------------------------------------*
| {{{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}} |
*--------------------------------------------------------------------------------*--------------------------------------------------*
Expand Down
11 changes: 2 additions & 9 deletions src/site/apt/examples/usingRuleSets.apt.vm
Expand Up @@ -102,13 +102,15 @@ The default ruleset
<rule ref="category/java/bestpractices.xml/UnusedPrivateField" />
<rule ref="category/java/bestpractices.xml/UnusedPrivateMethod" />

<rule ref="category/java/codestyle.xml/EmptyControlStatement" />
<rule ref="category/java/codestyle.xml/ExtendsObject" />
<rule ref="category/java/codestyle.xml/ForLoopShouldBeWhileLoop" />
<rule ref="category/java/codestyle.xml/TooManyStaticImports" />
<rule ref="category/java/codestyle.xml/UnnecessaryFullyQualifiedName" />
<rule ref="category/java/codestyle.xml/UnnecessaryImport" />
<rule ref="category/java/codestyle.xml/UnnecessaryModifier" />
<rule ref="category/java/codestyle.xml/UnnecessaryReturn" />
<rule ref="category/java/codestyle.xml/UnnecessarySemicolon" />
<rule ref="category/java/codestyle.xml/UselessParentheses" />
<rule ref="category/java/codestyle.xml/UselessQualifiedThis" />

Expand All @@ -125,15 +127,6 @@ The default ruleset
<rule ref="category/java/errorprone.xml/ClassCastExceptionWithToArray" />
<rule ref="category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
<rule ref="category/java/errorprone.xml/EmptyCatchBlock" />
<rule ref="category/java/errorprone.xml/EmptyFinallyBlock" />
<rule ref="category/java/errorprone.xml/EmptyIfStmt" />
<rule ref="category/java/errorprone.xml/EmptyInitializer" />
<rule ref="category/java/errorprone.xml/EmptyStatementBlock" />
<rule ref="category/java/errorprone.xml/EmptyStatementNotInLoop" />
<rule ref="category/java/errorprone.xml/EmptySwitchStatements" />
<rule ref="category/java/errorprone.xml/EmptySynchronizedBlock" />
<rule ref="category/java/errorprone.xml/EmptyTryBlock" />
<rule ref="category/java/errorprone.xml/EmptyWhileStmt" />
<rule ref="category/java/errorprone.xml/JumbledIncrementer" />
<rule ref="category/java/errorprone.xml/MisplacedNullCheck" />
<rule ref="category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
Expand Down
1 change: 1 addition & 0 deletions src/site/markdown/releasenotes.md
Expand Up @@ -52,6 +52,7 @@ under the License.
* [MPMD-339](https://issues.apache.org/jira/browse/MPMD-339) - Upgrade plugins in ITs
* [MPMD-340](https://issues.apache.org/jira/browse/MPMD-340) - Upgrade Maven Reporting API/Impl to 3.1.0
* [MPMD-341](https://issues.apache.org/jira/browse/MPMD-341) - Upgrade Maven Plugin Test Harness to 3.3.0
* [MPMD-343](https://issues.apache.org/jira/browse/MPMD-343) - Upgrade to PMD 6.46.0

## Version 3.16.0

Expand Down