You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by me...@apache.org on 2018/11/30 02:38:00 UTC

[incubator-dubbo-spring-boot-project] branch master updated: Avoid inserting dubbo's properties whose values are not Strings (#272)

This is an automated email from the ASF dual-hosted git repository.

mercyblitz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-dubbo-spring-boot-project.git


The following commit(s) were added to refs/heads/master by this push:
     new c637281   Avoid inserting dubbo's properties whose values are not Strings (#272)
c637281 is described below

commit c637281b95aaa07ec7ed59e97c4006ba2135baf1
Author: Aunus <xl...@gmail.com>
AuthorDate: Thu Nov 29 20:37:56 2018 -0600

     Avoid inserting dubbo's properties whose values are not Strings (#272)
    
    * 避免Properties类中插入非String的类型,导致非String值无法读取到dubbo配置中。
    
    * 避免Properties类中插入非String的类型,导致非String值无法读取到dubbo配置中。
    
    * Avoid inserting dubbo's properties whose values are not Strings
---
 .../src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java     | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java
index 7114844..edf4ab2 100644
--- a/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java
+++ b/dubbo-spring-boot-autoconfigure/src/main/java/com/alibaba/boot/dubbo/util/DubboUtils.java
@@ -16,12 +16,11 @@
  */
 package com.alibaba.boot.dubbo.util;
 
-import org.springframework.core.env.ConfigurableEnvironment;
-
 import java.util.Collections;
 import java.util.Map;
 import java.util.SortedMap;
 import java.util.TreeMap;
+import org.springframework.core.env.ConfigurableEnvironment;
 
 /**
  * The utilities class for Dubbo
@@ -129,8 +128,9 @@ public abstract class DubboUtils {
         for (Map.Entry<String, Object> entry : properties.entrySet()) {
             String propertyName = entry.getKey();
 
-            if (propertyName.startsWith(DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR)) {
-                dubboProperties.put(propertyName, entry.getValue());
+            if (propertyName.startsWith(DUBBO_PREFIX + PROPERTY_NAME_SEPARATOR)
+                && entry.getValue() != null) {
+                dubboProperties.put(propertyName, entry.getValue().toString());
             }
 
         }