PMD v6.24.0 Release Notes
Release Date: 2020-05-24 // almost 4 years ago-
24-May-2020 - 6.24.0
The PMD team is pleased to announce PMD 6.24.0.
๐ This is a minor release.
Table Of Contents
๐ New and noteworthy
๐ CPD now supports XML as well
Thanks to Fernando Cosso CPD can now find duplicates in XML files as well.
This is useful to find duplicated sections in XML files.โก๏ธ Updated PMD Designer
๐ This PMD release ships a new version of the pmd-designer.
๐ For the changes, see PMD Designer Changelog.๐ New Rules
The new Java Rule
LiteralsFirstInComparisons
(java-bestpractices
)
find String literals, that are used in comparisons and are not positioned first. Using the String literal
as the receiver of e.g.equals
helps to avoid NullPointerExceptions.This rule is replacing the two old rules
PositionLiteralsFirstInComparisons
andPositionLiteralsFirstInCaseInsensitiveComparisons
and extends the check
for the methodscompareTo
,compareToIgnoreCase
andcontentEquals
in addition toequals
and
equalsIgnoreCase
.Note: This rule also replaces the two mentioned rules in Java's quickstart ruleset.
๐ Deprecated Rules
- The two Java rules
PositionLiteralsFirstInComparisons
andPositionLiteralsFirstInCaseInsensitiveComparisons
have been deprecated
in favor of the new ruleLiteralsFirstInComparisons
.
๐ Fixed Issues
- apex-bestpractices
- #2468: [apex] Unused Local Variable fails on blocks
- core
- c#
- #2495: [c#] Support for interpolated verbatim strings
- java
- #2472: [java] JavaCharStream throws an Error on invalid escape
- java-bestpractices
- #2145: [java] Deprecate rules PositionLiteralsFirstIn(CaseInsensitive)Comparisons in favor of LiteralsFirstInComparisons
- #2288: [java] JUnitTestsShouldIncludeAssert: Add support for Hamcrest MatcherAssert.assertThat
- #2437: [java] AvoidPrintStackTrace can't detect the case e.getCause().printStackTrace()
- ๐
java-codestyle
- #2476: [java] MethodNamingConventions - Add support for JUnit 5 method naming
- java-errorprone
- #2477: [java] JUnitSpelling false-positive for JUnit5/4 tests
- swift
- #2473: [swift] Swift 5 (up to 5.2) support for CPD
API Changes
๐ Deprecated APIs
- ๐
BaseLanguageModule#addVersion(String, LanguageVersionHandler, boolean)
- ๐ Some members of
TokenMgrError
, in particular, a new constructor is available
that should be preferred to the old ones - ๐
AntlrTokenManager.ANTLRSyntaxError
Experimental APIs
Note: Experimental APIs are identified with the annotation
Experimental
,
๐ see its javadoc for details- ๐ The experimental methods in
BaseLanguageModule
have been replaced by a
definitive API.
External Contributions
- โก๏ธ #2446: [core] Update maven-compiler-plugin to 3.8.1 - Artem Krosheninnikov
- #2448: [java] Operator Wrap check - Harsh Kukreja
- #2449: [plsql] Additional info in SqlStatement, FormalParameter and FetchStatement - Grzegorz Sudolski
- #2452: [doc] Fix "Making Rulesets" doc sample code indentation - Artur Dryomov
- ๐ #2457: [xml] Adding XML to CPD supported languages - Fernando Cosso
- โฌ๏ธ #2465: [dependencies] Upgrade hamcrest, mockito and JUnit - Artem Krosheninnikov
- #2469: [apex] fix false positive unused variable if only a method is called - Gwilym Kuiper
- ๐ #2475: [swift] Swift 4.2-5.2 support - kenji21
- ๐ #2476: [java] MethodNamingConventions - Add support for JUnit 5 method naming - Bruno Ritz
- #2478: [java] New rule: LiteralsFirstInComparisons - John-Teng
- #2479: [java] False positive with Hamcrest's assertThat - andreoss
- #2481: [java] Fix JUnitSpellingRule false positive - Artem Krosheninnikov
- ๐ #2493: [java] Deprecate redundant String Comparison rules - John-Teng
- ๐ #2495: [c#] Support for interpolated verbatim strings - Maikel Steneker
Stats
- 114 commits
- 29 closed tickets & PRs
- ๐ Days since last release: 30
- The two Java rules