|
1 | 1 | /*
|
2 |
| - * Copyright 2013-2018 the original author or authors. |
| 2 | + * Copyright 2013-2021 the original author or authors. |
3 | 3 | *
|
4 | 4 | * Licensed under the Apache License, Version 2.0 (the "License");
|
5 | 5 | * you may not use this file except in compliance with the License.
|
|
46 | 46 | import org.springframework.beans.factory.annotation.Value;
|
47 | 47 | import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
|
48 | 48 | import org.springframework.beans.factory.config.DependencyDescriptor;
|
49 |
| -import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter; |
50 | 49 | import org.springframework.beans.factory.config.RuntimeBeanReference;
|
| 50 | +import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor; |
51 | 51 | import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
|
52 | 52 | import org.springframework.beans.factory.support.RootBeanDefinition;
|
53 | 53 | import org.springframework.core.BridgeMethodResolver;
|
54 |
| -import org.springframework.core.GenericTypeResolver; |
55 | 54 | import org.springframework.core.MethodParameter;
|
56 | 55 | import org.springframework.core.Ordered;
|
57 | 56 | import org.springframework.core.PriorityOrdered;
|
|
73 | 72 | * <li>findAutowiredAnnotation(AccessibleObject ao)</li>
|
74 | 73 | * </ul>
|
75 | 74 | */
|
76 |
| -class SpringAutowiredAnnotationBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter |
77 |
| - implements MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware { |
| 75 | +class SpringAutowiredAnnotationBeanPostProcessor implements SmartInstantiationAwareBeanPostProcessor, |
| 76 | + MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware { |
78 | 77 |
|
79 | 78 | protected final Log logger = LogFactory.getLog(getClass());
|
80 | 79 |
|
@@ -539,8 +538,7 @@ protected void inject(Object bean, String beanName, PropertyValues pvs) throws T
|
539 | 538 | Set<String> autowiredBeanNames = new LinkedHashSet<>(paramTypes.length);
|
540 | 539 | TypeConverter typeConverter = beanFactory.getTypeConverter();
|
541 | 540 | for (int i = 0; i < arguments.length; i++) {
|
542 |
| - MethodParameter methodParam = new MethodParameter(method, i); |
543 |
| - GenericTypeResolver.resolveParameterType(methodParam, bean.getClass()); |
| 541 | + MethodParameter methodParam = new MethodParameter(method, i).withContainingClass(bean.getClass()); |
544 | 542 | descriptors[i] = new DependencyDescriptor(methodParam, this.required);
|
545 | 543 | arguments[i] = beanFactory.resolveDependency(
|
546 | 544 | descriptors[i], beanName, autowiredBeanNames, typeConverter);
|
|
0 commit comments