New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Missing API access for annotations on type parameters and wildcard type arguments #741
Comments
Fixes classgraph#741 Exposes missing API for accessing parsed annotations on type parameters and wildcard type arguments.
@platosha Thanks for reporting this, for explaining the background, and for providing the complete fix! Much appreciated. I'll roll out a release tonight with this. |
This is released in 4.8.153, but then I subsequently committed 42753ef, which moves this method into the superclass -- that way all type signature classes support getting type annotation information. (Adds support for |
@lukehutch thanks a lot! |
@platosha The weird thing is I went to document this API call in the wiki docs, and it was already there! So it looks like I always planned to add this getter, I just forgot to do it. 🤦♂️ I'm glad you caught it! |
TypeParameter
andTypeArgument
(in case of using a wildcard) could hold annotations, but they do not have agetTypeAnnotationInfo()
getter exposed, despite parsing works seemingly correctly in both cases.Consider analysing annotations specified on the method parameter types in the scan result of the following class:
typeParameter.toString()
andtypeArgument.toString()
results show the@A
annotation where expected, but there is no API to access the@A
annotation info other thantoString()
.Apart from Java, this has a big impact on working with Kotlin compiled code, as for some types (
BigDecimal
andBigInteger
are known examples, my wild guess, for supporting Kotlin language extensions) compiler emitsList<@A ? extends Type> param
in JVM bytecode whereas the source hadList<@A Type> param
.The text was updated successfully, but these errors were encountered: