Repository navigation
Conversation
08f39fd to
963d76f
Compare
963d76f to
7008e58
Compare
7625fd7 to
d22d127
Compare
d22d127 to
47259eb
Compare
47259eb to
eb2f920
Compare
Code Review ✅ Approved 🟡 Medium risk 3 closed / 3 findingsServiceLoader-based dispatch lets enabled providers replace ECJ and fail analyses without fallback, potentially changing parsing and downstream Java analysis results. Adds
✅ 3 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
Verification Rules 3/3 met Repos 4 inspected · PRs 2 inspectedFunctional validation No results Rules 3 passed 2 not applicable
Broader impact Repos 4 inspected PRs 2 inspectedCross-repo 4 repositories 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 |
|




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.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
JParserProvidersTest: first enabled provider wins, disabled ones are skipped, a provider that fails to configure, to answerisEnabledor to create its parser fails instead of falling backJParserTest,JParserModeTestunchanged