提交 1d3d0520 编写于 作者: 张乐 提交者: GitHub

Merge pull request #533 from nobodyiam/fix

fix coverity defect
......@@ -46,7 +46,7 @@ public class ApolloDataSourceProvider implements DataSourceProvider, LogEnabled
String appId = Foundation.app().getAppId();
String envType = Foundation.server().getEnvType();
if (file.hasContent()) {
if (file != null && file.hasContent()) {
String content = file.getContent();
m_logger.info(String.format("Found datasources.xml from Apollo(env=%s, app.id=%s)!", envType, appId));
......
......@@ -12,7 +12,7 @@ public abstract class PlainTextConfigFile extends AbstractConfigFile {
@Override
public String getContent() {
if (m_configProperties.get() == null) {
if (!this.hasContent()) {
return null;
}
return m_configProperties.get().getProperty(ConfigConsts.CONFIG_FILE_CONTENT_KEY);
......
......@@ -34,7 +34,7 @@ public class PropertiesConfigFile extends AbstractConfigFile {
}
String doGetContent() {
if (m_configProperties.get() == null) {
if (!this.hasContent()) {
return null;
}
......
......@@ -330,7 +330,7 @@ public class NotificationControllerV2Test {
assertTrue(!anotherDeferredResult.hasResult());
TimeUnit.MILLISECONDS.sleep(someBatchInterval * 3);
TimeUnit.MILLISECONDS.sleep(someBatchInterval * 5);
assertTrue(anotherDeferredResult.hasResult());
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册