Commit ff392573 authored by kezhenxu94's avatar kezhenxu94 Committed by Jared Tan

Bugfix: fix miscellaneous bugs and polish code (#2678)

* Bugfix: fix miscellaneous bugs and polish code

* Update EmbeddedApollo.java
parent 0d824bb9
...@@ -252,7 +252,7 @@ public class ConfigUtil { ...@@ -252,7 +252,7 @@ public class ConfigUtil {
String customizedConfigCacheSize = System.getProperty("apollo.configCacheSize"); String customizedConfigCacheSize = System.getProperty("apollo.configCacheSize");
if (!Strings.isNullOrEmpty(customizedConfigCacheSize)) { if (!Strings.isNullOrEmpty(customizedConfigCacheSize)) {
try { try {
maxConfigCacheSize = Long.valueOf(customizedConfigCacheSize); maxConfigCacheSize = Long.parseLong(customizedConfigCacheSize);
} catch (Throwable ex) { } catch (Throwable ex) {
logger.error("Config for apollo.configCacheSize is invalid: {}", customizedConfigCacheSize); logger.error("Config for apollo.configCacheSize is invalid: {}", customizedConfigCacheSize);
} }
...@@ -275,7 +275,7 @@ public class ConfigUtil { ...@@ -275,7 +275,7 @@ public class ConfigUtil {
String customizedLongPollingInitialDelay = System.getProperty("apollo.longPollingInitialDelayInMills"); String customizedLongPollingInitialDelay = System.getProperty("apollo.longPollingInitialDelayInMills");
if (!Strings.isNullOrEmpty(customizedLongPollingInitialDelay)) { if (!Strings.isNullOrEmpty(customizedLongPollingInitialDelay)) {
try { try {
longPollingInitialDelayInMills = Long.valueOf(customizedLongPollingInitialDelay); longPollingInitialDelayInMills = Long.parseLong(customizedLongPollingInitialDelay);
} catch (Throwable ex) { } catch (Throwable ex) {
logger.error("Config for apollo.longPollingInitialDelayInMills is invalid: {}", customizedLongPollingInitialDelay); logger.error("Config for apollo.longPollingInitialDelayInMills is invalid: {}", customizedLongPollingInitialDelay);
} }
......
...@@ -5,7 +5,6 @@ import com.ctrip.framework.apollo.core.dto.ApolloConfig; ...@@ -5,7 +5,6 @@ import com.ctrip.framework.apollo.core.dto.ApolloConfig;
import com.ctrip.framework.apollo.core.dto.ApolloConfigNotification; import com.ctrip.framework.apollo.core.dto.ApolloConfigNotification;
import com.ctrip.framework.apollo.core.utils.ResourceUtils; import com.ctrip.framework.apollo.core.utils.ResourceUtils;
import com.ctrip.framework.apollo.internals.ConfigServiceLocator; import com.ctrip.framework.apollo.internals.ConfigServiceLocator;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet; import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps; import com.google.common.collect.Maps;
import com.google.gson.Gson; import com.google.gson.Gson;
......
...@@ -57,7 +57,7 @@ public class ConfigsExportController { ...@@ -57,7 +57,7 @@ public class ConfigsExportController {
.loadNamespaceBaseInfo(appId, Env.fromString(env), clusterName, namespaceName); .loadNamespaceBaseInfo(appId, Env.fromString(env), clusterName, namespaceName);
if (Objects.isNull(namespaceDTO)) { if (Objects.isNull(namespaceDTO)) {
throw new BadRequestException(String.format("Namespace: {} not exist.", namespaceName)); throw new BadRequestException(String.format("Namespace: %s not exist.", namespaceName));
} }
NamespaceTextModel model = new NamespaceTextModel(); NamespaceTextModel model = new NamespaceTextModel();
......
...@@ -173,6 +173,7 @@ public class ItemService { ...@@ -173,6 +173,7 @@ public class ItemService {
"namespace not exist. appId:%s, env:%s, clusterName:%s, namespaceName:%s", appId, env, clusterName, "namespace not exist. appId:%s, env:%s, clusterName:%s, namespaceName:%s", appId, env, clusterName,
namespaceName)); namespaceName));
} }
throw e;
} }
return namespaceDTO.getId(); return namespaceDTO.getId();
} }
......
...@@ -115,7 +115,7 @@ public class LdapProperties { ...@@ -115,7 +115,7 @@ public class LdapProperties {
Assert.notNull(environment, "Environment must not be null"); Assert.notNull(environment, "Environment must not be null");
String localPort = environment.getProperty("local.ldap.port"); String localPort = environment.getProperty("local.ldap.port");
if (localPort != null) { if (localPort != null) {
return Integer.valueOf(localPort); return Integer.parseInt(localPort);
} }
return DEFAULT_PORT; return DEFAULT_PORT;
} }
......
...@@ -103,7 +103,7 @@ public class CtripMQService implements MQService { ...@@ -103,7 +103,7 @@ public class CtripMQService implements MQService {
} }
private class PublishMsg { private static class PublishMsg {
private String assginee; private String assginee;
private String desc; private String desc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment