SONARJAVA-6412 Implement Visitor for grouping beans per types - #5987
Conversation
a1da0bf to
c3b31d8
Compare
This comment has been minimized.
This comment has been minimized.
21b680b to
856e9a3
Compare
927abb3 to
ddb8a45
Compare
asya-vorobeva
left a comment
There was a problem hiding this comment.
The logic for filling index looks correct. Please move it to existing gatherer and rename it.
| * Populates {@link TypeToBeanNamesIndex} by mapping every type in a bean's hierarchy | ||
| * (concrete class, superclasses, interfaces) to the bean's name. | ||
| */ | ||
| public class TypeToBeanNamesIndexGatherer extends SpringContextModelGatherer { |
There was a problem hiding this comment.
What's the point of implementing this visitor as separated one? We can fill needed data in existing BeanDefinitionGatherer as we already have all the needed machinery there.
…eans of the same type
fac106b to
2f87eb6
Compare
Code Review ✅ Approved 8 resolved / 8 findingsImplements TypeToBeanNamesIndexGatherer to map Spring bean types and extracts resolution helpers into SpringUtils, addressing multiple null-guard, caching, and constructor injection findings. ✅ 8 resolved✅ Edge Case: resolveStereotypeBeanName lacks null-guard on annotation value
✅ Quality: @Bean/stereotype name aliases beyond the first are dropped
✅ Edge Case: extractBeanName drops null-guard on annotation value
✅ Quality: Bean-name resolution duplicated instead of reusing SpringUtils
✅ Edge Case: Single-constructor injection skipped when any other dep exists
...and 3 more resolved from earlier reviews 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
TypeToBeanNamesIndexGathererto map type hierarchies of Spring beans to bean namesSpringUtilsTypeToBeanNamesIndexGathererTestcovering stereotype and@BeanmethodsThis will update automatically on new commits.