Skip to content

Commit 0a06bce

Browse files
committed
Relaxed BeanFactory assertion in resolveInterceptorNames
Issue: SPR-16347
1 parent 977550f commit 0a06bce

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

spring-aop/src/main/java/org/springframework/aop/framework/autoproxy/AbstractAutoProxyCreator.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2017 the original author or authors.
2+
* Copyright 2002-2018 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -544,13 +544,13 @@ protected Advisor[] buildAdvisors(@Nullable String beanName, @Nullable Object[]
544544
* @see #setInterceptorNames
545545
*/
546546
private Advisor[] resolveInterceptorNames() {
547-
Assert.state(this.beanFactory != null, "BeanFactory required for resolving interceptor names");
548-
ConfigurableBeanFactory cbf = (this.beanFactory instanceof ConfigurableBeanFactory ?
549-
(ConfigurableBeanFactory) this.beanFactory : null);
547+
BeanFactory bf = this.beanFactory;
548+
ConfigurableBeanFactory cbf = (bf instanceof ConfigurableBeanFactory ? (ConfigurableBeanFactory) bf : null);
550549
List<Advisor> advisors = new ArrayList<>();
551550
for (String beanName : this.interceptorNames) {
552551
if (cbf == null || !cbf.isCurrentlyInCreation(beanName)) {
553-
Object next = this.beanFactory.getBean(beanName);
552+
Assert.state(bf != null, "BeanFactory required for resolving interceptor names");
553+
Object next = bf.getBean(beanName);
554554
advisors.add(this.advisorAdapterRegistry.wrap(next));
555555
}
556556
}

0 commit comments

Comments
 (0)