Skip to content

Commit ce43d1b

Browse files
committed
Simplify logic in ApplicationContextAwareProcessor.postProcessBeforeInitialization()
1 parent dc73ec7 commit ce43d1b

File tree

1 file changed

+2
-7
lines changed

1 file changed

+2
-7
lines changed

spring-context/src/main/java/org/springframework/context/support/ApplicationContextAwareProcessor.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -81,14 +81,9 @@ public ApplicationContextAwareProcessor(ConfigurableApplicationContext applicati
8181
@Override
8282
@Nullable
8383
public Object postProcessBeforeInitialization(Object bean, String beanName) throws BeansException {
84-
if (!((bean instanceof Aware) && (bean instanceof EnvironmentAware || bean instanceof EmbeddedValueResolverAware ||
85-
bean instanceof ResourceLoaderAware || bean instanceof ApplicationEventPublisherAware ||
86-
bean instanceof MessageSourceAware || bean instanceof ApplicationStartupAware ||
87-
bean instanceof ApplicationContextAware))) {
88-
return bean;
84+
if (bean instanceof Aware) {
85+
invokeAwareInterfaces(bean);
8986
}
90-
91-
invokeAwareInterfaces(bean);
9287
return bean;
9388
}
9489

0 commit comments

Comments
 (0)