Skip to content

CHANGE @W-24708955@ Upgrade PMD from 7.26.0 to 7.29.0 - #523

Merged
nikhil-mittal-165 merged 1 commit into
devfrom
nikhil.mittal/pmd-version-upgrade-20261126
Nov 26, 2026
Merged

nikhil-mittal-165 merged 1 commit into
devfrom
nikhil.mittal/pmd-version-upgrade-20261126

Conversation

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor

Summary

Upgrades the PMD engine from 7.26.0 to 7.29.0 (@W-24708955@).

Changes

  • PMD 7.26.0 -> 7.29.0 (constants.ts, libs.versions.toml); package version bumped to 0.48.0-SNAPSHOT.
  • gson 2.14.0 -> 2.15.0, to match PMD's parent pom. JUnit stays on 5.14.4 (the 6.x line is a major jump and requires Java 17+; this package targets Java 11).
  • @Nullable import: PMD 7.29.0's PmdReporter now uses org.checkerframework.checker.nullness.qual.Nullable instead of javax.annotation.Nullable. Updated CpdRunner.java and PmdRuleDescriber.java, otherwise :pmd-cpd-wrappers:compileJava fails.
  • JUnit launcher exclusion: pmd-test 7.29.0 now pulls in junit-platform-launcher 6.x (Java 17+). Excluded group org.junit.platform from pmd-test in pmd-rules/build.gradle.kts; the launcher is still supplied through our own testRuntimeOnly.
  • New rule mapping: PMD 7.28.0 added the Apex rule ApexUnitTestClassShouldHaveRunRelevantTestsAnnotation. Mapped as Low severity, NOT Recommended, because it targets a Beta feature (API v66.0+, RunRelevantTests). Added to pmd-rule-mappings.ts and the rules_apexOnly goldfile.
  • Test updates for PMD behaviour changes:
    • CPD HTML duplicate block now ends at line 44 / 164 tokens (was 43 / 123). This is the upstream fix for [html] CPD does not include the last line in the duplication chunk pmd/pmd#5313, so the stale "this might be a bug" comment is removed.
    • PMD 7.29 no longer raises a processing error for empty Apex files (7.26 did). samplePmdWorkspace/dummy.cls now contains invalid Apex so the "unparseable file surfaces an error" assertion stays strict.

Testing

  • npm test in packages/code-analyzer-pmd-engine: Java tests pass, TypeScript 8 suites / 152 tests pass.
  • Old-vs-new PMD comparison (7.26 vs 7.29) across the release repo set is in progress; results must be reviewed before this PR is merged. Expected differences so far: the new Apex rule (non-Recommended, so off by default in the Recommended selector) and a small AvoidInlineStyles delta under investigation.

🤖 Generated with Claude Code

- Updated PMD from 7.26.0 to 7.29.0
- Updated gson 2.14.0 -> 2.15.0 (matches PMD's parent pom); JUnit stays at 5.14.4
- Switched @nullable import to checker-qual (PMD 7.29.0 PmdReporter signature change)
- Excluded org.junit.platform from pmd-test (7.29.0 pulls in junit-platform-launcher 6.x, Java 17+)
- Mapped new Apex rule ApexUnitTestClassShouldHaveRunRelevantTestsAnnotation (Low, not Recommended)
- Updated tests for PMD behaviour changes (CPD HTML endLine fix, empty Apex files no longer error)
- Bumped package version to 0.48.0-SNAPSHOT

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@git2gus

git2gus Bot commented Nov 26, 2026

Copy link
Copy Markdown

Git2Gus App is installed but the .git2gus/config.json doesn't have right values. You should add the required configuration.

@nikhil-mittal-165
nikhil-mittal-165 merged commit b2051f6 into dev Nov 26, 2026
9 checks passed
@nikhil-mittal-165

Copy link
Copy Markdown
Contributor Author

@nikhil-mittal-165

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants