??-October-2019 - 6.19.0
The PMD team is pleased to announce PMD 6.19.0.
This is a minor release.
New and noteworthy
Modified Rules
-
The Java rules
InvalidSlf4jMessageFormat
andMoreThanOneLogger
(java-errorprone
) now both support Log4j2. -
The Java rule
LawOfDemeter
(java-design
) ignores now also Builders, that are not assigned to a local variable, but just directly used within a method call chain. The method, that creates the builder needs to end with “Builder”, e.g.newBuilder()
orinitBuilder()
works. This change fixes a couple of false positives. -
The Java rule
DataflowAnomalyAnalysis
(java-errorprone
) doesn’t check for UR anomalies (undefined and then referenced) anymore. These checks were all false-positives, since actual UR occurrences would lead to compile errors.
Fixed Issues
- core
- java
- #2042: [java] PMD crashes with ClassFormatError: Absent Code attribute…
- java-bestpractices
- #2025: [java] UnusedImports when @see / @link pattern includes a FQCN
- java-codestyle
- #2017: [java] UnnecessaryFullyQualifiedName triggered for inner class
- java-design
- #1912: [java] Metrics not computed correctly with annotations
- java-errorprone
- doc
- #2058: [doc] CLI reference for
-norulesetcompatibility
shows a boolean default value
- #2058: [doc] CLI reference for
API Changes
Deprecated APIs
For removal
- pmd-core
- All the package
net.sourceforge.pmd.dcd
and its subpackages. SeeDCD
. - In
LanguageRegistry
: RuleSet#getExcludePatterns
. Use the new methodgetFileExclusions
instead.RuleSet#getIncludePatterns
. Use the new methodgetFileInclusions
instead.Parser#canParse
- All the package
- pmd-java
CanSuppressWarnings
and its implementationsisSuppressed
isSupressed
ASTMethodDeclarator
getMethodName
getBlock
getParameterCount
- pmd-apex
CanSuppressWarnings
and its implementationsisSupressed
Internal APIs
- pmd-core
- All the package
net.sourceforge.pmd.util
and its subpackages, exceptnet.sourceforge.pmd.util.datasource
andnet.sourceforge.pmd.util.database
. GridBagHelper
ColumnDescriptor
- All the package
External Contributions
- #2010: [java] LawOfDemeter to support inner builder pattern - Gregor Riegler
- #2012: [java] Fixes 336, slf4j log4j2 support - Mark Hall
- #2032: [core] Allow adding SourceCode directly into CPD - Nathan Braun
- #2047: [java] Fix computation of metrics with annotations - Andi
- #2065: [java] Stop checking UR anomalies - Carlos Macasaet