diff --git a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java index 2b66fb1e95bf..66dfc60f4edc 100644 --- a/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java +++ b/dubbo-registry/dubbo-registry-nacos/src/main/java/org/apache/dubbo/registry/nacos/NacosRegistryFactory.java @@ -24,7 +24,6 @@ import com.alibaba.nacos.api.NacosFactory; import com.alibaba.nacos.api.exception.NacosException; import com.alibaba.nacos.api.naming.NamingService; -import com.alibaba.nacos.client.naming.utils.StringUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -101,7 +100,7 @@ private void setProperties(URL url, Properties properties) { private void putPropertyIfAbsent(URL url, Properties properties, String propertyName) { String propertyValue = url.getParameter(propertyName); - if (StringUtils.isNotEmpty(propertyValue)) { + if (propertyValue != null && propertyValue.trim().length() != 0) { properties.setProperty(propertyName, propertyValue); } }