}
else {
Set<String> autowiredBeanNames = new LinkedHashSet<String>(4);
TypeConverter typeConverter = beanFactory.getTypeConverter();
argument = beanFactory.resolveDependency(
new DependencyDescriptor(field, this.required),
beanName, autowiredBeanNames, typeConverter);
registerDependentBeans(beanName, autowiredBeanNames);
if (autowiredBeanNames.size() == 1) {
this.beanNameForField = autowiredBeanNames.iterator().next();
}
}
if (argument != null) {
ReflectionUtils.makeAccessible(field);
field.set(bean, argument);
}
}
catch (Throwable ex) {
throw new BeanCreationException("Could not autowire field: " + field, ex);
}
}
else {
if (this.pd != null && pvs != null && pvs.contains(this.pd.getName())) {
// Explicit value provided as part of the bean definition.
this.skip = true;
return;
}
Method method = (Method) this.member;
Object[] arguments = new Object[method.getParameterTypes().length];
try {
String[] determinedBeanNames = this.beanNamesForMethod;
if (determinedBeanNames != null) {
for (int i = 0; i < determinedBeanNames.length; i++) {
arguments[i] = beanFactory.getBean(determinedBeanNames[i]);
}
}
else {
Set<String> autowiredBeanNames = new LinkedHashSet<String>(4);
TypeConverter typeConverter = beanFactory.getTypeConverter();
for (int i = 0; i < arguments.length; i++) {
arguments[i] = beanFactory.resolveDependency(
new DependencyDescriptor(new MethodParameter(method, i), this.required),
beanName, autowiredBeanNames, typeConverter);
if (arguments[i] == null) {
arguments = null;
break;
}