??-January-2019 - 6.11.0
The PMD team is pleased to announce PMD 6.11.0.
This is a minor release.
New and noteworthy
New Rules
-
The new Java rule
ForLoopVariableCount
(java-bestpractices
) checks for the number of control variables in a for-loop. Having a lot of control variables makes it harder to understand what the loop does. The maximum allowed number of variables is by default 1 and can be configured by a property. -
The new Java rule
AvoidReassigningLoopVariables
(java-bestpractices
) searches for loop variables that are reassigned. Changing the loop variables additionally to the loop itself can lead to hard-to-find bugs. -
The new Java rule
UseDiamondOperator
(java-codestyle
) looks for constructor calls with explicit type parameters. Since Java 1.7, these type parameters are not necessary anymore, as they can be inferred now.
Modified Rules
- The Java rule
LocalVariableCouldBeFinal
(java-codestyle
) has a new propertyignoreForEachDecl
, which is by default disabled. The new property allows for ignoring non-final loop variables in a for-each statement.
Fixed Issues
- apex
- #1542: [apex] Include the documentation category
- java
- #1556: [java] Default methods should not be considered abstract
- java-bestpractices
- java-codestyle
- java-errorprone
- #1035: [java] ReturnFromFinallyBlock: False positive on lambda expression in finally block
- plsql
API Changes
External Contributions
- #1503: [java] Fix for ReturnFromFinallyBlock false-positives - RishabhDeep Singh
- #1514: [java] LocalVariableCouldBeFinal: allow excluding the variable in a for-each loop - Kris Scheibe
- #1516: [java] OneDeclarationPerLine: Don’t report multiple variables in a for statement. - Kris Scheibe
- #1520: [java] New rule: ForLoopVariableCount: check the number of control variables in a for loop - Kris Scheibe
- #1521: [java] Upgrade to ASM7 for JDK 11 support - Mark Pritchard
- #1530: [java] New rule: AvoidReassigningLoopVariables - Kris Scheibe
- #1534: [java] This is the change regarding the usediamondoperator #1517 - hemanshu070