SONARJAVA-6791 Handle @Qualifier annotations on autowired dependencies in BeanDefinitionGatherer - #5936
Conversation
cf0c655 to
ef6cdf8
Compare
Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
| /** Names of other beans this bean depends on. */ | ||
| private List<String> dependingBeans; | ||
| /** Dependencies this bean requires, each capturing the required type and an optional {@code @Qualifier} name. */ | ||
| private List<BeanDependency> dependingBeans; |
There was a problem hiding this comment.
This list can be rather large, and we need to have fast look-up to be able to define needed dependency. I'd suggest to think about using Map / Set, the key should be the bean's name. In Spring framework this should be qualifier or type.
Code Review ✅ Approved 5 resolved / 5 findingsAdds ✅ 5 resolved✅ Quality: Redundant same-package import breaks import ordering
✅ Quality: Duplicated BeanData construction into two parallel lists
✅ Bug: Qualifier values written raw to cache break serialization
✅ Quality: Doc comment says decapitalized class name, code uses field name
✅ Edge Case: Map keyed by field/param name silently drops colliding dependencies
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 |
|



Summary by Gitar
BeanDependencyrecord to capture dependency type and optional@Qualifiervalue.BeanDefinitionGathererto extract@Qualifierannotations on fields, constructors, and@Beanmethods.This will update automatically on new commits.