Description
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.