You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The AnnotationHierarchies helper class is widely used during indexing, symbol generation, and validation to check for annotation hierarchies and whether a specific annotation found in the source code relates to a specific annotation that is know to the indexing or validation.
The implementation in this space is quite complex and contains a lot of duplication, so this needs a lot of cleanup work. In addition to that results of the AST analysis are not cached, which results in the same checks being performed over and over again with every validation, every indexing, every source files, etc.
AnnotationHierarchies is currently a set of static helper methods. We need to turn this into a project-specific helper that caches results and wipes out the cache as soon as files change. Even though most of the cached data might not be affected by changed code or a changed classpath of the project, the cache might not be able to decide that very precisely. Therefore, wiping the cache with every classpath change and every source file change will be the safest strategy here.
Cleanup and trim down number of methods in AnnotationHierarchies to the absolutely required bare minimum
Transform AnnotationHierarchies into a class with instance methods rather than static. Pass it around via CU property. Create in CU cache and spring indexer.
Introduce CachingAnnotationHierarchies subclass of AnnotationHierarchies. This class will attempt to cache most of the results produced by the non-caching base class. Likely caching will be for binary types rather than source types which may change often.
Activity
BoykoAlex commentedon Nov 30, 2024
The plan is:
AnnotationHierarchiesto the absolutely required bare minimumAnnotationHierarchiesinto a class with instance methods rather than static. Pass it around via CU property. Create in CU cache and spring indexer.CachingAnnotationHierarchiessubclass ofAnnotationHierarchies. This class will attempt to cache most of the results produced by the non-caching base class. Likely caching will be for binary types rather than source types which may change often.Draft PR for 1. is #1421
spring-projectsGH-1288: first simple implementation for a new annotat…
BoykoAlex commentedon Dec 5, 2024
Should be fixed with 78dc6f3 and c583cbc