Changelog History
Page 2
-
v6.20.0 Changes
November 29, 201929-November-2019 - 6.20.0
The PMD team is pleased to announce PMD 6.20.0.
π This is a minor release.
Table Of Contents
π Fixed Issues
- apex
- core
- #2002: [doc] Issue with http://pmdapplied.com/ linking to a gambling Web site
- #2062: [core] Shortnames parameter does not work with Ant
- #2090: [ci] Release notes and draft releases
- #2096: [core] Referencing category errorprone.xml produces deprecation warnings for InvalidSlf4jMessageFormat
- java
- java-bestpractices
- #2016: [java] UnusedImports: False positive if wildcard is used and only static methods
- π java-codestyle
- java-design
- java-errorprone
- #2102: [java] False positive MissingStaticMethodInNonInstantiatableClass when inheritors are instantiable
External Contributions
- #2088: [java] Add more version shortcuts for older java - Henning Schmiedehausen
- #2089: [core] Minor unrelated improvements to code - Gonzalo Exequiel Ibars Ingman
- β #2091: [core] Fix pmd warnings (IdenticalCatchCases) - Gonzalo Exequiel Ibars Ingman
- #2106: [java] Wrong name for inner classes - Andi Pabst
- #2121: [java] Predicates treated like booleans - Ozan Gulle
-
v6.19.0 Changes
October 31, 201931-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
-
v6.18.0 Changes
September 15, 201915-September-2019 - 6.18.0
The PMD team is pleased to announce PMD 6.18.0.
π This is a minor release.
Table Of Contents
π New and noteworthy
π Java 13 Support
π This release of PMD brings support for Java 13. PMD can parse Switch Expressions
with the newyield
statement and resolve the type of such an expression.π PMD also parses Text Blocks as String literals.
Note: The Switch Expressions and Text Blocks are a preview language feature of OpenJDK 13
0οΈβ£ and are not enabled by default. In order to
analyze a project with PMD that uses these language features, you'll need to enable it via the environment
variablePMD_JAVA_OPTS
and select the new language version13-preview
:export PMD_JAVA_OPTS=--enable-preview ./run.sh pmd -language java -version 13-preview ...
π Note: Support for the extended break statement introduced in Java 12 as a preview language feature
π will be removed with the next PMD version 6.19.0.π Full support for Scala
π Thanks to Chris Smith PMD now fully supports Scala. Now rules for analyzing Scala
code can be developed in addition to the Copy-Paste-Detection (CPD) functionality. There are no rules yet, so
contributions are welcome.β Additionally Scala support has been upgraded from 2.12.4 to 2.13.
π New rule designer documentation
π The documentation for the rule designer is now available on the main PMD documentation page:
π Rule Designer Reference. Check it out to learn
about the usage and features of the rule designer.π New rules
The Java rule
AvoidMessageDigestField
(java-bestpractices
) detects fields
π of the typejava.security.MessageDigest
. Using a message digest instance as a field would need to be
π synchronized, as it can easily be used by multiple threads. Without synchronization the calculated hash could
π be entirely wrong. Instead of declaring this as a field and synchronize access to use it from multiple threads,
a new instance should be created when needed. This rule is also active when using java's quickstart ruleset.The Apex rule
DebugsShouldUseLoggingLevel
(apex-bestpractices
) detects
π² usages ofSystem.debug()
method calls that are used without specifying the log level. Having the log
π² level specified provides a cleaner log, and improves readability of it.Modified Rules
- The Java rule
CloseResource
(java-errorprone
) now ignores by default instances
ofjava.util.stream.Stream
. These streams areAutoCloseable
, but most streams are backed by collections,
arrays, or generating functions, which require no special resource management. However, there are some exceptions:
The stream returned byFiles::lines(Path)
is backed by a actual file and needs to be closed. These instances
0οΈβ£ won't be found by default by the rule anymore.
π Fixed Issues
- all
- #1465: [core] Stylesheet pmd-report.xslt fails to display filepath if 'java' in path
- #1923: [core] Incremental analysis does not work with shortnames
- #1983: [core] Avoid crashes with analysis cache when classpath references non-existing directories
- #1990: [core] Incremental analysis mixes XPath rule violations
- apex
- java
- #1930: [java] Add Java 13 support
- java-bestpractices
- π
java-codestyle
- #1951: [java] UnnecessaryFullyQualifiedName rule triggered when variable name clashes with package name
- java-errorprone
- plsql
- #1933: [plsql] ParseException with cursor declared in anonymous block
- #1935: [plsql] ParseException with SELECT INTO record defined as global variable
- #1936: [plslq] ParseException with cursor inside procedure declaration
- #1946: [plsql] ParseException with using TRIM inside IF statements condition
- #1947: [plsql] ParseError - SELECT with FOR UPDATE OF
- #1948: [plsql] ParseException with INSERT INTO using package global variables
- #1950: [plsql] ParseException with UPDATE and package record variable
- #1953: [plsql] ParseException with WITH in CURSOR
API Changes
π Changes to Renderer
Each renderer has now a new method
Renderer#setUseShortNames
which
is used for implementing the "shortnames" CLI option. The method is automatically called by PMD, if this
CLI option is in use. When rendering filenames to the report, the new helper method
AbstractRenderer#determineFileName
should be used. This will change
the filename to a short name, if the CLI option "shortnames" is used.Not adjusting custom renderers will make them render always the full file names and not honoring the
CLI option "shortnames".π Deprecated APIs
For removal
- The methods
getImportedNameNode
and
π¦getPackage
have been deprecated and
π will be removed with PMD 7.0.0. - π The method
RuleContext#setSourceCodeFilename
has been deprecated
π and will be removed. The already existing methodRuleContext#setSourceCodeFile
should be used instead. The methodRuleContext#getSourceCodeFilename
still
exists and returns just the filename without the full path. - The method
AbstractPMDProcessor#filenameFrom
has been
π deprecated. It was used to determine a "short name" of the file being analyzed, so that the report
π can use short names. However, this logic has been moved to the renderers. - The method
Report#metrics
andReport
have
π been deprecated. They were leftovers from a previous deprecation round targeting
StatisticalRule
.
Internal APIs
π 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.- pmd-core
- pmd-java
net.sourceforge.pmd.lang.java.typeresolution
: Everything, including
π¦ subpackages, exceptTypeHelper
and
JavaTypeDefinition
.ASTCompilationUnit#getClassTypeResolver
External Contributions
- π² #1943: [apex] Adds "debug should use logging level" best practice rule for Apex - Renato Oliveira
- π #1965: [scala] Use Scalameta for parsing - Chris Smith
- #1970: [java] DoubleBraceInitialization: Fix example - Tobias Weimer
- #1971: [java] 1862 - Message Digest should not be used as class field - AnthonyKot
- β‘οΈ #1972: [plsql] ParseError - SELECT with FOR UPDATE OF - Piotr Szymanski
- π #1974: [plsql] Fixes for referencing record type variables - Piotr Szymanski
- #1975: [plsql] TRIM function with record type variables - Piotr Szymanski
- #1976: [plsql] Fix for mistaking / for MultiplicativeExpression - Piotr Szymanski
- #1977: [plsql] fix for skipping sql starting with WITH - Piotr Szymanski
- #1986: [plsql] Fix for cursors in anonymous blocks - Piotr Szymanski
- #1994: [core] Resolve pmd-report failure when java folder in filepath - Amish Shah
- β‘οΈ #2015: [java] Update doc for unused formal parameter - Amish Shah
- The Java rule
-
v6.17.0 Changes
July 28, 201928-July-2019 - 6.17.0
The PMD team is pleased to announce PMD 6.17.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.
β It contains a new feature to edit test cases directly within the designer. Any feedback is highly appreciated.π Lua support
π Thanks to the contribution from Maikel Steneker, and built on top of the ongoing efforts to fully support Antlr-based languages,
π PMD now has CPD support for Lua.Being based on a proper Antlr grammar, CPD can:
- ignore comments
- π honor comment-based suppressions
Modified Rules
The Java rule
CloseResource
(java-errorprone
) ignores now by default
java.io.ByteArrayInputStream
andjava.io.CharArrayWriter
. Such streams/writers do not need to be closed.The Java rule
MissingStaticMethodInNonInstantiatableClass
(java-errorprone
) has now
the new propertyannotations
.
When one of the private constructors is annotated with one of the annotations, then the class is not considered
0οΈβ£ non-instantiatable anymore and no violation will be reported. By default, Spring's@Autowired
and
Java EE's@Inject
annotations are recognized.π Fixed Issues
- core
- #1913: [core] "-help" CLI option ends with status code != 0
- doc
- #1896: [doc] Error in changelog 6.16.0 due to not properly closed rule tag
- #1898: [doc] Incorrect code example for DoubleBraceInitialization in documentation on website
- #1906: [doc] Broken link for adding own CPD languages
- #1909: [doc] Sample usage example refers to deprecated ruleset "basic.xml" instead of "quickstart.xml"
- java
- #1910: [java] ATFD calculation problem
- java-errorprone
- java-multithreading
- #1903: [java] UnsynchronizedStaticFormatter doesn't allow block-level synchronization when using allowMethodLevelSynchronization=true
- plsql
- #1902: [pslql] ParseException when parsing (+)
- xml
- #1666: [xml] wrong cdata rule description and examples
External Contributions
- #1869: [xml] fix #1666 wrong cdata rule description and examples - Artem
- π #1892: [lua] [cpd] Added CPD support for Lua - Maikel Steneker
- #1905: [java] DataflowAnomalyAnalysis Rule in right order - YoonhoChoi96
- β‘οΈ #1908: [doc] Update ruleset filename from deprecated basic.xml to quickstart.xml - crunsk
- #1916: [java] Exclude Autowired and Inject for MissingStaticMethodInNonInstantiatableClass - AnthonyKot
- #1917: [core] Add 'no error' return option, and assign it to the cli when the help command is invoked - Renato Oliveira
-
v6.16.0 Changes
June 30, 201930-June-2019 - 6.16.0
The PMD team is pleased to announce PMD 6.16.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.β‘οΈ PLSQL Grammar Updates
β‘οΈ The grammar has been updated to support inline constraints in CREATE TABLE statements. Additionally, the
CREATE TABLE statement may now be followed by physical properties and table properties. However, these
π properties are skipped over during parsing.π The CREATE VIEW statement now supports subquery views.
π The EXTRACT function can now be parsed correctly. It is used to extract values from a specified
π datetime field. Also date time literals are parsed now correctly.The CASE expression can now be properly used within SELECT statements.
π Table aliases are now supported when specifying columns in INSERT INTO clauses.
π New Rules
The Java rule
DoubleBraceInitialization
(java-bestpractices
)
detects non static initializers in anonymous classes also known as "double brace initialization".
This can be problematic, since a new class file is generated and object holds a strong reference
to the surrounding class.Note: This rule is also part of the Java quickstart ruleset (
rulesets/java/quickstart.xml
).Modified Rules
The Java rule
UnusedPrivateField
(java-bestpractices
) now ignores by
0οΈβ£ default fields, that are annotated with the Lombok experimental annotation@Delegate
. This can be
customized with the propertyignoredAnnotations
.The Java rule
SingularField
(java-design
) now ignores by
0οΈβ£ default fields, that are annotated with the Lombok experimental annotation@Delegate
. This can be
customized with the propertyignoredAnnotations
.The Java rules
UnsynchronizedStaticFormatter
and
UnsynchronizedStaticDateFormatter
(java-multithreading
)
π now prefer synchronized blocks by default. They will raise a violation, if the synchronization is implemented
on the method level. To allow the old behavior, the new propertyallowMethodLevelSynchronization
can
be enabled.The Java rule
UseUtilityClass
(java-design
) has a new propertyignoredAnnotations
.
0οΈβ£ By default, classes that are annotated with Lombok's@UtilityClass
are ignored now.The Java rule
NonStaticInitializer
(java-errorprone
) does not report
non static initializers in anonymous classes anymore. For this use case, there is a new rule now:
DoubleBraceInitialization
(java-bestpractices
).The Java rule
CommentDefaultAccessModifier
(java-codestyle
) was enhanced
0οΈβ£ in the last version 6.15.0 to check also top-level types by default. This created many new violations.
π Missing the access modifier for top-level types is not so critical, since it only decreases the visibility
of the type.βͺ The default behaviour has been restored. If you want to enable the check for top-level types, you can
π use the new propertycheckTopLevelTypes
.The Java rule
CloseResource
(java-errorprone
) now by default searches
for any unclosedjava.lang.AutoCloseable
resource. This includes now the standardjava.io.*Stream
classes.
π§ Previously only SQL-related resources were considered by this rule. The types can still be configured
via thetypes
property. Some resources do not need to be closed (e.g.ByteArrayOutputStream
). These
π§ exceptions can be configured via the new propertyallowedResourceTypes
.
βͺ In order to restore the old behaviour, just remove the typejava.lang.AutoCloseable
from thetypes
property and keep the remaining SQL-related classes.π Deprecated Rules
- The Java rule
AvoidFinalLocalVariable
(java-codestyle
) has been deprecated
π and will be removed with PMD 7.0.0. The rule is controversial and also contradicts other existing
rules such asLocalVariableCouldBeFinal
. If the goal is to avoid defining
constants in a scope smaller than the class, then the ruleAvoidDuplicateLiterals
should be used instead.
π Fixed Issues
- apex
- #1664: [apex] False positive ApexSharingViolationsRule, unsupported Apex feature
- java
- #1848: [java] Local classes should preserve their modifiers
- java-bestpractices
- π java-codestyle
- java-design
- #1094: [java] UseUtilityClass should be LombokAware
- java-errorprone
- java-multithreading
- plsql
API Changes
π Deprecated APIs
π > Reminder: Please don't use members marked with the annotation
InternalApi
, as they will likely be removed, hidden, or otherwise intentionally broken with 7.0.0.In ASTs
As part of the changes we'd like to do to AST classes for 7.0.0, we would like to
hide some methods and constructors that rule writers should not have access to.
The following usages are now deprecated in the Java AST (with other languages to come):- π Manual instantiation of nodes. Constructors of node classes are deprecated and marked
InternalApi
. Nodes should only be obtained from the parser, which for rules, means that never need to instantiate node themselves. Those constructors will be made package private with 7.0.0. - Subclassing of abstract node classes, or usage of their type. Version 7.0.0 will bring a new set of abstractions that will be public API, but the base classes are and will stay internal. You should not couple your code to them.
- Setters found in any node class or interface. Rules should consider the AST immutable. We will make those setters package private with 7.0.0.
π¦ Please look at
net.sourceforge.pmd.lang.java.ast
to find out the full list
π of deprecations.External Contributions
- #1482: [java] Explain the existence of AvoidFinalLocalVariable in it's description - Karl-Philipp Richter
- #1792: [java] Added lombok.experimental to AbstractLombokAwareRule - jakivey32
- #1808: [plsql] Fix PL/SQL Syntax errors - Hugo Araya Nash
- #1829: [java] Fix false negative in UnsynchronizedStaticFormatter - Srinivasan Venkatachalam
- #1847: [java] Regression in MethodReturnsInternalArray not handling enums - Artem
- #1863: [plsql] Add Table InlineConstraint - Hugo Araya Nash
- π #1864: [plsql] Add support for Subquery Views - Hugo Araya Nash
- π #1865: [plsql] Add Support for Extract Expression - Hugo Araya Nash
- β‘οΈ #1874: [plsql] Add parenthesis equation support for Update - Hugo Araya Nash
- π #1876: [plsql] Datetime support for queries - Hugo Araya Nash
- #1883: [plsql] Fix #1873 Expression list not working - Hugo Araya Nash
- π #1884: [plsql] fix #1878 Support explicit INNER word for INNER JOIN - Hugo Araya Nash
- #1885: [plsql] Correct case expression - Hugo Araya Nash
- π #1886: [plsql] Support table alias for Insert Clause - Hugo Araya Nash
- The Java rule
-
v6.15.0 Changes
May 26, 201926-May-2019 - 6.15.0
The PMD team is pleased to announce PMD 6.15.0.
π This is a minor release.
Table Of Contents
π New and noteworthy
β¨ Enhanced Matlab support
Thanks to the contributions from Maikel Steneker CPD for Matlab can
π now parse Matlab programs which use the question mark operator to specify access to
class members:classdef Class1 properties (SetAccess = ?Class2)
π CPD also understands now double quoted strings, which are supported since version R2017a of Matlab:
str = "This is a string"
β¨ Enhanced C++ support
π CPD now supports digit separators in C++ (language module "cpp"). This is a C++14 feature.
Example:
auto integer_literal = 1'000'000;
The single quotes can be used to add some structure to large numbers.
π CPD also parses raw string literals now correctly (see #1784).
π New Rules
The new Apex rule
FieldNamingConventions
(apex-codestyle
) checks the naming
0οΈβ£ conventions for field declarations. By default this rule uses the standard Apex naming convention (Camel case),
π§ but it can be configured through properties.The new Apex rule
FormalParameterNamingConventions
(apex-codestyle
) checks the
0οΈβ£ naming conventions for formal parameters of methods. By default this rule uses the standard Apex naming
π§ convention (Camel case), but it can be configured through properties.The new Apex rule
LocalVariableNamingConventions
(apex-codestyle
) checks the
0οΈβ£ naming conventions for local variable declarations. By default this rule uses the standard Apex naming
π§ convention (Camel case), but it can be configured through properties.The new Apex rule
PropertyNamingConventions
(apex-codestyle
) checks the naming
0οΈβ£ conventions for property declarations. By default this rule uses the standard Apex naming convention (Camel case),
π§ but it can be configured through properties.The new Java rule
UseShortArrayInitializer
(java-codestyle
) searches for
array initialization expressions, which can be written shorter.Modified Rules
The Apex rule
ClassNamingConventions
(apex-codestyle
) can now be configured
using various properties for the specific kind of type declarations (e.g. class, interface, enum).
0οΈβ£ As before, this rule uses by default the standard Apex naming convention (Pascal case).The Apex rule
MethodNamingConventions
(apex-codestyle
) can now be configured
β using various properties to differenciate e.g. static methods and test methods.
0οΈβ£ As before, this rule uses by default the standard Apex naming convention (Camel case).The Java rule
FieldNamingConventions
(java-codestyle
) now by default ignores
the fieldserialPersistentFields
. Since this is a field which needs to have this special name, no
field naming conventions can be applied here. It is excluded the same way likeserialVersionUID
via the
propertyexclusions
.The Java rule
CommentRequired
(java-documentation
) has a new property
0οΈβ£serialPersistentFieldsCommentRequired
with the default value "Ignored". This means that from now
on comments for the fieldserialPersistentFields
are not required anymore. You can change the property
βͺ to restore the old behavior.The Java rule
ProperLogger
(java-errorprone
) has two new properties
π§ to configure the logger class (e.g. "org.slf4j.Logger") and the logger name of the special case,
π§ when the logger is not static. The name of the static logger variable was already configurable.
π² The new property "loggerClass" allows to use this rule for different logging frameworks.
This rule covers all the cases of the now deprecated ruleLoggerIsNotStaticFinal
.The Java rule
CommentDefaultAccessModifier
(java-codestyle
) now reports also
π¦ missing comments for top-level classes and annotations, that are package-private.π Deprecated Rules
The Apex rule
VariableNamingConventions
(apex-codestyle
) has been deprecated and
π will be removed with PMD 7.0.0. The rule is replaced by the more general rules
FieldNamingConventions
,
FormalParameterNamingConventions
,
LocalVariableNamingConventions
, and
PropertyNamingConventions
.The Java rule
LoggerIsNotStaticFinal
(java-errorprone
) has been deprecated
and will be removed with PMD 7.0.0. The rule is replaced byProperLogger
.π Fixed Issues
- apex
- cpp
- #1784: [cpp] Improve support for raw string literals
- dart
- #1809: [dart] [cpd] Parse error with escape sequences
- java
- #1842: [java] Annotated module declarations cause parse error
- java-bestpractices
- #1738: [java] MethodReturnsInternalArray does not work in inner classes
- π java-codestyle
- python
- #1810: [python] [cpd] Parse error when using Python 2 backticks
- matlab
API Changes
π Deprecated APIs
For removal
- The
DumpFacades
in all languages, that could be used to transform a AST into a textual representation,
π will be removed with PMD 7. The rule designer is a better way to inspect nodes.net.sourceforge.pmd.lang.apex.ast.DumpFacade
net.sourceforge.pmd.lang.java.ast.DumpFacade
net.sourceforge.pmd.lang.ecmascript.ast.DumpFacade
net.sourceforge.pmd.lang.jsp.ast.DumpFacade
net.sourceforge.pmd.lang.plsql.ast.DumpFacade
net.sourceforge.pmd.lang.vf.ast.DumpFacade
net.sourceforge.pmd.lang.vm.ast.AbstractVmNode#dump
net.sourceforge.pmd.lang.xml.ast.DumpFacade
- The method
LanguageVersionHandler#getDumpFacade
will be
β removed as well. It is deprecated, along with all its implementations in the subclasses ofLanguageVersionHandler
.
External Contributions
- #1647: [java] Rule to detect overly verbose array initialization - Victor
- π§ #1762: [java] LoggerIsNotStaticFinal and ProperLogger - make class-name configurable - Ivo Ε mΓd
- 0οΈβ£ #1798: [java] Make CommentDefaultAccessModifier work for top-level classes - Boris Petrov
- π #1799: [java] MethodReturnsInternalArray does not work in inner classes - Fixed #1738 - Srinivasan Venkatachalam
- π #1802: [python] [cpd] Add support for Python 2 backticks - Maikel Steneker
- #1803: [dart] [cpd] Dart escape sequences - Maikel Steneker
- β #1807: [ci] Fix missing local branch issues when executing pmd-regression-tester - BBG
- #1813: [matlab] [cpd] Matlab comments - Maikel Steneker
- #1816: [apex] Fix ApexDoc handling with inner classes - Jeff Hube
- π§ #1817: [apex] Add configurable naming convention rules - Jeff Hube
- π #1819: [cpp] [cpd] Add support for digit separators - Maikel Steneker
- π #1820: [cpp] [cpd] Improve support for raw string literals - Maikel Steneker
- #1821: [matlab] [cpd] Matlab question mark token - Maikel Steneker
- #1822: [matlab] [cpd] Double quoted string - Maikel Steneker
- π #1837: [core] Minor performance improvements - Michael Hausegger
- #1838: [dart] [cpd] Improved string tokenization - Maikel Steneker
- #1840: [java] Whitelist serialPersistentFields - Marcel HΓ€rle
-
v6.14.0 Changes
April 28, 201928-April-2019 - 6.14.0
The PMD team is pleased to announce PMD 6.14.0.
π This is a minor release.
Table Of Contents
π New and noteworthy
π Dart support
π Thanks to the contribution from Maikel Steneker, and built on top of the ongoing efforts to fully support Antlr-based languages,
π PMD now has CPD support for Dart.Being based on a proper Antlr grammar, CPD can:
- ignore comments
- ignore imports / libraries
- π honor comment-based suppressions
β‘οΈ Updated PMD Designer
π This PMD release ships a new version of the pmd-designer.
π For the changes, see PMD Designer Changelog.Modified Rules
The Java rule
AssignmentToNonFinalStatic
(java-errorprone
) will now report on each
assignment made within a constructor rather than on the field declaration. This makes it easier for developers to
find the offending statements.The Java rule
NoPackage
(java-codestyle
) will now report additionally enums
π¦ and annotations that do not have a package declaration.π Fixed Issues
- all
- go
- #1751: [go] Parsing errors encountered with escaped backslash
- java
- java-bestpractices
- π java-codestyle
- java-design
- #1760: [java] UseObjectForClearerAPI flags private methods
API Changes
No changes.
External Contributions
- π #1745: [doc] Fixed some errors in docs - 0xflotus
- β‘οΈ #1746: [java] Update rule to prevent UnusedImport when using JavaDoc with array type - itaigilo
- #1752: [java] UseObjectForClearerAPI Only For Public - BjΓΆrn Kautler
- π #1761: [dart] [cpd] Added CPD support for Dart - Maikel Steneker
- #1776: [java] Show more detailed message when can't resolve field type - Andrey Fomin
- #1781: [java] Location change in AssignmentToNonFinalStatic - Maikel Steneker
- #1789: [cpd] [core] Use current classloader instead of Thread's classloader - Andreas Schmid
- #1791: [dart] [cpd] Dart escaped string - Maikel Steneker