24-April-2021 - 6.34.0
The PMD team is pleased to announce PMD 6.34.0.
This is a minor release.
New and noteworthy
New rules
-
The new Java rule
UseStandardCharsets
finds usages ofCharset.forName
, whereStandardCharsets
can be used instead.This rule is also part of the Quickstart Ruleset (
rulesets/java/quickstart.xml
) for Java. -
The new Java rule
UnnecessaryImport
replaces the rulesUnusedImports
,DuplicateImports
,ImportFromSamePackage
, andDontImportJavaLang
.This rule is also part of the Quickstart Ruleset (
rulesets/java/quickstart.xml
) for Java.
Modified rules
- The Apex rule
ApexCRUDViolation
does not ignore getters anymore and also flags SOQL/SOSL/DML operations without access permission checks in getters. This will produce false positives now for VF getter methods, but we can’t reliably detect, whether a getter is a VF getter or not. In such cases, the violation should be suppressed.
Deprecated rules
- java-bestpractices
UnusedImports
: use the ruleUnnecessaryImport
instead
- java-codestyle
DuplicateImports
: use the ruleUnnecessaryImport
insteadDontImportJavaLang
: use the ruleUnnecessaryImport
instead
- java-errorprone
ImportFromSamePackage
: use the ruleUnnecessaryImport
instead
Fixed Issues
- apex-performance
- #3198: [apex] OperationWithLimitsInLoopRule: Support more limit consuming static method invocations
- apex-security
- java-bestpractices
- java-codestyle
- #3128: [java] New rule UnnecessaryImport, deprecate DuplicateImports, ImportFromSamePackage, UnusedImports
- java-errorprone
API Changes
No changes.
External Contributions
- #3193: [java] New rule: UseStandardCharsets - Andrea Aime
- #3198: [apex] OperationWithLimitsInLoopRule: Support more limit consuming static method invocations - Jonathan Wiesel
- #3211: [apex] ApexCRUDViolationRule: Do not assume method is VF getter to avoid CRUD checks - Jonathan Wiesel
- #3234: [apex] ApexCRUDViolation: COUNT is indeed CRUD checkable since it exposes data (false-negative) - Jonathan Wiesel
Stats
- 74 commits
- 18 closed tickets & PRs
- Days since last release: 27