27-February-2021 - 6.32.0
The PMD team is pleased to announce PMD 6.32.0.
This is a minor release.
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
andreportProtected
. 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
- plsql
- #3106: [plsql] ParseException while parsing EXECUTE IMMEDIATE ‘drop database link ‘ || linkname;
API Changes
Experimental APIs
- The experimental class
ASTTypeTestPattern
has been renamed toASTTypePattern
in order to align the naming to the JLS. - The experimental class
ASTRecordConstructorDeclaration
has been renamed toASTCompactConstructorDeclaration
in order to align the naming to the JLS. - The AST types and APIs around Pattern Matching and Records are not experimental anymore:
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
- #3098: [apex] ApexDoc optionally report private and protected - Jonathan Wiesel
- #3107: [plsql] Fix ParseException for EXECUTE IMMEDIATE str1||str2; - hvbtup
- #3125: [doc] Fix sample code indentation in documentation - Artur Dryomov
Stats
- 43 commits
- 21 closed tickets & PRs
- Days since last release: 27