Skip to content

Commit

Permalink
Bugfix: fix miscellaneous bugs and polish code (apolloconfig#2678)
Browse files Browse the repository at this point in the history
* Bugfix: fix miscellaneous bugs and polish code

* Update EmbeddedApollo.java
  • Loading branch information
kezhenxu94 authored and JaredTan95 committed Oct 20, 2019
1 parent 0d824bb commit ff39257
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ private void initMaxConfigCacheSize() {
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);
}
Expand All @@ -275,7 +275,7 @@ private void initLongPollingInitialDelayInMills() {
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);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void importConfigFile(@PathVariable String appId, @PathVariable String en
.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();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,7 @@ private long getNamespaceId(NamespaceIdentifier namespaceIdentifier) {
"namespace not exist. appId:%s, env:%s, clusterName:%s, namespaceName:%s", appId, env, clusterName,
namespaceName));
}
throw e;
}
return namespaceDTO.getId();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ private int determinePort(Environment environment) {
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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ private void sendMsg(String serverAddress, String topic, Object msg) {

}

private class PublishMsg {
private static class PublishMsg {

private String assginee;
private String desc;
Expand Down

0 comments on commit ff39257

Please sign in to comment.