8213905: reflection not working for type annotations applied to exception types in the inner class constructor

Reviewed-by: jlahoda
This commit is contained in:
Vicente Romero 2022-01-26 00:33:10 +00:00
parent 295c0474c4
commit 2eab86b513
2 changed files with 15 additions and 5 deletions

View file

@ -132,7 +132,8 @@ public final class TypeAnnotationParser {
Class<?> declaringClass = ctor.getDeclaringClass();
if (!declaringClass.isEnum() &&
(declaringClass.isMemberClass() &&
(declaringClass.getModifiers() & Modifier.STATIC) == 0) ) {
(declaringClass.getModifiers() & Modifier.STATIC) == 0) &&
filter == TypeAnnotation.TypeAnnotationTarget.METHOD_FORMAL_PARAMETER) {
offset = true;
}
}