@@ -20,14 +20,15 @@ under the License.
2020<ruleset name =" Default Maven PMD Plugin Ruleset" xmlns =" http://pmd.sourceforge.net/ruleset/2.0.0" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" http://pmd.sourceforge.net/ruleset/2.0.0 http://pmd.sourceforge.net/ruleset_2_0_0.xsd" >
2121
2222 <description >
23- The default ruleset used by the Maven PMD Plugin, when no other ruleset is specified.
24- It contains the rules of the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports,
25- java-unnecessary, java-unusedcode.
23+ Custom PMD ruleset, compatible with PMD 7.x.
2624
27- This ruleset might be used as a starting point for an own customized ruleset [0].
25+ Based on the old (pre PMD 6.0.0) rulesets java-basic, java-empty, java-imports,
26+ java-unnecessary, java-unusedcode, migrated for PMD 7.
2827
29- [0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html
30- </description >
28+ This ruleset might be used as a starting point for an own customized ruleset [0].
29+
30+ [0] https://pmd.github.io/latest/pmd_userdocs_making_rulesets.html
31+ </description >
3132
3233 <rule ref =" category/java/bestpractices.xml/AvoidUsingHardCodedIP" />
3334 <rule ref =" category/java/bestpractices.xml/CheckResultSet" />
@@ -46,6 +47,14 @@ under the License.
4647 <rule ref =" category/java/codestyle.xml/UselessParentheses" />
4748 <rule ref =" category/java/codestyle.xml/UselessQualifiedThis" />
4849
50+ <!-- PMD 7: replaces EmptyFinallyBlock, EmptyIfStmt, EmptyInitializer,
51+ EmptyStatementBlock, EmptySwitchStatements, EmptySynchronizedBlock,
52+ EmptyTryBlock, EmptyWhileStmt (all removed in PMD 7) -->
53+ <rule ref =" category/java/codestyle.xml/EmptyControlStatement" />
54+
55+ <!-- PMD 7: replaces EmptyStatementNotInLoop (removed in PMD 7) -->
56+ <rule ref =" category/java/codestyle.xml/UnnecessarySemicolon" />
57+
4958 <rule ref =" category/java/codestyle.xml/MethodNamingConventions" >
5059 <properties >
5160 <property name =" methodPattern" value =" [a-z][a-zA-Z0-9]*" />
@@ -63,14 +72,15 @@ under the License.
6372 <rule ref =" category/java/design.xml/UselessOverridingMethod" />
6473 <rule ref =" category/java/design.xml/AvoidThrowingNullPointerException" />
6574
66-
6775 <rule ref =" category/java/design.xml/CyclomaticComplexity" >
6876 <properties >
6977 <property name =" classReportLevel" value =" 200" />
7078 <property name =" methodReportLevel" value =" 120" />
7179 </properties >
7280 </rule >
73- <rule ref =" category/java/design.xml/ExcessiveMethodLength" />
81+
82+ <!-- PMD 7: ExcessiveMethodLength was removed, use NcssCount instead -->
83+ <rule ref =" category/java/design.xml/NcssCount" />
7484
7585 <rule ref =" category/java/errorprone.xml/AvoidBranchingStatementAsLastInLoop" />
7686 <rule ref =" category/java/errorprone.xml/AvoidDecimalLiteralsInBigDecimalConstructor" />
@@ -80,32 +90,25 @@ under the License.
8090 <rule ref =" category/java/errorprone.xml/CheckSkipResult" />
8191 <rule ref =" category/java/errorprone.xml/ClassCastExceptionWithToArray" />
8292 <rule ref =" category/java/errorprone.xml/DontUseFloatTypeForLoopIndices" />
93+
94+ <!-- EmptyCatchBlock is explicitly kept as a separate rule in PMD 7 -->
8395 <rule ref =" category/java/errorprone.xml/EmptyCatchBlock" />
84- <rule ref =" category/java/errorprone.xml/EmptyFinallyBlock" />
85- <rule ref =" category/java/errorprone.xml/EmptyIfStmt" />
86- <rule ref =" category/java/errorprone.xml/EmptyInitializer" />
87- <rule ref =" category/java/errorprone.xml/EmptyStatementBlock" />
88- <rule ref =" category/java/errorprone.xml/EmptyStatementNotInLoop" />
89- <rule ref =" category/java/errorprone.xml/EmptySwitchStatements" />
90- <rule ref =" category/java/errorprone.xml/EmptySynchronizedBlock" />
91- <rule ref =" category/java/errorprone.xml/EmptyTryBlock" />
92- <rule ref =" category/java/errorprone.xml/EmptyWhileStmt" />
96+
9397 <rule ref =" category/java/errorprone.xml/JumbledIncrementer" />
9498 <rule ref =" category/java/errorprone.xml/MisplacedNullCheck" />
9599 <rule ref =" category/java/errorprone.xml/OverrideBothEqualsAndHashcode" />
96100 <rule ref =" category/java/errorprone.xml/ReturnFromFinallyBlock" />
97101 <rule ref =" category/java/errorprone.xml/UnconditionalIfStatement" />
98102 <rule ref =" category/java/errorprone.xml/UnnecessaryConversionTemporary" />
99103 <rule ref =" category/java/errorprone.xml/UnusedNullCheckInEquals" />
100- <rule ref =" category/java/errorprone.xml/UselessOperationOnImmutable" />
101-
102- <!-- for Codazy -->
104+
105+ <!-- for Codazy -->
103106 <rule ref =" category/java/multithreading.xml/AvoidThreadGroup" />
104107 <rule ref =" category/java/multithreading.xml/DontCallThreadRun" />
105108 <rule ref =" category/java/multithreading.xml/DoubleCheckedLocking" />
106109
107110 <rule ref =" category/java/performance.xml/BigIntegerInstantiation" />
108111
109- <!-- for Codazy -->
112+ <!-- for Codazy -->
110113 <!-- <rule ref="category/java/documentation.xml/UncommentedEmptyMethodBody" /> -->
111- </ruleset >
114+ </ruleset >
0 commit comments