diff --git a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java index bc674831470..b707a593ce7 100644 --- a/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java +++ b/apollo-client/src/main/java/com/ctrip/framework/apollo/internals/LocalFileConfigRepository.java @@ -119,7 +119,6 @@ public void setUpstreamRepository(ConfigRepository upstreamConfigRepository) { m_upstream.removeChangeListener(this); } m_upstream = upstreamConfigRepository; - trySyncFromUpstream(); upstreamConfigRepository.addChangeListener(this); } diff --git a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/ConfigController.java b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/ConfigController.java index 8fc55086fad..7d3a0e2a88b 100755 --- a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/ConfigController.java +++ b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/controller/ConfigController.java @@ -115,7 +115,7 @@ public ApolloConfig queryConfig(@PathVariable String appId, @PathVariable String if (!namespaceBelongsToAppId(appId, namespace)) { Release publicRelease = this.findPublicConfig(appId, clientIp, clusterName, namespace, dataCenter, clientMessages); - if (!Objects.isNull(publicRelease)) { + if (Objects.nonNull(publicRelease)) { releases.add(publicRelease); } } diff --git a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/config/AbstractConfigService.java b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/config/AbstractConfigService.java index f7301efc848..cbef4fc3a0a 100644 --- a/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/config/AbstractConfigService.java +++ b/apollo-configservice/src/main/java/com/ctrip/framework/apollo/configservice/service/config/AbstractConfigService.java @@ -41,7 +41,7 @@ public Release loadConfig(String clientAppId, String clientIp, String configAppI Release clusterRelease = findRelease(clientAppId, clientIp, configAppId, configClusterName, configNamespace, clientMessages); - if (!Objects.isNull(clusterRelease)) { + if (Objects.nonNull(clusterRelease)) { return clusterRelease; } } @@ -50,7 +50,7 @@ public Release loadConfig(String clientAppId, String clientIp, String configAppI if (!Strings.isNullOrEmpty(dataCenter) && !Objects.equals(dataCenter, configClusterName)) { Release dataCenterRelease = findRelease(clientAppId, clientIp, configAppId, dataCenter, configNamespace, clientMessages); - if (!Objects.isNull(dataCenterRelease)) { + if (Objects.nonNull(dataCenterRelease)) { return dataCenterRelease; } }