You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/04/21 10:00:46 UTC

[GitHub] [dubbo-spi-extensions] KeRan213539 commented on a change in pull request #24: Do not get dubbo ProviderConfig config when ServiceConfig not set group

KeRan213539 commented on a change in pull request #24:
URL: https://github.com/apache/dubbo-spi-extensions/pull/24#discussion_r617382451



##########
File path: dubbo-api-docs/dubbo-api-docs-core/src/main/java/org/apache/dubbo/apidocs/core/DubboApiDocsAnnotationScanner.java
##########
@@ -132,8 +137,10 @@ public void onApplicationEvent(ApplicationReadyEvent applicationReadyEvent) {
                 apiVersion = dubboService.version();
                 apiGroup = dubboService.group();
             }
-            apiVersion = applicationContext.getEnvironment().resolvePlaceholders(apiVersion);
-            apiGroup = applicationContext.getEnvironment().resolvePlaceholders(apiGroup);
+
+            apiVersion = applicationContext.getEnvironment().resolvePlaceholders(providerConfig == null ? apiVersion : defaultIfBlank(apiVersion, defaultIfBlank(providerConfig.getVersion(), "")) );
+            apiGroup = applicationContext.getEnvironment().resolvePlaceholders(providerConfig == null ? apiGroup : defaultIfBlank(apiGroup, defaultIfBlank(providerConfig.getGroup(), "")) );
+

Review comment:
       These two lines of logic are too complicated. Split them up




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org