Skip to content

fix: upgrade PMD to 7.26.0 to and correct issues - #150

Merged
szysas merged 1 commit into
masterfrom
bump-pmd
Sep 3, 2026
Merged

fix: upgrade PMD to 7.26.0 to and correct issues#150
szysas merged 1 commit into
masterfrom
bump-pmd

Conversation

@szysas

@szysas szysas commented Sep 2, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Upgrades PMD to 7.27.0 to address CVE-2025-23215 / Dependabot alert #4.
  • Declares explicit pmd dependencies in build.gradle.kts so Dependabot automatically tracks future PMD updates, isolated into separate PRs via .github/dependabot.yml.
  • Updates pmd-rules.xml for PMD 7 compatibility and disables PMD on the deprecated lwm2m module.
  • Fixes all codebase violations raised by PMD 7 rules and adds unit tests to maintain 100% diff coverage.

PMD Rules Fixed in Code

  • LooseCoupling: Switched from concrete types (ArrayList, LinkedList, ConcurrentHashMap) to interfaces (List, ConcurrentMap, Map).
  • EnumComparison: Replaced .equals() with == on enum comparisons.
  • ModifierOrder: Standardized Java modifier order (e.g. public static final).
  • UnusedReturnValue: Replaced unchecked InputStream.read() with Files.readAllBytes().
  • UnnecessaryFullyQualifiedName: Removed redundant class qualifiers already in scope.
  • ImplicitFunctionalInterface: Added @FunctionalInterface annotations to SAM interfaces.
  • UnnecessaryBoxing: Removed explicit longValue() conversions where automatic unboxing/overloads apply.
  • InsufficientStringBufferDeclaration & ConsecutiveAppendsShouldReuse: Sized StringBuilder capacity appropriately and chained .append() calls.
  • UseDiamondOperator & UselessParentheses: Cleaned up diamond syntax and redundant parentheses.

Rules Excluded in pmd-rules.xml

  • Excluded subjective/disruptive rules that alter functional branching (SimplifyBooleanReturns, SimplifyConditional, LiteralsFirstInComparisons, AvoidDeeplyNestedIfStmts, ExceptionAsFlowControl, AvoidSynchronizedStatement).
  • Updated rule exclusions to PMD 7 naming (InstantiableUtilityClass, TypeParameterNamingConventions, PublicMemberInNonPublicType, BooleanGetMethodName).

@szysas
szysas marked this pull request as ready for review September 2, 2026 07:58
@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.92%. Comparing base (01f2fa4) to head (ef16df8).

Additional details and impacted files
@@             Coverage Diff              @@
##             master     #150      +/-   ##
============================================
+ Coverage     92.86%   92.92%   +0.06%     
- Complexity     2141     2142       +1     
============================================
  Files           135      135              
  Lines          4762     4761       -1     
  Branches        637      637              
============================================
+ Hits           4422     4424       +2     
+ Misses          194      192       -2     
+ Partials        146      145       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@szysas
szysas merged commit 5d3b4d5 into master Sep 3, 2026
9 checks passed
@szysas
szysas deleted the bump-pmd branch September 3, 2026 11:14
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.

1 participant