Skip to content

[core] Make RuleSetLoader#withReporter public - #6937

Closed
arimu1 wants to merge 1 commit into
pmd:mainfrom
arimu1:fix/6912-rulesetloader-withreporter-public
Closed

arimu1 wants to merge 1 commit into
pmd:mainfrom
arimu1:fix/6912-rulesetloader-withreporter-public

Conversation

@arimu1

@arimu1 arimu1 commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Describe the PR

RuleSetLoader#withReporter was package-private, so external callers could not configure a custom PmdReporter when loading rulesets outside of PmdAnalysis. The default quiet reporter (or the opaque summary on RuleSetLoadException) made it hard to see the underlying validation detail.

This change makes withReporter part of the public fluent API (with javadoc) and documents it under API Changes / Fixed Issues.

InternalApiBridge.withReporter remains for existing internal callers.

Related issues

Ready?

  • Added unit tests for fixed bug/feature
  • Passing all unit tests
  • Complete build ./mvnw clean verify passes (checked automatically by github actions)
  • Added (in-code) documentation (if needed)

Notes

Expose withReporter on the public fluent API so callers can supply a
custom PmdReporter when loading rulesets outside PmdAnalysis and
observe detailed validation/loading messages.

@UncleOwen UncleOwen left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please see my comments on #6912

@arimu1

arimu1 commented Aug 6, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @UncleOwen — you're right that this is an XY problem.

Closing this PR as out of scope. Making RuleSetLoader#withReporter public was addressing the symptom (no way for external callers to see validation detail) rather than the real issue: the RuleSetLoadException summary is too vague ("An XML validation error occurred") while the useful detail only goes to the (often quiet) reporter.

I'll follow the direction on #6912 and pursue improving the exception message itself instead of expanding the public API. Happy to open a focused follow-up PR for that when ready.

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.

[core] Include XML validation details in ruleset loading errors

2 participants