提交 49593f53 编写于 作者: J Juergen Hoeller

Revise DependencyDescriptor etc to avoid MethodParameter deprecations

See gh-23385
上级 b67dbe66
......@@ -102,8 +102,7 @@ final class GenericTypeAwarePropertyDescriptor extends PropertyDescriptor {
this.ambiguousWriteMethods = ambiguousCandidates;
}
}
this.writeMethodParameter = new MethodParameter(this.writeMethod, 0);
GenericTypeResolver.resolveParameterType(this.writeMethodParameter, this.beanClass);
this.writeMethodParameter = new MethodParameter(this.writeMethod, 0).withContainingClass(this.beanClass);
}
if (this.readMethod != null) {
......
......@@ -33,7 +33,6 @@ import org.springframework.beans.BeansException;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.InjectionPoint;
import org.springframework.beans.factory.NoUniqueBeanDefinitionException;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.KotlinDetector;
import org.springframework.core.MethodParameter;
import org.springframework.core.ParameterNameDiscoverer;
......@@ -280,13 +279,12 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
/**
* Increase this descriptor's nesting level.
* @see MethodParameter#increaseNestingLevel()
*/
public void increaseNestingLevel() {
this.nestingLevel++;
this.resolvableType = null;
if (this.methodParameter != null) {
this.methodParameter.increaseNestingLevel();
this.methodParameter = this.methodParameter.nested();
}
}
......@@ -300,7 +298,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
this.containingClass = containingClass;
this.resolvableType = null;
if (this.methodParameter != null) {
GenericTypeResolver.resolveParameterType(this.methodParameter, containingClass);
this.methodParameter = this.methodParameter.withContainingClass(containingClass);
}
}
......@@ -457,7 +455,7 @@ public class DependencyDescriptor extends InjectionPoint implements Serializable
this.declaringClass.getDeclaredConstructor(this.parameterTypes), this.parameterIndex);
}
for (int i = 1; i < this.nestingLevel; i++) {
this.methodParameter.increaseNestingLevel();
this.methodParameter = this.methodParameter.nested();
}
}
}
......
......@@ -53,7 +53,6 @@ import org.springframework.beans.factory.config.ConstructorArgumentValues;
import org.springframework.beans.factory.config.ConstructorArgumentValues.ValueHolder;
import org.springframework.beans.factory.config.DependencyDescriptor;
import org.springframework.core.CollectionFactory;
import org.springframework.core.GenericTypeResolver;
import org.springframework.core.MethodParameter;
import org.springframework.core.NamedThreadLocal;
import org.springframework.core.ParameterNameDiscoverer;
......@@ -810,7 +809,6 @@ class ConstructorResolver {
for (int argIndex = 0; argIndex < argsToResolve.length; argIndex++) {
Object argValue = argsToResolve[argIndex];
MethodParameter methodParam = MethodParameter.forExecutable(executable, argIndex);
GenericTypeResolver.resolveParameterType(methodParam, executable.getDeclaringClass());
if (argValue instanceof AutowiredArgumentMarker) {
argValue = resolveAutowiredArgument(methodParam, beanName, null, converter, fallback);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册