We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
类路径:com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor 方法: private Class resolveInjectedType(Object bean, Field field) { Type genericType = field.getGenericType(); if (genericType instanceof Class) { // Just a normal Class return field.getType(); } else { // GenericType return resolveTypeArgument(getTargetClass(bean), field.getDeclaringClass()); } } @nullable public static Class resolveTypeArgument(Class clazz, Class genericIfc) { ResolvableType resolvableType = ResolvableType.forClass(clazz).as(genericIfc); if (!resolvableType.hasGenerics()) { return null; } return getSingleGeneric(resolvableType); } resolveTypeArgument 遇到一个类有多个参数的时候,会导致报错; 建议resolveInjectedType返回类型为List<Class<?>> ,便于多个参数的情况下可以正常装到容器
The text was updated successfully, but these errors were encountered:
No branches or pull requests
类路径:com.alibaba.spring.beans.factory.annotation.AbstractAnnotationBeanPostProcessor
方法:
private Class resolveInjectedType(Object bean, Field field) { Type genericType = field.getGenericType(); if (genericType instanceof Class) { // Just a normal Class return field.getType(); } else { // GenericType return resolveTypeArgument(getTargetClass(bean), field.getDeclaringClass()); } } @nullable public static Class resolveTypeArgument(Class clazz, Class genericIfc) {
ResolvableType resolvableType = ResolvableType.forClass(clazz).as(genericIfc);
if (!resolvableType.hasGenerics()) {
return null;
}
return getSingleGeneric(resolvableType);
}
resolveTypeArgument 遇到一个类有多个参数的时候,会导致报错;
建议resolveInjectedType返回类型为List<Class<?>> ,便于多个参数的情况下可以正常装到容器
The text was updated successfully, but these errors were encountered: