From 78ba9462668dd4d1b7ea1bccee797e4f826058c2 Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 1 Feb 2023 18:18:37 +0100 Subject: [PATCH] Clarify postProcessBeanFactory lifecycle state Closes gh-29064 (cherry picked from commit b8827d8e11f2b5e3a3c2465616deace388b358d1) --- .../context/support/AbstractApplicationContext.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java b/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java index 38243b1794..56e202a4a9 100644 --- a/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java +++ b/spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2023 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -729,9 +729,11 @@ public abstract class AbstractApplicationContext extends DefaultResourceLoader /** * Modify the application context's internal bean factory after its standard - * initialization. All bean definitions will have been loaded, but no beans - * will have been instantiated yet. This allows for registering special - * BeanPostProcessors etc in certain ApplicationContext implementations. + * initialization. The initial definition resources will have been loaded but no + * post-processors will have run and no derived bean definitions will have been + * registered, and most importantly, no beans will have been instantiated yet. + *

This template method allows for registering special BeanPostProcessors + * etc in certain AbstractApplicationContext subclasses. * @param beanFactory the bean factory used by the application context */ protected void postProcessBeanFactory(ConfigurableListableBeanFactory beanFactory) {