PMD v6.29.0 Release Notes
Release Date: 2020-10-24 // over 3 years ago-
24-October-2020 - 6.29.0
The PMD team is pleased to announce PMD 6.29.0.
🚀 This is a minor release.
Table Of Contents
🆕 New and noteworthy
⚡️ Updated Apex Support
- 👍 The Apex language support has been bumped to version 50 (Winter '21). All new language features are now properly
parsed and processed. Especially the Safe Navigation Operator is now supported.
🚀 See also Salesforce Winter '21 Release Notes
🆕 New Rules
- The new Apex rule
OperationWithLimitsInLoop
(apex-performance
)
finds operations in loops that may hit governor limits such as DML operations, SOQL
queries and more. The rule replaces the three rules "AvoidDmlStatementsInLoops", "AvoidSoqlInLoops",
and "AvoidSoslInLoops".
📇 Renamed Rules
- The Java rule
DoNotCallSystemExit
has been renamed to
DoNotTerminateVM
, since it checks for all the following calls:
System.exit(int)
,Runtime.exit(int)
,Runtime.halt(int)
. All these calls terminate
the Java VM, which is bad, if the VM runs an application server which many independent applications.
🗄 Deprecated Rules
- The Apex rules
AvoidDmlStatementsInLoops
,
AvoidSoqlInLoops
andAvoidSoslInLoops
🐎 (apex-performance
) are deprecated in favour of the new rule
OperationWithLimitsInLoop
. The deprecated rules will be removed
with PMD 7.0.0.
🛠 Fixed Issues
- apex
- #2839: [apex] Apex classes with safe navigation operator from Winter 21 (50.0) are skipped
- 🐎 apex-performance
- #1713: [apex] Mark Database DML statements in For Loop
- core
- #2831: [core] Fix XMLRenderer newlines when running under IBM Java
- java-errorprone
- miscellaneous
- #2823: [doc] Renamed/Moved rules are missing in documentation
- vf (Salesforce VisualForce)
- #2765: [vf] Attributes with dot cause a VfParseException
External Contributions
- 🛠 #2803: [java] Improve DoNotCallSystemExit (Fixes #2157) - Vitaly Polonetsky
- 🚚 #2809: [java] Move test config from file to test class - Stefan Birkner
- 🚚 #2810: [core] Move method "renderTempFile" to XMLRendererTest - Stefan Birkner
- #2811: [java] CloseResource - Fix #2764: False-negative when re-assigning variable - Andi Pabst
- #2813: [core] Use JUnit's TemporaryFolder rule - Stefan Birkner
- #2816: [apex] Detect 'Database' method invocations inside loops - Jeff Bartolotta
- #2829: [doc] Small correction in pmd_report_formats.md - Gustavo Krieger
- #2834: [vf] Allow attributes with dot in Visualforce - rmohan20
- #2842: [core] Bump antlr4 from 4.7 to 4.7.2 - Adrien Lecharpentier
- ⚡️ #2865: [java] (doc) Update ExcessiveImports example code for clarity - Gustavo Krieger
- #2866: [java] (doc) Fix example for CouplingBetweenObjects - Gustavo Krieger
Stats
- 50 commits
- 23 closed tickets & PRs
- 🚀 Days since last release: 27
- 👍 The Apex language support has been bumped to version 50 (Winter '21). All new language features are now properly
Previous changes from v6.28.0
-
26-September-2020 - 6.28.0
The PMD team is pleased to announce PMD 6.28.0.
🚀 This is a minor release.
Table Of Contents
🆕 New and noteworthy
CPD's AnyTokenizer has been improved
The AnyTokenizer is used for languages, that don't have an own lexer/grammar based tokenizer.
💎 AnyTokenizer now handles string literals and end-of-line comments. Fortran, Perl and Ruby have
⚡️ been updated to use AnyTokenizer instead of their old custom tokenizer based on AbstractTokenizer.
👀 See #2758 for details.🗄 AbstractTokenizer and the custom tokenizers of Fortran, Perl and Ruby are deprecated now.
🛠 Fixed Issues
cpd
- #2758: [cpd] Improve AnyTokenizer
- #2760: [cpd] AnyTokenizer doesn't count columns correctly
🔒 apex-security
- #2774: [apex] ApexSharingViolations does not correlate sharing settings with class that contains data access
java
- #2738: [java] Custom rule with @ExhaustiveEnumSwitch throws NPE
- #2755: [java] [6.27.0] Exception applying rule CloseResource on file ... java.lang.NullPointerException
- #2756: [java] TypeTestUtil fails with NPE for anonymous class
- #2767: [java] IndexOutOfBoundsException when parsing an initializer BlockStatement
- #2783: [java] Error while parsing with lambda of custom interface
java-bestpractices
- #2759: [java] False positive in UnusedAssignment
java-design
- #2708: [java] False positive FinalFieldCouldBeStatic when using lombok Builder.Default
API Changes
🗄 Deprecated API
For removal
- 0️⃣
net.sourceforge.pmd.RuleViolationComparator
. UseRuleViolation#DEFAULT_COMPARATOR
instead. - 📄
net.sourceforge.pmd.cpd.AbstractTokenizer
. Usenet.sourceforge.pmd.cpd.AnyTokenizer
instead. - 📄
net.sourceforge.pmd.cpd.FortranTokenizer
. Was replaced by anAnyTokenizer
. UseFortranLanguage#getTokenizer
anyway. - 📄
net.sourceforge.pmd.cpd.PerlTokenizer
. Was replaced by anAnyTokenizer
. UsePerlLanguage#getTokenizer
anyway. - 💎
net.sourceforge.pmd.cpd.RubyTokenizer
. Was replaced by anAnyTokenizer
. UseRubyLanguage#getTokenizer
anyway. - 📄
RuleReference#getOverriddenLanguage
and
📄RuleReference#setLanguage
- Antlr4 generated lexers:
net.sourceforge.pmd.lang.cs.antlr4.CSharpLexer
will be moved to packagenet.sourceforge.pmd.lang.cs.ast
with PMD 7.net.sourceforge.pmd.lang.dart.antlr4.Dart2Lexer
will be renamed toDartLexer
and moved to package
📦net.sourceforge.pmd.lang.dart.ast
with PMD 7. All other classes in the old package will be removed.net.sourceforge.pmd.lang.go.antlr4.GolangLexer
will be moved to package
📦net.sourceforge.pmd.lang.go.ast
with PMD 7. All other classes in the old package will be removed.net.sourceforge.pmd.lang.kotlin.antlr4.Kotlin
will be renamed toKotlinLexer
and moved to package
net.sourceforge.pmd.lang.kotlin.ast
with PMD 7.net.sourceforge.pmd.lang.lua.antlr4.LuaLexer
will be moved to package
📦net.sourceforge.pmd.lang.lua.ast
with PMD 7. All other classes in the old package will be removed.
External Contributions
- #2735: [ci] Add github actions for a fast view of pr succeed/not - XenoAmess
- 🏗 #2747: [java] Don't trigger FinalFieldCouldBeStatic when field is annotated with lombok @Builder.Default - Ollie Abbey
- 0️⃣ #2773: [java] issue-2738: Adding null check to avoid npe when switch case is default - Nimit Patel
- 🏗 #2789: Add badge for reproducible build - Dan Rollo
- #2791: [apex] Analyze inner classes for sharing violations - Jeff Bartolotta
Stats
- 58 commits
- 24 closed tickets & PRs
- 🚀 Days since last release: 25