From 8158b6fd8605a9f19b999ac93fa04ed7dbf329df Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Thu, 2 May 2019 17:28:11 +0200 Subject: [PATCH] Update postProcessBeforeInstantiation comment on factory methods Closes gh-22867 --- .../config/InstantiationAwareBeanPostProcessor.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java index e9ba8b46f85..c4e21122ed8 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/config/InstantiationAwareBeanPostProcessor.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2018 the original author or authors. + * Copyright 2002-2019 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. @@ -54,8 +54,9 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor { * will be short-circuited. The only further processing applied is the * {@link #postProcessAfterInitialization} callback from the configured * {@link BeanPostProcessor BeanPostProcessors}. - *

This callback will only be applied to bean definitions with a bean class. - * In particular, it will not be applied to beans with a factory method. + *

This callback will be applied to bean definitions with their bean class, + * as well as to factory-method definitions in which case the returned bean type + * will be passed in here. *

Post-processors may implement the extended * {@link SmartInstantiationAwareBeanPostProcessor} interface in order * to predict the type of the bean object that they are going to return here. @@ -66,7 +67,8 @@ public interface InstantiationAwareBeanPostProcessor extends BeanPostProcessor { * or {@code null} to proceed with default instantiation * @throws org.springframework.beans.BeansException in case of errors * @see #postProcessAfterInstantiation - * @see org.springframework.beans.factory.support.AbstractBeanDefinition#hasBeanClass + * @see org.springframework.beans.factory.support.AbstractBeanDefinition#getBeanClass() + * @see org.springframework.beans.factory.support.AbstractBeanDefinition#getFactoryMethodName() */ @Nullable default Object postProcessBeforeInstantiation(Class beanClass, String beanName) throws BeansException {