Replaces deprecated interfaces

Replaces the deprecated
- type InstantiationAwareBeanPostProcessorAdapter
- type GenericTypeResolver
- method StringUtils::isEmpty
- field BigDecimal::ROUND_HALF_UP

Issue #3838
This commit is contained in:
Henning Pöttker
2021-08-10 00:31:45 +02:00
committed by Mahmoud Ben Hassine
parent b9790d11ba
commit 64c09c523e
3 changed files with 11 additions and 12 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2013-2018 the original author or authors.
* Copyright 2013-2021 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,12 +46,11 @@ import org.springframework.beans.factory.annotation.InjectionMetadata;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.beans.factory.config.ConfigurableListableBeanFactory;
import org.springframework.beans.factory.config.DependencyDescriptor;
import org.springframework.beans.factory.config.InstantiationAwareBeanPostProcessorAdapter;
import org.springframework.beans.factory.config.RuntimeBeanReference;
import org.springframework.beans.factory.config.SmartInstantiationAwareBeanPostProcessor;
import org.springframework.beans.factory.support.MergedBeanDefinitionPostProcessor;
import org.springframework.beans.factory.support.RootBeanDefinition;
import org.springframework.core.BridgeMethodResolver;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter;
import org.springframework.core.Ordered;
import org.springframework.core.PriorityOrdered;
@@ -73,8 +72,8 @@ import org.springframework.util.ReflectionUtils;
* <li>findAutowiredAnnotation(AccessibleObject ao)</li>
* </ul>
*/
class SpringAutowiredAnnotationBeanPostProcessor extends InstantiationAwareBeanPostProcessorAdapter
implements MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware {
class SpringAutowiredAnnotationBeanPostProcessor implements SmartInstantiationAwareBeanPostProcessor,
MergedBeanDefinitionPostProcessor, PriorityOrdered, BeanFactoryAware {
protected final Log logger = LogFactory.getLog(getClass());
@@ -539,8 +538,7 @@ class SpringAutowiredAnnotationBeanPostProcessor extends InstantiationAwareBeanP
Set<String> autowiredBeanNames = new LinkedHashSet<>(paramTypes.length);
TypeConverter typeConverter = beanFactory.getTypeConverter();
for (int i = 0; i < arguments.length; i++) {
MethodParameter methodParam = new MethodParameter(method, i);
GenericTypeResolver.resolveParameterType(methodParam, bean.getClass());
MethodParameter methodParam = new MethodParameter(method, i).withContainingClass(bean.getClass());
descriptors[i] = new DependencyDescriptor(methodParam, this.required);
arguments[i] = beanFactory.resolveDependency(
descriptors[i], beanName, autowiredBeanNames, typeConverter);