mirror of
https://github.com/spring-projects/spring-boot.git
synced 2024-09-03 04:26:12 +08:00
Use Bean ClassLoader consistently to resolve class names
See gh-31798
This commit is contained in:
parent
ac65835103
commit
abe938eb2c
@ -100,7 +100,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
|
||||
@Override
|
||||
protected Set<String> getExclusions(AnnotationMetadata metadata, AnnotationAttributes attributes) {
|
||||
Set<String> exclusions = new LinkedHashSet<>();
|
||||
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), null);
|
||||
Class<?> source = ClassUtils.resolveClassName(metadata.getClassName(), getBeanClassLoader());
|
||||
for (String annotationName : ANNOTATION_NAMES) {
|
||||
AnnotationAttributes merged = AnnotatedElementUtils.getMergedAnnotationAttributes(source, annotationName);
|
||||
Class<?>[] exclude = (merged != null) ? merged.getClassArray("exclude") : null;
|
||||
@ -124,7 +124,7 @@ class ImportAutoConfigurationImportSelector extends AutoConfigurationImportSelec
|
||||
|
||||
protected final Map<Class<?>, List<Annotation>> getAnnotations(AnnotationMetadata metadata) {
|
||||
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<>());
|
||||
return Collections.unmodifiableMap(annotations);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user