Browse Source

Polish contribution

pull/29521/head
Sam Brannen 3 years ago
parent
commit
cefd74555a
  1. 5
      spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java

5
spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java

@ -1366,8 +1366,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
// Give any InstantiationAwareBeanPostProcessors the opportunity to modify the // Give any InstantiationAwareBeanPostProcessors the opportunity to modify the
// state of the bean before properties are set. This can be used, for example, // state of the bean before properties are set. This can be used, for example,
// to support styles of field injection. // to support styles of field injection.
boolean hasInstAwareBpps = hasInstantiationAwareBeanPostProcessors(); if (!mbd.isSynthetic() && hasInstantiationAwareBeanPostProcessors()) {
if (!mbd.isSynthetic() && hasInstAwareBpps) {
for (InstantiationAwareBeanPostProcessor bp : getBeanPostProcessorCache().instantiationAware) { for (InstantiationAwareBeanPostProcessor bp : getBeanPostProcessorCache().instantiationAware) {
if (!bp.postProcessAfterInstantiation(bw.getWrappedInstance(), beanName)) { if (!bp.postProcessAfterInstantiation(bw.getWrappedInstance(), beanName)) {
return; return;
@ -1390,7 +1389,7 @@ public abstract class AbstractAutowireCapableBeanFactory extends AbstractBeanFac
} }
pvs = newPvs; pvs = newPvs;
} }
if (hasInstAwareBpps) { if (hasInstantiationAwareBeanPostProcessors()) {
if (pvs == null) { if (pvs == null) {
pvs = mbd.getPropertyValues(); pvs = mbd.getPropertyValues();
} }

Loading…
Cancel
Save