fix: satisfy PMD 7.26.0 across the reactor (visibility + assertEquals order)#1451
Open
joaodinissf wants to merge 1 commit into
Open
fix: satisfy PMD 7.26.0 across the reactor (visibility + assertEquals order)#1451joaodinissf wants to merge 1 commit into
joaodinissf wants to merge 1 commit into
Conversation
be5d8c2 to
c5c6f96
Compare
PMD 7.26.0 tightens two rules that flag pre-existing code, breaking the
maven-pmd-plugin `check` goal:
PublicMemberInNonPublicType -- drop the needless `public` on members of
non-public (anonymous / nested) types:
* QualifiedNameSegmentTreeLookup visitor overrides -> package-private
(they override a package-private `Visitor.visit(SegmentNode)`).
* ScopingGeneratorUtil / ExportGeneratorSupport `allPackages()` overrides
and AbstractFragmentProviderTest's `appendEscaped`/`unescape` test hooks
-> protected (the overridden framework methods are themselves protected;
the migration had needlessly widened them to public).
AssertEqualsArgumentOrder -- put expected before actual in five assertEquals
calls across the test bundles (BasicModelTest, AbstractValidationTest,
AbstractQuickFixTest, AbstractFragmentProviderTest,
QualifiedNameSegmentTreeLookupTest). Behaviour-preserving; only corrects the
expected/actual reporting order.
Verified with a full `clean verify ... pmd:check spotbugs:check` under
-Dpmd.version=7.26.0 (compiles first, so PMD gets real type resolution):
BUILD SUCCESS, 0 violations, 64 modules.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
c5c6f96 to
6a3be72
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PMD 7.26.0 tightens two rules that now flag pre-existing code across the reactor, breaking the
maven-pmd-plugincheckgoal. This clears every violation with real fixes — no rule suppressions.PublicMemberInNonPublicTypeDrops the needless
publicon members declared in non-public (anonymous / nested) types, narrowing each to the minimum the override allows:QualifiedNameSegmentTreeLookup— threevisit(SegmentNode)overrides → package-private (they override a package-privateVisitor.visit).ScopingGeneratorUtil/ExportGeneratorSupport— theallPackages()overrides →protected(the framework'sEmfRegistryMetaModel.allPackages()is itselfprotected; the migration had widened it).AbstractFragmentProviderTest— theappendEscaped/unescapetest hooks →protected(same-package test access preserved).AssertEqualsArgumentOrderPuts
expectedbeforeactualin fiveassertEqualscalls (BasicModelTest,AbstractValidationTest,AbstractQuickFixTest,AbstractFragmentProviderTest,QualifiedNameSegmentTreeLookupTest). Behaviour-preserving — only corrects the reported expected/actual order.Why now
Unblocks the Dependabot bump #1449 (
pmd.version7.25.0 → 7.26.0). Landing this onmasterfirst lets #1449 rebase to a clean, green, bump-only PR.Verification
Full reactor build with compilation (so PMD has real type resolution), under the new version:
→ BUILD SUCCESS, 0 PMD violations, 64 modules.
Note: a no-compile
pmd:checkunder-reports type-resolution-dependent findings, so the compile step is required to reproduce CI'smaven-verifyjob faithfully.🤖 Generated with Claude Code