Repository navigation
Conversation
08f39fd to
963d76f
Compare
963d76f to
7008e58
Compare
7625fd7 to
d22d127
Compare
d22d127 to
47259eb
Compare
47259eb to
eb2f920
Compare
eb2f920 to
30ba4b5
Compare
david-schroeter
left a comment
There was a problem hiding this comment.
This PR looks good overall, I just have a few questions and suggestion that I think should be addressed before merging.
|
This comment will be updated automatically if new data arrives. 🔗 Commit SHA: f5eb477 | Docs | View more details | Give us feedback! |
Code Review ✅ Approved 🟡 Medium risk 4 closed / 4 findingsServiceLoader-based parser selection can route analysis through an enabled alternate frontend, potentially changing Java parsing results or failing analysis. Introduces a ✅ 4 closed✅ Bug: Provider whose configure() failed is logged as skipped but still used
✅ Edge Case: Provider loading/linkage errors bypass the ECJ fallback and break parsing
Closed: Edge Case: Eager static discovery breaks SonarLint, which never uses providers
Closed: Quality: PR description still says first enabled provider wins
Verification Rules 3/3 met Repos 5 inspected · PRs 2 inspectedFunctional validation No results Rules 3 passed 2 not applicable
Broader impact Repos 5 inspected PRs 2 inspectedCross-repo 5 repositories inspected 0 open impacts
Cross-PR 2 PRs inspected 0 open impacts
Auto-approval Not enabledFor more verification details, comment OptionsAuto-apply is off → Gitar will not commit updates to this branch. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Gitar |
|
david-schroeter
left a comment
There was a problem hiding this comment.
LGTM!
Thanks for addressing all the comments!




Part 1 of 17 of JAVA-7392. Ticket: JAVA-7393.
Intent
Let another frontend replace ECJ without any caller knowing. Every
JParseris now created throughJParserProviders, which asks the providers found withServiceLoader. The frontends are independent: ECJ is used only when no provider is enabled, never as a fallback. At most one provider may be enabled: several enabled providers fail the analysis, since the discovery order is not a priority.JavaSensorcallsJParserProviders.configure(context.config())once per analysis (not in SonarLint), so a provider can read its settings before any parser is created.State on master
No provider is installed, so ECJ parses exactly as today.
Test plan
JParserProvidersTestwith two providers registered throughServiceLoader(test only, driven by the configuration): the enabled one creates the parser with the requested arguments, disabled ones are skipped, no enabled provider means ECJ, several enabled providers fail, reconfiguring forgets the previous analysisisEnabledor to create its parser fails instead of falling backJParserTest,JParserModeTestunchanged