File tree 1 file changed +7
-0
lines changed
spring-context/src/main/java/org/springframework/context/support
1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -679,6 +679,13 @@ protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactor
679
679
*/
680
680
protected void invokeBeanFactoryPostProcessors (ConfigurableListableBeanFactory beanFactory ) {
681
681
PostProcessorRegistrationDelegate .invokeBeanFactoryPostProcessors (beanFactory , getBeanFactoryPostProcessors ());
682
+
683
+ // Detect a LoadTimeWeaver and prepare for weaving, if found in the meantime
684
+ // (e.g. through an @Bean method registered by ConfigurationClassPostProcessor)
685
+ if (beanFactory .getTempClassLoader () == null && beanFactory .containsBean (LOAD_TIME_WEAVER_BEAN_NAME )) {
686
+ beanFactory .addBeanPostProcessor (new LoadTimeWeaverAwareProcessor (beanFactory ));
687
+ beanFactory .setTempClassLoader (new ContextTypeMatchClassLoader (beanFactory .getBeanClassLoader ()));
688
+ }
682
689
}
683
690
684
691
/**
You can’t perform that action at this time.
0 commit comments