PMD v6.19.0 Release Notes
Release Date: 2019-10-31 // over 4 years ago-
31-October-2019 - 6.19.0
The PMD team is pleased to announce PMD 6.19.0.
๐ This is a minor release.
Table Of Contents
๐ New and noteworthy
โก๏ธ Updated PMD Designer
๐ This PMD release ships a new version of the pmd-designer.
๐ For the changes, see PMD Designer Changelog.Java Metrics
- ๐ The new metric "Class Fan Out Complexity" has been added. See
๐ Java Metrics Documentation for details.
Modified Rules
The Java rules
InvalidLogMessageFormat
andMoreThanOneLogger
๐ฒ (java-errorprone
) now both support Log4j2. Note that the
rule "InvalidSlf4jMessageFormat" has been renamed to "InvalidLogMessageFormat" to reflect the fact, that it now
๐ supports more than slf4j.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.The java rule
DoNotUseThreads
(java-multithreading
) has been changed
to not report usages ofjava.lang.Runnable
anymore. Just usingRunnable
does not automatically create
๐ a new thread. While the check forRunnable
has been removed, the rule now additionally checks for
usages ofExecutors
andExecutorService
. Both create new threads, which are not managed by a J2EE
server.๐ Renamed Rules
- The Java rule
InvalidSlf4jMessageFormat
has been renamed to
InvalidLogMessageFormat
since it supports now both slf4j and log4j2
message formats.
๐ Fixed Issues
- core
- #1978: [core] PMD fails on excluding unknown rules
- #2014: [core] Making add(SourceCode sourceCode) public for alternative file systems
- #2020: [core] Wrong deprecation warnings for unused XPath attributes
- #2036: [core] Wrong include/exclude patterns are silently ignored
- #2048: [core] Enable type resolution by default for XPath rules
- #2067: [core] Build issue on Windows
- #2068: [core] Rule loader should use the same resources loader for the ruleset
- #2071: [ci] Add travis build on windows
- #2072: [test][core] Not enough info in "test setup error" when numbers of lines do not match
- #2082: [core] Incorrect logging of deprecated/renamed rules
- java
- #2042: [java] PMD crashes with ClassFormatError: Absent Code attribute...
- java-bestpractices
- ๐
java-codestyle
- #2017: [java] UnnecessaryFullyQualifiedName triggered for inner class
- java-design
- #1912: [java] Metrics not computed correctly with annotations
- java-errorprone
- java-multithreading
- #1627: [java] DoNotUseThreads should not warn on Runnable
- 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
: commaSeparatedTerseNamesForLanguageVersion
commaSeparatedTerseNamesForLanguage
findAllVersions
findLanguageVersionByTerseName
getInstance
RuleSet#getExcludePatterns
. Use the new methodgetFileExclusions
instead.RuleSet#getIncludePatterns
. Use the new methodgetFileInclusions
instead.Parser#canParse
Parser#getSuppressMap
RuleBuilder#RuleBuilder
. Use the new constructor with the correct ResourceLoader instead.RuleFactory#RuleFactory
. Use the new constructor with the correct ResourceLoader instead.
- All the package
- pmd-java
CanSuppressWarnings
and its implementationsisSuppressed
getDeclaringType
.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 Pabst
- #2065: [java] Stop checking UR anomalies - Carlos Macasaet
- #2068: [core] Rule loader should use the same resources loader for the ruleset - Chen Yang
- ๐ #2070: [core] Fix renderer tests for windows builds - Saladoc
- โ #2073: [test][core] Add expected and actual line of numbers to message wording - snuyanzin
- #2076: [java] Add Metric ClassFanOutComplexity - Andi Pabst
- #2078: [java] DoNotUseThreads should not warn on Runnable #1627 - Michael Clay
- ๐ The new metric "Class Fan Out Complexity" has been added. See