Table of Contents

25-October-2024 - 7.7.0

The PMD team is pleased to announce PMD 7.7.0.

This is a minor release.

🚀 New and noteworthy

CPD can now ignore literals and identifiers in C++ code

When searching for duplicated code in C++ differences in literals or identifiers can be ignored now (like in Java). This can be enabled via the command line options --ignore-literal and --ignore-identifiers.
See PR #5040 for details.

🌟 Rule Changes

Changed Rules

Renamed Rules

The old rule names still work but are deprecated.

🐛 Fixed Issues

  • apex-performance
    • #5270: [apex] AvoidNonRestrictiveQueries when LIMIT is followed by bind expression
  • java
    • #4532: [java] Rule misnomer for JUnit* rules
    • #5261: [java] Record patterns with empty deconstructor lists lead to NPE
  • java-bestpractices
    • #4286: [java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch
    • #4813: [java] SwitchStmtsShouldHaveDefault false positive with pattern matching
  • java-codestyle
    • #5253: [java] BooleanGetMethodName: False-negatives with Boolean wrapper
  • java-design
    • #5030: [java] SwitchDensity false positive with pattern matching
  • java-errorprone
    • #3362: [java] ImplicitSwitchFallThrough should consider switch expressions
    • #5067: [java] CloseResource: False positive for FileSystems.getDefault()
    • #5244: [java] UselessOperationOnImmutable should detect java.time types
    • #5257: [java] NonCaseLabelInSwitch should consider switch expressions
  • java-performance
    • #5249: [java] TooFewBranchesForASwitchStatement false positive for Pattern Matching
    • #5250: [java] TooFewBranchesForASwitchStatement should consider Switch Expressions

🚨 API Changes

✨ Merged pull requests

  • #4965: Fix #4532: [java] Rename JUnit rules with overly restrictive names - Juan Martín Sotuyo Dodero (@jsotuyod)
  • #5040: [cpp] Ignore literals and ignore identifiers capability to C++ CPD - Jakub Dupak (@jdupak)
  • #5225: Fix #5067: [java] CloseResource: False positive for FileSystems.getDefault() - Lukas Gräf (@lukasgraef)
  • #5241: Ignore javacc code in coverage report - Juan Martín Sotuyo Dodero (@jsotuyod)
  • #5245: [java] Improve UnitTestShouldUse{After,Before}Annotation rules to support JUnit5 and TestNG - Andreas Dangel (@adangel)
  • #5247: Fix #5030: [java] SwitchDensity false positive with pattern matching - Andreas Dangel (@adangel)
  • #5248: Fix #3362: [java] ImplicitSwitchFallThrough should consider switch expressions - Andreas Dangel (@adangel)
  • #5251: Fix #5249 and #5250: [java] TooFewBranchesForSwitch ignore pattern matching and support switch expressions - Andreas Dangel (@adangel)
  • #5252: Fix #4813: [java] SwitchStmtsShouldHaveDefault false positive with pattern matching - Andreas Dangel (@adangel)
  • #5255: [java] Rename rule DefaultLabelNotLastInSwitch - Andreas Dangel (@adangel)
  • #5256: Fix #5257: [java] NonCaseLabelInSwitch - support switch expressions - Andreas Dangel (@adangel)
  • #5258: Ignore generated antlr classes in coverage reports - Juan Martín Sotuyo Dodero (@jsotuyod)
  • #5264: Fix #5261: [java] Fix NPE with empty pattern list - Clément Fournier (@oowekyala)
  • #5267: [java] Rename rule SwitchStmtsShouldHaveDefault to NonExhaustiveSwitch - Andreas Dangel (@adangel)
  • #5269: Fix #5253: [java] Support Boolean wrapper class for BooleanGetMethodName rule - Aryant Tripathi (@Aryant-Tripathi)
  • #5273: Fix #5270: [apex] AvoidNonRestrictiveQueries: Fix regex for detecting LIMIT clause - Andreas Dangel (@adangel)
  • #5275: Use plugin-classpath to simplify javacc-wrapper.xml - Andreas Dangel (@adangel)
  • #5278: [java] CouplingBetweenObjects: improve violation message - Andreas Dangel (@adangel)
  • #5279: Fix #5244: [java] UselessOperationOnImmutable: consider java.time.* types - Andreas Dangel (@adangel)

📦 Dependency updates

  • #5234: Bump com.google.protobuf:protobuf-java from 3.25.3 to 4.28.2
  • #5274: Bump org.junit from 5.8.2 to 5.11.2
  • #5276: Bump org.checkerframework:checker-qual from 2.11.1 to 3.48.1
  • #5280: Bump danger from 9.5.0 to 9.5.1 in the all-gems group across 1 directory
  • #5281: Bump org.scala-lang:scala-reflect from 2.13.13 to 2.13.15

📈 Stats

  • 98 commits
  • 32 closed tickets & PRs
  • Days since last release: 27