Table of Contents
29-November-2024 - 7.8.0
The PMD team is pleased to announce PMD 7.8.0.
This is a minor release.
🚀 New and noteworthy
🌟 New and changed rules
New Rules
- The new Apex rule
QueueableWithoutFinalizer
detects when the Queueable interface is used but a Finalizer is not attached. Without attaching a Finalizer, there is no way of designing error recovery actions should the Queueable action fail.
🐛 Fixed Issues
- ant
- #1860: [ant] Reflective access warnings on java > 9 and java < 17
- apex
- html
- #5322: [html] CPD throws exception on when HTML file is missing closing tag
- java
- #5283: [java] AssertionError “this should be unreachable” with scala library
- #5293: [java] Deadlock when executing PMD in multiple threads
- #5324: [java] Issue with type inference of nested lambdas
- #5329: [java] Type inference issue with unknown method ref in call chain
- #5338: [java] Unresolved target type for lambdas make overload resolution fail
- java-bestpractices
- #4113: [java] JUnitTestsShouldIncludeAssert - false positive with SoftAssertionsExtension
- #5083: [java] UnusedPrivateMethod false positive when method reference has no target type
- #5097: [java] UnusedPrivateMethod FP with raw type missing from the classpath
- #5318: [java] PreserveStackTraceRule: false-positive on Pattern Matching with instanceof
- java-codestyle
- java-design
- #4763: [java] SimplifyBooleanReturns - wrong suggested solution
- java-errorprone
- #5070: [java] ConfusingArgumentToVarargsMethod FP when types are unresolved
- java-performance
🚨 API Changes
Deprecations
- pmd-coco
CocoBaseListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.CocoBaseVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.CocoListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.CocoParser
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.CocoVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.
- pmd-gherkin
GherkinBaseListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.GherkinBaseVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.GherkinListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.GherkinParser
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.GherkinVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.
- pmd-julia
JuliaBaseListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.JuliaBaseVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.JuliaListener
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.JuliaParser
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.JuliaVisitor
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.
- pmd-kotlin
UnicodeClasses
is deprecated for removal. This class was never intended to be generated. It will be removed with no replacement.
- pmd-xml
XMLLexer
is deprecated for removal. Usenet.sourceforge.pmd.lang.xml.ast.XMLLexer
instead (note different packageast
instead ofantlr4
).
✨ Merged pull requests
- #5240: Release notes improvements - Andreas Dangel (@adangel)
- #5284: [apex] Use case-insensitive input stream to avoid choking on Unicode escape sequences - Willem A. Hajenius (@wahajenius)
- #5286: [ant] Formatter: avoid reflective access to determine console encoding - Andreas Dangel (@adangel)
- #5289: [java] TooFewBranchesForSwitch - allow list of case constants - Andreas Dangel (@adangel)
- #5296: [xml] Have pmd-xml Lexer in line with other antlr grammars - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5300: Add rule test cases for issues fixed with PMD 7.0.0 - Andreas Dangel (@adangel)
- #5303: [apex] New Rule: Queueable Should Attach Finalizer - Mitch Spano (@mitchspano)
- #5309: [java] Fix #5293: Parse number of type parameters eagerly - Andreas Dangel (@adangel)
- #5310: [java] Fix #5283 - inner class has public private modifiers - Clément Fournier (@oowekyala)
- #5325: [java] Fix inference dependency issue with nested lambdas - Clément Fournier (@oowekyala)
- #5326: [java] UseStringBufferLength - consider sb.toString().equals(“”) - Andreas Dangel (@adangel)
- #5328: [html] Test for a closing tag when determining node positions - Andreas Dangel (@adangel)
- #5330: [java] Propagate unknown type better when mref is unresolved - Clément Fournier (@oowekyala)
- #5331: [java] PreserveStackTrace - consider instance type patterns - Andreas Dangel (@adangel)
- #5332: [java] InsufficientStringBufferDeclaration: Fix CCE for Character - Andreas Dangel (@adangel)
- #5334: [java] UnitTestShouldIncludeAssert - consider SoftAssertionsExtension - Andreas Dangel (@adangel)
- #5335: [kotlin] Prevent auxiliary grammars from generating lexers - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5336: [gherkin] Remove generated gherkin code from coverage report - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5337: [doc] Introducing PMD Guru on Gurubase.io - Kursat Aktas (@kursataktas)
- #5339: [java] Allow lambdas with unresolved target types to succeed inference - Clément Fournier (@oowekyala)
- #5340: [java] Fix #5097 - problem with unchecked conversion - Clément Fournier (@oowekyala)
- #5341: [java] Fix #5083 - UnusedPrivateMethod false positive with mref without target type but with exact method - Clément Fournier (@oowekyala)
- #5342: [julia] Ignore generated code in Julia module - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5345: [coco] Remove generated coco files form coverage - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5346: [typescript] Add cleanup after generating ts lexer - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5347: [tsql] Flag generated lexer as generated - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5352: [java] Add permitted subtypes to symbol API - Clément Fournier (@oowekyala)
- #5353: [java] Fix #5263 - UnnecessaryFullyQualifiedName FP with forward references - Clément Fournier (@oowekyala)
- #5354: [apex] Updated the docs for UnusedMethod as per discussion #5200 - samc-gearset (@sam-gearset)
- #5370: [java] Fix #5214 - LambdaCanBeMethodReference issue with method of enclosing class - Clément Fournier (@oowekyala)
- #5371: [doc] Improve docs on adding Antlr languages - Juan Martín Sotuyo Dodero (@jsotuyod)
- #5372: [java] Fix #5315 - UnusedImport FP with import on demand - Clément Fournier (@oowekyala)
- #5373: [java] Fix #4763 - wrong message for SimplifyBooleanReturns - Clément Fournier (@oowekyala)
- #5374: [java] Fix #5070 - confusing argument to varargs method FP when types are unknown - Clément Fournier (@oowekyala)
📦 Dependency updates
- #5285: Bump pmd from 7.5.0 to 7.7.0
- #5288: Bump asm from 9.7 to 9.7.1
- #5290: Bump org.apache.maven.plugins:maven-assembly-plugin from 3.6.0 to 3.7.1
- #5301: Bump gems and bundler
- #5307: Bump org.apache.maven.plugins:maven-clean-plugin from 3.3.2 to 3.4.0
- #5308: Bump webrick from 1.8.2 to 1.9.0 in /docs in the all-gems group across 1 directory
- #5312: Bump maven-pmd-plugin from 3.24.0 to 3.26.0
- #5316: Bump rouge from 4.4.0 to 4.5.0 in the all-gems group across 1 directory
- #5317: Bump org.apache.commons:commons-compress from 1.26.0 to 1.27.1
- #5348: Bump rouge from 4.5.0 to 4.5.1 in the all-gems group across 1 directory
- #5350: Bump org.apache.commons:commons-lang3 from 3.14.0 to 3.17.0
- #5356: Bump build-tools to 28
- #5357: Bump log4j.version from 2.23.0 to 2.24.2
- #5358: Bump org.apache.maven.plugins:maven-dependency-plugin from 3.7.1 to 3.8.1
- #5359: Bump org.apache.maven.plugins:maven-release-plugin from 3.0.1 to 3.1.1
- #5360: Bump io.github.apex-dev-tools:apex-ls_2.13 from 5.2.0 to 5.5.0
- #5361: Bump ant.version from 1.10.14 to 1.10.15
- #5362: Bump org.jetbrains:annotations from 24.1.0 to 26.0.1
- #5363: Bump com.puppycrawl.tools:checkstyle from 10.18.1 to 10.20.1
- #5364: Bump info.picocli:picocli from 4.7.5 to 4.7.6
- #5365: Bump com.github.hazendaz.maven:coveralls-maven-plugin from 4.5.0-M3 to 4.5.0-M5
- #5366: Bump org.mockito:mockito-core from 4.11.0 to 5.14.2
- #5367: Bump surefire.version from 3.2.5 to 3.5.2
- #5368: Bump org.junit.platform:junit-platform-suite from 1.11.2 to 1.11.3
📈 Stats
- 216 commits
- 55 closed tickets & PRs
- Days since last release: 35