Skip to content

Commit

Permalink
Fix custom bean definition to stop using reflection
Browse files Browse the repository at this point in the history
  • Loading branch information
snicoll committed Aug 3, 2022
1 parent 903e9f2 commit 3a89003
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -568,8 +568,8 @@ private CodeBlock generateAddPostProcessorCode(Map<String, String> mappings) {
MAPPINGS_VARIABLE, type, from));
builder.addStatement("$T $L = new $T($T.class)", RootBeanDefinition.class,
BEAN_DEFINITION_VARIABLE, RootBeanDefinition.class, ImportAwareAotBeanPostProcessor.class);
builder.addStatement("$L.getConstructorArgumentValues().addIndexedArgumentValue(0, $L)",
BEAN_DEFINITION_VARIABLE, MAPPINGS_VARIABLE);
builder.addStatement("$L.setInstanceSupplier(() -> new $T($L))",
BEAN_DEFINITION_VARIABLE, ImportAwareAotBeanPostProcessor.class, MAPPINGS_VARIABLE);
builder.addStatement("$L.registerBeanDefinition($S, $L)",
BEAN_FACTORY_VARIABLE, BEAN_NAME, BEAN_DEFINITION_VARIABLE);
return builder.build();
Expand Down

0 comments on commit 3a89003

Please sign in to comment.