Skip to content

Commit 14a7983

Browse files
committed
Tolerate isCandidateClass call with null as annotation type
Closes gh-30842 (cherry picked from commit a102cd5)
1 parent 0a4f290 commit 14a7983

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

spring-core/src/main/java/org/springframework/core/annotation/AnnotationUtils.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2022 the original author or authors.
2+
* Copyright 2002-2023 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -149,8 +149,8 @@ public static boolean isCandidateClass(Class<?> clazz, Collection<Class<? extend
149149
* @since 5.2
150150
* @see #isCandidateClass(Class, String)
151151
*/
152-
public static boolean isCandidateClass(Class<?> clazz, Class<? extends Annotation> annotationType) {
153-
return isCandidateClass(clazz, annotationType.getName());
152+
public static boolean isCandidateClass(Class<?> clazz, @Nullable Class<? extends Annotation> annotationType) {
153+
return (annotationType != null && isCandidateClass(clazz, annotationType.getName()));
154154
}
155155

156156
/**

0 commit comments

Comments
 (0)