You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[core] Include XML validation details in ruleset loading errors #6912
Is your feature request related to a problem? Please describe.
I want to supply a custom PmdReporter because the default error message when loading a ruleset fails only contains "Cannot load ruleset ruleset.xml: An XML validation error occurred" while not specifying what exactly went wrong.
My custom PmdReporter records that error and add it as a suppressed exception.
Describe the solution you'd like RuleSetLoader#withReporter is publicly accessible
Describe alternatives you've considered
Reflection
Your real problem seems to be the vague error message. I’ve found that frustrating myself. Let's make this ticket about fixing the error message instead of extending the public API.
Thanks @UncleOwen for the redirect — agreed this is better solved by fixing the vague RuleSetLoadException message rather than exposing withReporter.
I'll close #6937 (API expansion) as out of scope. If I pursue a fix, it will be a separate PR that puts the XML validation detail into the exception message itself so callers get useful feedback without needing a custom reporter.
Your real problem seems to be the vague error message. I’ve found that frustrating myself. Let's make this ticket about fixing the error message instead of extending the public API.
That's correct, however why don't also (additionally) make the method public? I see no disadvantages doing this...
AFAIR, the reporter can be set via PMDConfiguration#setReporter and the RuleSetLoader should be created with RuleSetLoader#fromPmdConfig - then it preserves the initially set reporter.
AFAIR, the reporter can be set via PMDConfiguration#setReporter and the RuleSetLoader should be created with RuleSetLoader#fromPmdConfig - then it preserves the initially set reporter.
I don't think that creating an entire PMDConfiguration - that I don't even need in that place - just to set the reporter - because there is no publicly accessible method - is a good practice and intuitive.
changed the title [-]`RuleSetLoader#withReporter` is not publicly accessible[/-][+][core] Include XML validation details in ruleset loading errors[/+]on Oct 4, 2026
Activity
UncleOwen commentedon Aug 5, 2026
That sounds like an XY problem.
Your real problem seems to be the vague error message. I’ve found that frustrating myself. Let's make this ticket about fixing the error message instead of extending the public API.
arimu1 commentedon Aug 6, 2026
Thanks @UncleOwen for the redirect — agreed this is better solved by fixing the vague
RuleSetLoadExceptionmessage rather than exposingwithReporter.I'll close #6937 (API expansion) as out of scope. If I pursue a fix, it will be a separate PR that puts the XML validation detail into the exception message itself so callers get useful feedback without needing a custom reporter.
AB-xdev commentedon Aug 6, 2026
That's correct, however why don't also (additionally) make the method public? I see no disadvantages doing this...
adangel commentedon Aug 14, 2026
AFAIR, the reporter can be set via
PMDConfiguration#setReporterand the RuleSetLoader should be created withRuleSetLoader#fromPmdConfig- then it preserves the initially set reporter.AB-xdev commentedon Aug 18, 2026
I don't think that creating an entire
PMDConfiguration- that I don't even need in that place - just to set the reporter - because there is no publicly accessible method - is a good practice and intuitive.[-]`RuleSetLoader#withReporter` is not publicly accessible[/-][+][core] Include XML validation details in ruleset loading errors[/+]