Edit me

??-January-2019 - 6.11.0

The PMD team is pleased to announce PMD 6.11.0.

This is a minor release.

New and noteworthy

### Updatex Apex Support

  • The Apex language support has been bumped to version 45 (Spring ‘19). All new language features are now properly parsed and processed.

New Rules

  • The new Java rule UnsynchronizedStaticFormatter (java-multithreading) detects unsynchronized usages of static java.text.Format instances. This rule is a more generic replacement of the rule UnsynchronizedStaticDateFormatter which focused just on DateFormat.

  • 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 property ignoreForEachDecl, which is by default disabled. The new property allows for ignoring non-final loop variables in a for-each statement.

Deprecated Rules

Fixed Issues

  • apex
    • #1542: [apex] Include the documentation category
    • #1546: [apex] PMD parsing exception for Apex classes using ‘inherited sharing’ keyword
  • java
    • #1556: [java] Default methods should not be considered abstract
    • #1578: [java] Private field is detected as public inside nested classes in interfaces
  • java-bestpractices
    • #658: [java] OneDeclarationPerLine: False positive for loops
    • #1518: [java] New rule: AvoidReassigningLoopVariable
    • #1519: [java] New rule: ForLoopVariableCount
  • java-codestyle
    • #1513: [java] LocalVariableCouldBeFinal: allow excluding the variable in a for-each loop
    • #1517: [java] New Rule: UseDiamondOperator
  • java-errorprone
    • #1035: [java] ReturnFromFinallyBlock: False positive on lambda expression in finally block
    • #1549: [java] NPE in PMD 6.8.0 InvalidSlf4jMessageFormat
  • java-multithreading
    • #1533: [java] New rule: UnsynchronizedStaticFormatter
  • plsql
    • #1507: [plsql] Parse Exception when using ‘   ’ operator in where clause
    • #1508: [plsql] Parse Exception when using SELECT COUNT(*)
    • #1509: [plsql] Parse Exception with OUTER/INNER Joins
    • #1511: [plsql] Parse Exception with IS NOT NULL

API Changes

Deprecated API

External Contributions