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 {
String customizedConfigCacheSize = System.getProperty("apollo.configCacheSize");
if (!Strings.isNullOrEmpty(customizedConfigCacheSize)) {
try {
maxConfigCacheSize = Long.valueOf(customizedConfigCacheSize);
maxConfigCacheSize = Long.parseLong(customizedConfigCacheSize);
} catch (Throwable ex) {
logger.error("Config for apollo.configCacheSize is invalid: {}", customizedConfigCacheSize);
}
......@@ -275,7 +275,7 @@ public class ConfigUtil {
String customizedLongPollingInitialDelay = System.getProperty("apollo.longPollingInitialDelayInMills");
if (!Strings.isNullOrEmpty(customizedLongPollingInitialDelay)) {
try {
longPollingInitialDelayInMills = Long.valueOf(customizedLongPollingInitialDelay);
longPollingInitialDelayInMills = Long.parseLong(customizedLongPollingInitialDelay);
} catch (Throwable ex) {
logger.error("Config for apollo.longPollingInitialDelayInMills is invalid: {}", customizedLongPollingInitialDelay);
}
......
......@@ -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.utils.ResourceUtils;
import com.ctrip.framework.apollo.internals.ConfigServiceLocator;
import com.google.common.collect.ImmutableMap;
import com.google.common.collect.ImmutableSet;
import com.google.common.collect.Maps;
import com.google.gson.Gson;
......
......@@ -57,7 +57,7 @@ public class ConfigsExportController {
.loadNamespaceBaseInfo(appId, Env.fromString(env), clusterName, namespaceName);
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();
......
......@@ -173,6 +173,7 @@ public class ItemService {
"namespace not exist. appId:%s, env:%s, clusterName:%s, namespaceName:%s", appId, env, clusterName,
namespaceName));
}
throw e;
}
return namespaceDTO.getId();
}
......
......@@ -115,7 +115,7 @@ public class LdapProperties {
Assert.notNull(environment, "Environment must not be null");
String localPort = environment.getProperty("local.ldap.port");
if (localPort != null) {
return Integer.valueOf(localPort);
return Integer.parseInt(localPort);
}
return DEFAULT_PORT;
}
......
......@@ -103,7 +103,7 @@ public class CtripMQService implements MQService {
}
private class PublishMsg {
private static class PublishMsg {
private String assginee;
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