You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@dubbo.apache.org by GitBox <gi...@apache.org> on 2018/04/08 10:10:11 UTC

[GitHub] bearDream closed pull request #1555: SerivceAnnotationBeanPostProcessor bug and replace ServiceConfig vars by Constants.

bearDream closed pull request #1555: SerivceAnnotationBeanPostProcessor bug and replace ServiceConfig vars by Constants.
URL: https://github.com/apache/incubator-dubbo/pull/1555
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
index 853ece2eaa..39e00a9269 100644
--- a/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
+++ b/dubbo-config/dubbo-config-api/src/main/java/com/alibaba/dubbo/config/ServiceConfig.java
@@ -433,8 +433,8 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
         }
 
         if (ProtocolUtils.isGeneric(generic)) {
-            map.put("generic", generic);
-            map.put("methods", Constants.ANY_VALUE);
+            map.put(Constants.GENERIC_KEY, generic);
+            map.put(Constants.METHODS_KEY, Constants.ANY_VALUE);
         } else {
             String revision = Version.getVersion(interfaceClass, version);
             if (revision != null && revision.length() > 0) {
@@ -444,19 +444,19 @@ private void doExportUrlsFor1Protocol(ProtocolConfig protocolConfig, List<URL> r
             String[] methods = Wrapper.getWrapper(interfaceClass).getMethodNames();
             if (methods.length == 0) {
                 logger.warn("NO method found in service interface " + interfaceClass.getName());
-                map.put("methods", Constants.ANY_VALUE);
+                map.put(Constants.METHODS_KEY, Constants.ANY_VALUE);
             } else {
-                map.put("methods", StringUtils.join(new HashSet<String>(Arrays.asList(methods)), ","));
+                map.put(Constants.METHODS_KEY, StringUtils.join(new HashSet<String>(Arrays.asList(methods)), ","));
             }
         }
         if (!ConfigUtils.isEmpty(token)) {
             if (ConfigUtils.isDefault(token)) {
-                map.put("token", UUID.randomUUID().toString());
+                map.put(Constants.TOKEN_KEY, UUID.randomUUID().toString());
             } else {
-                map.put("token", token);
+                map.put(Constants.TOKEN_KEY, token);
             }
         }
-        if ("injvm".equals(protocolConfig.getName())) {
+        if (Constants.LOCAL_PROTOCOL.equals(protocolConfig.getName())) {
             protocolConfig.setRegister(false);
             map.put("notify", "false");
         }
@@ -769,7 +769,7 @@ public String getPath() {
     }
 
     public void setPath(String path) {
-        checkPathName("path", path);
+        checkPathName(Constants.PATH_KEY, path);
         this.path = path;
     }
 
diff --git a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
index 1d273451bf..850b3c9520 100644
--- a/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
+++ b/dubbo-config/dubbo-config-spring/src/main/java/com/alibaba/dubbo/config/spring/beans/factory/annotation/ServiceAnnotationBeanPostProcessor.java
@@ -413,7 +413,7 @@ private AbstractBeanDefinition buildServiceBeanDefinition(Service service, Class
 
         List<RuntimeBeanReference> protocolRuntimeBeanReferences = toRuntimeBeanReferences(protocolConfigBeanNames);
 
-        if (!registryRuntimeBeanReferences.isEmpty()) {
+        if (!protocolRuntimeBeanReferences.isEmpty()) {
             builder.addPropertyValue("protocols", protocolRuntimeBeanReferences);
         }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on 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


With regards,
Apache Git Services