Skip to content

SONARJAVA-6798 Collect dependencies from implicit single-constructor injection - #5950

Open
NoemieBenard wants to merge 3 commits into
nb/sonarjava-6791-qualifier-handlingfrom
nb/sonarjava-6798-implicit-constructor-injection
Open

SONARJAVA-6798 Collect dependencies from implicit single-constructor injection#5950
NoemieBenard wants to merge 3 commits into
nb/sonarjava-6791-qualifier-handlingfrom
nb/sonarjava-6798-implicit-constructor-injection

Conversation

@NoemieBenard

@NoemieBenard NoemieBenard commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

Summary by Gitar

  • Spring context model:
    • Collect dependencies from implicit single-constructor injection in BeanDefinitionGatherer
    • Add test cases for single-constructor and multiple-constructor scenarios

This will update automatically on new commits.

@hashicorp-vault-sonar-prod

hashicorp-vault-sonar-prod Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

SONARJAVA-6798

@NoemieBenard
NoemieBenard force-pushed the nb/sonarjava-6798-implicit-constructor-injection branch from e764d04 to cd56907 Compare August 21, 2026 09:39
@NoemieBenard
NoemieBenard marked this pull request as ready for review August 21, 2026 11:53
@gitar-bot

gitar-bot Bot commented Aug 21, 2026

Copy link
Copy Markdown
Code Review ✅ Approved 1 resolved / 1 findings

Adds dependency collection from implicit single-constructor injection and handles qualifier annotations in BeanDefinitionGatherer, resolving the unused BeanDependency record finding. No issues found.

✅ 1 resolved
Quality: New BeanDependency record is dead/unused code

📄 java-frontend/src/main/java/org/sonar/java/model/springcontext/BeanDependency.java:27 📄 java-frontend/src/main/java/org/sonar/java/model/springcontext/BeanDefinitionGatherer.java:304-318
This commit adds the new BeanDependency record but the same commit replaces its only consumers: dependency collection now returns Map<String, Set<String>> and the tests no longer reference BeanDependency::typeFqn/qualifier. A codebase-wide search confirms no remaining references, so the file is dead code. Either delete BeanDependency.java or wire it into the model; leaving an unused type adds confusion for future readers.

Options

Auto-apply is off → Gitar will not commit updates to this branch.
Display: compact → Showing less information.

Comment with these commands to change the behavior for this request:

Auto-apply Compact
gitar auto-apply:on         
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@sonarqube-next

Copy link
Copy Markdown
Contributor

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.

1 participant