SONARJAVA-6889 Create new structure for storing all collected dependencies - #6068
SONARJAVA-6889 Create new structure for storing all collected dependencies#6068NoemieBenard wants to merge 3 commits into
Conversation
Code Review ✅ Approved 2 resolved / 2 findingsIntroduces ✅ 2 resolved✅ Quality: TypeToBeanNamesIndex.getKeys() is unused and leaks a mutable key view
✅ Bug: New index exposes its internal mutable Set despite "immutable" doc
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 |
|
asya-vorobeva
left a comment
There was a problem hiding this comment.
Let's refactor BeanDefinitionGatherer.
- Let's extract all static methods related to caching mechanism. It will significantly improve readability. I have a feeling that we can create additional intermediate abstract class (or interface) to use it in all checks requiring caching, but it's better to do it in separate PR as global improvement. So far we can create util class to encapsulate all these methods and use it here.
- Add comments to all the methods / places in the code when we need to clarify decisions made. Especially it relates to visitNode code blocks, extractBeanName, collectBeanMethod, collectAutowiredDependencies, parameterDependencies, extractQualifier; and also to methods related to caching.


Summary
TypeToDependenciesIndex, extendingSpringContextModelto track injected dependencies (name +BeanLocation) indexed by fully-qualified type.BeanDefinitionGathererto populate the new index alongside the existingTypeToBeanNamesIndex.