From b8827d8e11f2b5e3a3c2465616deace388b358d1 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 --- .../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 3fa935249c..347415b820 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-2022 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. @@ -728,9 +728,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) {