Merge branch '2.6.x' into 2.7.x

Closes gh-31801
pull/32861/head
Stephane Nicoll 2 years ago
commit 6469a02c35

@ -105,7 +105,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
@Override @Override
protected Set<String> getExclusions(AnnotationMetadata metadata, AnnotationAttributes attributes) { protected Set<String> getExclusions(AnnotationMetadata metadata, AnnotationAttributes attributes) {
Set<String> exclusions = new LinkedHashSet<>(); Set<String> exclusions = new LinkedHashSet<>();
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), null); Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), getBeanClassLoader());
for (String annotationName : ANNOTATION_NAMES) { for (String annotationName : ANNOTATION_NAMES) {
AnnotationAttributes merged = AnnotatedElementUtils.getMergedAnnotationAttributes(source, annotationName); AnnotationAttributes merged = AnnotatedElementUtils.getMergedAnnotationAttributes(source, annotationName);
Class<?>[] exclude = (merged != null) ? merged.getClassArray("exclude") : null; Class<?>[] exclude = (merged != null) ? merged.getClassArray("exclude") : null;
@ -129,7 +129,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
protected final Map<Class<?>, List<Annotation>> getAnnotations(AnnotationMetadata metadata) { protected final Map<Class<?>, List<Annotation>> getAnnotations(AnnotationMetadata metadata) {
MultiValueMap<Class<?>, Annotation> annotations = new LinkedMultiValueMap<>(); MultiValueMap<Class<?>, Annotation> annotations = new LinkedMultiValueMap<>();
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), null); Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), getBeanClassLoader());
collectAnnotations(source, annotations, new HashSet<>()); collectAnnotations(source, annotations, new HashSet<>());
return Collections.unmodifiableMap(annotations); return Collections.unmodifiableMap(annotations);
} }

Loading…
Cancel
Save