Merge pull request #2455 from zhenxianyimeng/develop_new

Replace deprecated methods in ParamUtil
This commit is contained in:
liaochuntao 2020-03-13 18:45:37 +08:00 committed by GitHub
commit cc415a6ffd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -20,6 +20,7 @@ import com.alibaba.nacos.api.SystemPropertyKeyConst;
import com.alibaba.nacos.api.common.Constants; import com.alibaba.nacos.api.common.Constants;
import com.alibaba.nacos.client.config.impl.HttpSimpleClient; import com.alibaba.nacos.client.config.impl.HttpSimpleClient;
import org.slf4j.Logger; import org.slf4j.Logger;
import org.apache.commons.lang3.StringUtils;
import java.io.InputStream; import java.io.InputStream;
import java.util.Properties; import java.util.Properties;
@ -174,12 +175,12 @@ public class ParamUtil {
@Override @Override
public String call() { public String call() {
String namespace = System.getenv(PropertyKeyConst.SystemEnv.ALIBABA_ALIWARE_NAMESPACE); String namespace = System.getenv(PropertyKeyConst.SystemEnv.ALIBABA_ALIWARE_NAMESPACE);
return org.apache.commons.lang3.StringUtils.isNotBlank(namespace) ? namespace : StringUtils.EMPTY; return StringUtils.isNotBlank(namespace) ? namespace : StringUtils.EMPTY;
} }
}); });
} }
if (org.apache.commons.lang3.StringUtils.isBlank(namespaceTmp)) { if (StringUtils.isBlank(namespaceTmp)) {
namespaceTmp = properties.getProperty(PropertyKeyConst.NAMESPACE); namespaceTmp = properties.getProperty(PropertyKeyConst.NAMESPACE);
} }
return StringUtils.isNotBlank(namespaceTmp) ? namespaceTmp.trim() : StringUtils.EMPTY; return StringUtils.isNotBlank(namespaceTmp) ? namespaceTmp.trim() : StringUtils.EMPTY;