Browse Source

Polish

pull/28922/head
Stephane Nicoll 2 years ago
parent
commit
e79a8f6733
  1. 18
      spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertiesCodeGenerator.java

18
spring-beans/src/main/java/org/springframework/beans/factory/aot/BeanDefinitionPropertiesCodeGenerator.java

@ -107,7 +107,7 @@ class BeanDefinitionPropertiesCodeGenerator { @@ -107,7 +107,7 @@ class BeanDefinitionPropertiesCodeGenerator {
}
CodeBlock generateCode(BeanDefinition beanDefinition) {
CodeBlock generateCode(RootBeanDefinition beanDefinition) {
CodeBlock.Builder builder = CodeBlock.builder();
addStatementForValue(builder, beanDefinition, BeanDefinition::isPrimary,
"$L.setPrimary($L)");
@ -119,18 +119,14 @@ class BeanDefinitionPropertiesCodeGenerator { @@ -119,18 +119,14 @@ class BeanDefinitionPropertiesCodeGenerator {
"$L.setAutowireCandidate($L)");
addStatementForValue(builder, beanDefinition, BeanDefinition::getRole,
this::hasRole, "$L.setRole($L)", this::toRole);
if (beanDefinition instanceof AbstractBeanDefinition abstractBeanDefinition) {
addStatementForValue(builder, beanDefinition,
AbstractBeanDefinition::getLazyInit, "$L.setLazyInit($L)");
addStatementForValue(builder, beanDefinition,
AbstractBeanDefinition::isSynthetic, "$L.setSynthetic($L)");
addInitDestroyMethods(builder, abstractBeanDefinition,
abstractBeanDefinition.getInitMethodNames(),
addStatementForValue(builder, beanDefinition, AbstractBeanDefinition::getLazyInit,
"$L.setLazyInit($L)");
addStatementForValue(builder, beanDefinition, AbstractBeanDefinition::isSynthetic,
"$L.setSynthetic($L)");
addInitDestroyMethods(builder, beanDefinition, beanDefinition.getInitMethodNames(),
"$L.setInitMethodNames($L)");
addInitDestroyMethods(builder, abstractBeanDefinition,
abstractBeanDefinition.getDestroyMethodNames(),
addInitDestroyMethods(builder, beanDefinition, beanDefinition.getDestroyMethodNames(),
"$L.setDestroyMethodNames($L)");
}
addConstructorArgumentValues(builder, beanDefinition);
addPropertyValues(builder, beanDefinition);
addAttributes(builder, beanDefinition);

Loading…
Cancel
Save