[java] Initial stub for annotation type resolution#4240
Conversation
- During type resolution annotations weren't included. The AST allows to look into them for the source proper, but there was no way for types obtained from the classpath.
bb378a8 to
236291f
Compare
|
@oowekyala I would love your input before I drive deeper into this, as I have my share of doubts. I wanted to try and use PMD 7 to implement some rules around First off, annotations are somewhat odd in the current system… We have 2 main categories of objects:
So, a method declaration is a symbol, and it's return type and formal parameters are types. Annotations are definitely not symbols in this context. They are not defined (when that's the case, it's properly handled and a Is it ok to have symbols hold references to the actual annotations this way? |
|
Hi Juan, yes I think symbols are the place annotations should be reflected. I had started work on that a while ago and stashed it. See #4241 and #3752. This has the symbol part of annotations, in particular https://github.com/pmd/pmd/pull/4241/files#diff-47b203023af58e3d1abf78590e8159d79fdae0bc4c1f8527c4643961a3208789R16 which is your JAnnotatableElementSymbol. The other part to this is adding a |
|
@oowekyala thanks, I'll look into that branch and see where it goes. |
Describe the PR
Related issues
Ready?
./mvnw clean verifypasses (checked automatically by github actions)