Avoid NoSuchMethodException for annotation attribute checks
Closes gh-32921
(cherry picked from commit b08883b65c)
This commit is contained in:
parent
2384474615
commit
d41048528f
|
|
@ -1052,16 +1052,16 @@ public abstract class AnnotationUtils {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
Method method = annotation.annotationType().getDeclaredMethod(attributeName);
|
for (Method method : annotation.annotationType().getDeclaredMethods()) {
|
||||||
|
if (method.getName().equals(attributeName) && method.getParameterCount() == 0) {
|
||||||
return invokeAnnotationMethod(method, annotation);
|
return invokeAnnotationMethod(method, annotation);
|
||||||
}
|
}
|
||||||
catch (NoSuchMethodException ex) {
|
}
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
catch (Throwable ex) {
|
catch (Throwable ex) {
|
||||||
handleValueRetrievalFailure(annotation, ex);
|
handleValueRetrievalFailure(annotation, ex);
|
||||||
return null;
|
|
||||||
}
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue