@@ -70,8 +70,8 @@ public abstract class AnnotationUtils {
70
70
* Get a single {@link Annotation} of {@code annotationType} from the supplied
71
71
* annotation: either the given annotation itself or a meta-annotation thereof.
72
72
* @param ann the Annotation to check
73
- * @param annotationType the annotation class to look for, both locally and as a meta-annotation
74
- * @return the matching annotation or {@code null} if not found
73
+ * @param annotationType the annotation type to look for, both locally and as a meta-annotation
74
+ * @return the matching annotation, or {@code null} if none found
75
75
* @since 4.0
76
76
*/
77
77
@ SuppressWarnings ("unchecked" )
@@ -87,8 +87,8 @@ public static <T extends Annotation> T getAnnotation(Annotation ann, Class<T> an
87
87
* Method, Constructor or Field. Meta-annotations will be searched if the annotation
88
88
* is not declared locally on the supplied element.
89
89
* @param ae the Method, Constructor or Field from which to get the annotation
90
- * @param annotationType the annotation class to look for, both locally and as a meta-annotation
91
- * @return the matching annotation or {@code null} if not found
90
+ * @param annotationType the annotation type to look for, both locally and as a meta-annotation
91
+ * @return the matching annotation, or {@code null} if none found
92
92
* @since 3.1
93
93
*/
94
94
public static <T extends Annotation > T getAnnotation (AnnotatedElement ae , Class <T > annotationType ) {
@@ -119,7 +119,7 @@ public static Annotation[] getAnnotations(Method method) {
119
119
* Get a single {@link Annotation} of {@code annotationType} from the supplied {@link Method}.
120
120
* <p>Correctly handles bridge {@link Method Methods} generated by the compiler.
121
121
* @param method the method to look for annotations on
122
- * @param annotationType the annotation class to look for
122
+ * @param annotationType the annotation type to look for
123
123
* @return the annotations found
124
124
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod(Method)
125
125
*/
@@ -135,7 +135,7 @@ public static <A extends Annotation> A getAnnotation(Method method, Class<A> ann
135
135
* <p>Correctly handles bridge {@link Method Methods} generated by the compiler.
136
136
* @param method the method to look for annotations on
137
137
* @param containerAnnotationType the class of the container that holds the annotations
138
- * @param annotationType the annotation class to look for
138
+ * @param annotationType the annotation type to look for
139
139
* @return the annotations found
140
140
* @since 4.0
141
141
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod(Method)
@@ -154,7 +154,7 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotation(Method metho
154
154
* <p>Correctly handles bridge {@link Method Methods} generated by the compiler.
155
155
* @param annotatedElement the element to look for annotations on
156
156
* @param containerAnnotationType the class of the container that holds the annotations
157
- * @param annotationType the annotation class to look for
157
+ * @param annotationType the annotation type to look for
158
158
* @return the annotations found
159
159
* @since 4.0
160
160
* @see org.springframework.core.BridgeMethodResolver#findBridgedMethod(Method)
@@ -170,13 +170,13 @@ public static <A extends Annotation> Set<A> getRepeatableAnnotation(AnnotatedEle
170
170
171
171
/**
172
172
* Find a single {@link Annotation} of {@code annotationType} from the supplied
173
- * {@link Method}, traversing its super methods (i.e., from super classes and
173
+ * {@link Method}, traversing its super methods (i.e., from superclasses and
174
174
* interfaces) if no annotation can be found on the given method itself.
175
175
* <p>Annotations on methods are not inherited by default, so we need to handle
176
176
* this explicitly.
177
177
* @param method the method to look for annotations on
178
- * @param annotationType the annotation class to look for
179
- * @return the annotation found, or {@code null} if none found
178
+ * @param annotationType the annotation type to look for
179
+ * @return the annotation found, or {@code null} if none
180
180
*/
181
181
public static <A extends Annotation > A findAnnotation (Method method , Class <A > annotationType ) {
182
182
A annotation = getAnnotation (method , annotationType );
@@ -288,8 +288,7 @@ private static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A>
288
288
}
289
289
for (Annotation ann : clazz .getDeclaredAnnotations ()) {
290
290
if (!isInJavaLangAnnotationPackage (ann ) && visited .add (ann )) {
291
- A annotation = findAnnotation (ann .annotationType (), annotationType ,
292
- visited );
291
+ A annotation = findAnnotation (ann .annotationType (), annotationType , visited );
293
292
if (annotation != null ) {
294
293
return annotation ;
295
294
}
@@ -312,8 +311,8 @@ private static <A extends Annotation> A findAnnotation(Class<?> clazz, Class<A>
312
311
* <p>The standard {@link Class} API does not provide a mechanism for determining which class
313
312
* in an inheritance hierarchy actually declares an {@link Annotation}, so we need to handle
314
313
* this explicitly.
315
- * @param annotationType the annotation class to look for, both locally and as a meta-annotation
316
- * @param clazz the class on which to check for the annotation, or {@code null}
314
+ * @param annotationType the annotation type to look for, both locally and as a meta-annotation
315
+ * @param clazz the class on which to check for the annotation (may be {@code null})
317
316
* @return the first {@link Class} in the inheritance hierarchy of the specified {@code clazz}
318
317
* which declares an annotation for the specified {@code annotationType}, or {@code null}
319
318
* if not found
@@ -509,8 +508,7 @@ else if (nestedAnnotationsAsMap && value instanceof Annotation[]) {
509
508
Annotation [] realAnnotations = (Annotation []) value ;
510
509
AnnotationAttributes [] mappedAnnotations = new AnnotationAttributes [realAnnotations .length ];
511
510
for (int i = 0 ; i < realAnnotations .length ; i ++) {
512
- mappedAnnotations [i ] = getAnnotationAttributes (
513
- realAnnotations [i ], classValuesAsString , true );
511
+ mappedAnnotations [i ] = getAnnotationAttributes (realAnnotations [i ], classValuesAsString , true );
514
512
}
515
513
attrs .put (method .getName (), mappedAnnotations );
516
514
}
@@ -634,7 +632,7 @@ private void process(AnnotatedElement annotatedElement) {
634
632
this .result .add ((A ) annotation );
635
633
}
636
634
else if (ObjectUtils .nullSafeEquals (this .containerAnnotationType , annotation .annotationType ())) {
637
- result .addAll (Arrays .asList (getValue (annotation )));
635
+ this . result .addAll (Arrays .asList (getValue (annotation )));
638
636
}
639
637
else if (!isInJavaLangAnnotationPackage (annotation )) {
640
638
process (annotation .annotationType ());
@@ -651,8 +649,8 @@ private A[] getValue(Annotation annotation) {
651
649
return (A []) method .invoke (annotation );
652
650
}
653
651
catch (Exception ex ) {
654
- throw new IllegalStateException ("Unable to read value from repeating annotation container "
655
- + this .containerAnnotationType .getName (), ex );
652
+ throw new IllegalStateException ("Unable to read value from repeating annotation container " +
653
+ this .containerAnnotationType .getName (), ex );
656
654
}
657
655
}
658
656
}
0 commit comments