Validate Class attributes as well as Class array attributes

Issue: SPR-16564
This commit is contained in:
Juergen Hoeller 2018-03-12 20:41:44 +01:00
parent 50e980c02f
commit 967a2ef2d2
1 changed files with 2 additions and 1 deletions

View File

@ -912,7 +912,8 @@ public abstract class AnnotationUtils {
*/
public static void validateAnnotation(Annotation annotation) {
for (Method method : getAttributeMethods(annotation.annotationType())) {
if (method.getReturnType() == Class.class) {
Class<?> returnType = method.getReturnType();
if (returnType == Class.class || returnType == Class[].class) {
try {
method.invoke(annotation);
}