PMD 6.32.0 released

27 February 2021


27-February-2021 - 6.32.0

The PMD team is pleased to announce PMD 6.32.0.

This is a minor release.

Table Of Contents

New and noteworthy

Java 16 Support

This release of PMD brings support for Java 16. PMD supports JEP 394: Pattern Matching for instanceof and JEP 395: Records. Both have been promoted to be a standard language feature of Java 16.

PMD also supports JEP 397: Sealed Classes (Second Preview) as a preview language feature. In order to analyze a project with PMD that uses these language features, you’ll need to enable it via the environment variable PMD_JAVA_OPTS and select the new language version 16-preview:

export PMD_JAVA_OPTS=--enable-preview
./run.sh pmd -language java -version 16-preview ...

Note: Support for Java 14 preview language features have been removed. The version “14-preview” is no longer available.

Modified Rules

  • The Apex rule ApexDoc has two new properties: reportPrivate and reportProtected. Previously the rule only considered public and global classes, methods, and properties. With these properties, you can verify the existence of ApexDoc comments for private and protected methods as well. By default, these properties are disabled to preserve backwards compatible behavior.

Fixed Issues

  • apex-documentation
    • #3075: [apex] ApexDoc should support private access modifier
  • java
    • #3101: [java] NullPointerException when running PMD under JRE 11
  • java-bestpractices
    • #3132: [java] UnusedImports with static imports on subclasses
  • java-errorprone
    • #2716: [java] CompareObjectsWithEqualsRule: False positive with Enums
    • #3089: [java] CloseResource rule throws exception on spaces in property types
    • #3133: [java] InvalidLogMessageFormat FP with StringFormattedMessage and ParameterizedMessage
  • plsql
    • #3106: [plsql] ParseException while parsing EXECUTE IMMEDIATE ‘drop database link ‘ || linkname;

API Changes

Experimental APIs

Internal API

Those APIs are not intended to be used by clients, and will be hidden or removed with PMD 7.0.0. You can identify them with the @InternalApi annotation. You’ll also get a deprecation warning.

  • The protected or public member of the Java rule AvoidUsingHardCodedIPRule are deprecated and considered to be internal API. They will be removed with PMD 7.

External Contributions

Stats

  • 43 commits
  • 21 closed tickets & PRs
  • Days since last release: 27