leangen / geantyref

Advanced generic type reflection library with support for working with AnnotatedTypes (for Java 8+)
Apache License 2.0
99 stars 15 forks source link

Mitigate Java's annotation parser bug where possible #9

Closed kaqqao closed 4 years ago

kaqqao commented 4 years ago

Java versions before 11 (?) have multiple bugs in the annotation parser (e.g. this one) causing it to lose annotations on nested types.

It is in some cases possible to recover the lost class-level annotations when transforming a type to its canonical form, and GenericTypeReflector#toCanonical should take advantage of these mitigations where applicable.