Skip to content

Commit 1296ff8

Browse files
authored
[master] Optimize some code for DubboConfigEarlyRegistrationPostProcessor (#9397) (#9414)
1 parent c0b7f95 commit 1296ff8

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

dubbo-config/dubbo-config-spring/src/main/java/org/apache/dubbo/config/spring/beans/factory/config/DubboConfigEarlyRegistrationPostProcessor.java

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,8 @@ private DefaultListableBeanFactory unwrap(Object registry) {
102102

103103
class DubboConfigEarlyInitializationPostProcessor extends GenericBeanPostProcessorAdapter<AbstractConfig> {
104104

105+
private boolean registeredCommonAnnotationBeanPostProcessor = false;
106+
105107
protected void processBeforeInitialization(AbstractConfig config, String beanName) throws BeansException {
106108
if (beanFactory == null) {
107109
if (logger.isErrorEnabled()) {
@@ -127,8 +129,12 @@ protected void processBeforeInitialization(AbstractConfig config, String beanNam
127129
* @return if registered, return <code>true</code>, or <code>false</code>
128130
*/
129131
private boolean hasRegisteredCommonAnnotationBeanPostProcessor() {
132+
if (registeredCommonAnnotationBeanPostProcessor) {
133+
return true;
134+
}
130135
for (BeanPostProcessor beanPostProcessor : beanFactory.getBeanPostProcessors()) {
131136
if (CommonAnnotationBeanPostProcessor.class.equals(beanPostProcessor.getClass())) {
137+
this.registeredCommonAnnotationBeanPostProcessor = true;
132138
return true;
133139
}
134140
}

0 commit comments

Comments
 (0)