Skip to content

Commit

Permalink
[master] Optimize some code for DubboConfigEarlyRegistrationPostProce…
Browse files Browse the repository at this point in the history
…ssor (#9397) (#9414)
  • Loading branch information
gitchenjh committed Dec 16, 2021
1 parent c0b7f95 commit 1296ff8
Showing 1 changed file with 6 additions and 0 deletions.
Expand Up @@ -102,6 +102,8 @@ private DefaultListableBeanFactory unwrap(Object registry) {

class DubboConfigEarlyInitializationPostProcessor extends GenericBeanPostProcessorAdapter<AbstractConfig> {

private boolean registeredCommonAnnotationBeanPostProcessor = false;

protected void processBeforeInitialization(AbstractConfig config, String beanName) throws BeansException {
if (beanFactory == null) {
if (logger.isErrorEnabled()) {
Expand All @@ -127,8 +129,12 @@ protected void processBeforeInitialization(AbstractConfig config, String beanNam
* @return if registered, return <code>true</code>, or <code>false</code>
*/
private boolean hasRegisteredCommonAnnotationBeanPostProcessor() {
if (registeredCommonAnnotationBeanPostProcessor) {
return true;
}
for (BeanPostProcessor beanPostProcessor : beanFactory.getBeanPostProcessors()) {
if (CommonAnnotationBeanPostProcessor.class.equals(beanPostProcessor.getClass())) {
this.registeredCommonAnnotationBeanPostProcessor = true;
return true;
}
}
Expand Down

0 comments on commit 1296ff8

Please sign in to comment.