Simplify logic in ApplicationContextAwareProcessor.postProcessBeforeInitialization()

This commit is contained in:
Sam Brannen 2024-02-10 15:46:38 +01:00
parent dc73ec76fc
commit ce43d1b1da
1 changed files with 2 additions and 7 deletions

View File

@ -81,14 +81,9 @@ class ApplicationContextAwareProcessor implements BeanPostProcessor {
@Override
@Nullable
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
if (!((bean instanceof Aware) && (bean instanceof EnvironmentAware || bean instanceof EmbeddedValueResolverAware ||
bean instanceof ResourceLoaderAware || bean instanceof ApplicationEventPublisherAware ||
bean instanceof MessageSourceAware || bean instanceof ApplicationStartupAware ||
bean instanceof ApplicationContextAware))) {
return bean;
if (bean instanceof Aware) {
invokeAwareInterfaces(bean);
}
invokeAwareInterfaces(bean);
return bean;
}