if (factoryMethodToUse == null) {
Method[] candidates = ReflectionUtils.getAllDeclaredMethods(factoryClass);
boolean autowiring = (mbd.getResolvedAutowireMode() == RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
int minTypeDiffWeight = Integer.MAX_VALUE;
ConstructorArgumentValues resolvedValues = null;
<BUG>int minNrOfArgs = 0;
if (explicitArgs != null) {</BUG>
minNrOfArgs = explicitArgs.length;
}
else {

if (factoryMethodToUse == null) {
Method[] candidates = ReflectionUtils.getAllDeclaredMethods(factoryClass);
boolean autowiring = (mbd.getResolvedAutowireMode() == RootBeanDefinition.AUTOWIRE_CONSTRUCTOR);
int minTypeDiffWeight = Integer.MAX_VALUE;
ConstructorArgumentValues resolvedValues = null;
int minNrOfArgs;
if (explicitArgs != null) {
minNrOfArgs = explicitArgs.length;
}
else {
