mirror of
https://gitee.com/mirrors/Spring-Cloud-Alibaba.git
synced 2021-06-26 13:25:11 +08:00
do some refactor
This commit is contained in:
parent
e4a4e7f288
commit
cef87972d7
@ -22,6 +22,7 @@ import java.util.Properties;
|
|||||||
|
|
||||||
import javax.annotation.PostConstruct;
|
import javax.annotation.PostConstruct;
|
||||||
|
|
||||||
|
import com.alibaba.cloud.nacos.diagnostics.analyzer.NacosConnectionFailureException;
|
||||||
import com.alibaba.nacos.api.NacosFactory;
|
import com.alibaba.nacos.api.NacosFactory;
|
||||||
import com.alibaba.nacos.api.config.ConfigService;
|
import com.alibaba.nacos.api.config.ConfigService;
|
||||||
import com.alibaba.nacos.api.exception.NacosException;
|
import com.alibaba.nacos.api.exception.NacosException;
|
||||||
@ -367,8 +368,8 @@ public class NacosConfigProperties {
|
|||||||
.createConfigService(getConfigServiceProperties());
|
.createConfigService(getConfigServiceProperties());
|
||||||
}
|
}
|
||||||
catch (NacosException e) {
|
catch (NacosException e) {
|
||||||
log.error("create naming service error!properties={},e=,", this, e);
|
throw new NacosConnectionFailureException(this.getServerAddr(),
|
||||||
return null;
|
e.getMessage(), e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return configService;
|
return configService;
|
||||||
|
@ -21,7 +21,7 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import com.alibaba.nacos.client.utils.StringUtils;
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zkz
|
* @author zkz
|
||||||
@ -118,7 +118,7 @@ public abstract class AbstractNacosDataParser {
|
|||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
for (Map.Entry<String, String> entry : map.entrySet()) {
|
for (Map.Entry<String, String> entry : map.entrySet()) {
|
||||||
String key = entry.getKey();
|
String key = entry.getKey();
|
||||||
if (StringUtils.isBlank(key)) {
|
if (StringUtils.isEmpty(key)) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
key = key.startsWith(DOT) ? key.replaceFirst("\\.", "") : key;
|
key = key.startsWith(DOT) ? key.replaceFirst("\\.", "") : key;
|
||||||
|
@ -22,10 +22,11 @@ import java.util.Iterator;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Properties;
|
import java.util.Properties;
|
||||||
|
|
||||||
import com.alibaba.nacos.client.utils.StringUtils;
|
|
||||||
import com.fasterxml.jackson.databind.JsonNode;
|
import com.fasterxml.jackson.databind.JsonNode;
|
||||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||||
|
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author zkz
|
* @author zkz
|
||||||
*/
|
*/
|
||||||
|
@ -25,13 +25,14 @@ import java.util.Properties;
|
|||||||
import javax.xml.parsers.DocumentBuilder;
|
import javax.xml.parsers.DocumentBuilder;
|
||||||
import javax.xml.parsers.DocumentBuilderFactory;
|
import javax.xml.parsers.DocumentBuilderFactory;
|
||||||
|
|
||||||
import com.alibaba.nacos.client.utils.StringUtils;
|
|
||||||
import org.w3c.dom.Document;
|
import org.w3c.dom.Document;
|
||||||
import org.w3c.dom.NamedNodeMap;
|
import org.w3c.dom.NamedNodeMap;
|
||||||
import org.w3c.dom.Node;
|
import org.w3c.dom.Node;
|
||||||
import org.w3c.dom.NodeList;
|
import org.w3c.dom.NodeList;
|
||||||
import org.xml.sax.InputSource;
|
import org.xml.sax.InputSource;
|
||||||
|
|
||||||
|
import org.springframework.util.StringUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* With relatively few usage scenarios, only simple parsing is performed to reduce jar
|
* With relatively few usage scenarios, only simple parsing is performed to reduce jar
|
||||||
* dependencies.
|
* dependencies.
|
||||||
|
@ -465,7 +465,6 @@ public class NacosDiscoveryProperties {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Deprecated
|
|
||||||
public NamingService namingServiceInstance() {
|
public NamingService namingServiceInstance() {
|
||||||
|
|
||||||
if (null != namingService) {
|
if (null != namingService) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user