|
16 | 16 |
|
17 | 17 | package org.springframework.context.annotation;
|
18 | 18 |
|
| 19 | +import java.lang.annotation.Annotation; |
19 | 20 | import java.util.Collections;
|
20 | 21 | import java.util.LinkedHashSet;
|
21 | 22 | import java.util.Map;
|
@@ -271,32 +272,26 @@ static BeanDefinitionHolder applyScopedProxyMode(
|
271 | 272 | }
|
272 | 273 |
|
273 | 274 | @Nullable
|
274 |
| - static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, Class<?> annotationClass) { |
275 |
| - return attributesFor(metadata, annotationClass.getName()); |
| 275 | + static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, Class<?> annotationType) { |
| 276 | + return attributesFor(metadata, annotationType.getName()); |
276 | 277 | }
|
277 | 278 |
|
278 | 279 | @Nullable
|
279 |
| - static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, String annotationClassName) { |
280 |
| - return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationClassName)); |
281 |
| - } |
282 |
| - |
283 |
| - static Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata, |
284 |
| - Class<?> containerClass, Class<?> annotationClass) { |
285 |
| - |
286 |
| - return attributesForRepeatable(metadata, containerClass.getName(), annotationClass.getName()); |
| 280 | + static AnnotationAttributes attributesFor(AnnotatedTypeMetadata metadata, String annotationTypeName) { |
| 281 | + return AnnotationAttributes.fromMap(metadata.getAnnotationAttributes(annotationTypeName)); |
287 | 282 | }
|
288 | 283 |
|
289 | 284 | @SuppressWarnings("unchecked")
|
290 |
| - static Set<AnnotationAttributes> attributesForRepeatable( |
291 |
| - AnnotationMetadata metadata, String containerClassName, String annotationClassName) { |
| 285 | + static Set<AnnotationAttributes> attributesForRepeatable(AnnotationMetadata metadata, |
| 286 | + Class<? extends Annotation> containerType, Class<? extends Annotation> annotationType) { |
292 | 287 |
|
293 | 288 | Set<AnnotationAttributes> result = new LinkedHashSet<>();
|
294 | 289 |
|
295 |
| - // Direct annotation present? |
296 |
| - addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationClassName)); |
| 290 | + // Direct annotation present or meta-present? |
| 291 | + addAttributesIfNotNull(result, metadata.getAnnotationAttributes(annotationType.getName())); |
297 | 292 |
|
298 |
| - // Container annotation present? |
299 |
| - Map<String, Object> container = metadata.getAnnotationAttributes(containerClassName); |
| 293 | + // Container annotation present or meta-present? |
| 294 | + Map<String, Object> container = metadata.getAnnotationAttributes(containerType.getName()); |
300 | 295 | if (container != null && container.containsKey("value")) {
|
301 | 296 | for (Map<String, Object> containedAttributes : (Map<String, Object>[]) container.get("value")) {
|
302 | 297 | addAttributesIfNotNull(result, containedAttributes);
|
|
0 commit comments