@@ -531,7 +531,7 @@ private static <A extends Annotation> A findAnnotation(
531
531
*/
532
532
@ SuppressWarnings ("unchecked" )
533
533
@ Nullable
534
- public static <A extends Annotation > A findAnnotation (Method method , Class <A > annotationType ) {
534
+ public static <A extends Annotation > A findAnnotation (Method method , @ Nullable Class <A > annotationType ) {
535
535
Assert .notNull (method , "Method must not be null" );
536
536
if (annotationType == null ) {
537
537
return null ;
@@ -656,7 +656,9 @@ public static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A> a
656
656
*/
657
657
@ SuppressWarnings ("unchecked" )
658
658
@ Nullable
659
- private static <A extends Annotation > A findAnnotation (Class <?> clazz , Class <A > annotationType , boolean synthesize ) {
659
+ private static <A extends Annotation > A findAnnotation (
660
+ Class <?> clazz , @ Nullable Class <A > annotationType , boolean synthesize ) {
661
+
660
662
Assert .notNull (clazz , "Class must not be null" );
661
663
if (annotationType == null ) {
662
664
return null ;
@@ -1316,7 +1318,7 @@ public static Object getValue(Annotation annotation) {
1316
1318
* @see #rethrowAnnotationConfigurationException(Throwable)
1317
1319
*/
1318
1320
@ Nullable
1319
- public static Object getValue (Annotation annotation , String attributeName ) {
1321
+ public static Object getValue (@ Nullable Annotation annotation , @ Nullable String attributeName ) {
1320
1322
if (annotation == null || !StringUtils .hasText (attributeName )) {
1321
1323
return null ;
1322
1324
}
@@ -1356,7 +1358,7 @@ public static Object getDefaultValue(Annotation annotation) {
1356
1358
* @see #getDefaultValue(Class, String)
1357
1359
*/
1358
1360
@ Nullable
1359
- public static Object getDefaultValue (Annotation annotation , String attributeName ) {
1361
+ public static Object getDefaultValue (@ Nullable Annotation annotation , @ Nullable String attributeName ) {
1360
1362
if (annotation == null ) {
1361
1363
return null ;
1362
1364
}
@@ -1384,7 +1386,9 @@ public static Object getDefaultValue(Class<? extends Annotation> annotationType)
1384
1386
* @see #getDefaultValue(Annotation, String)
1385
1387
*/
1386
1388
@ Nullable
1387
- public static Object getDefaultValue (Class <? extends Annotation > annotationType , String attributeName ) {
1389
+ public static Object getDefaultValue (
1390
+ @ Nullable Class <? extends Annotation > annotationType , @ Nullable String attributeName ) {
1391
+
1388
1392
if (annotationType == null || !StringUtils .hasText (attributeName )) {
1389
1393
return null ;
1390
1394
}
@@ -1440,7 +1444,8 @@ public static <A extends Annotation> A synthesizeAnnotation(
1440
1444
1441
1445
@ SuppressWarnings ("unchecked" )
1442
1446
static <A extends Annotation > A synthesizeAnnotation (A annotation , @ Nullable Object annotatedElement ) {
1443
- if (annotation == null || annotation instanceof SynthesizedAnnotation ) {
1447
+ Assert .notNull (annotation , "Annotation must not be null" );
1448
+ if (annotation instanceof SynthesizedAnnotation ) {
1444
1449
return annotation ;
1445
1450
}
1446
1451
0 commit comments