diff --git a/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java b/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java index 2446ab96e67..1da55ce8fe5 100644 --- a/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java +++ b/spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java @@ -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; }