This commit is contained in:
Stéphane Nicoll 2023-10-21 12:59:48 +02:00
parent dab7e03c93
commit cf10cee16a
2 changed files with 4 additions and 7 deletions

View File

@ -1046,12 +1046,9 @@ public class AutowiredAnnotationBeanPostProcessor implements SmartInstantiationA
}
private CodeBlock generateParameterTypesCode(Class<?>[] parameterTypes) {
CodeBlock.Builder code = CodeBlock.builder();
for (int i = 0; i < parameterTypes.length; i++) {
code.add((i != 0 ? ", " : ""));
code.add("$T.class", parameterTypes[i]);
}
return code.build();
return CodeBlock.join(Arrays.stream(parameterTypes)
.map(parameterType -> CodeBlock.of("$T.class", parameterType))
.toList(), ", ");
}
private void registerHints(RuntimeHints runtimeHints) {

View File

@ -235,7 +235,7 @@ class DefaultBeanRegistrationCodeFragments implements BeanRegistrationCodeFragme
}
return new InstanceSupplierCodeGenerator(generationContext,
beanRegistrationCode.getClassName(), beanRegistrationCode.getMethods(), allowDirectSupplierShortcut)
.generateCode(this.registeredBean,this.constructorOrFactoryMethod.get());
.generateCode(this.registeredBean, this.constructorOrFactoryMethod.get());
}
@Override