更新 AppContext.java

This commit is contained in:
黄道坤 2018-01-24 14:44:39 +08:00
parent 5c58b643da
commit 095e841895

View File

@ -332,8 +332,12 @@ public class AppContext implements LifeCycle {
}
public int getServerPort(String legacyKey, int defaultValue) {
if (defaultValue == 8080 && legacyKey != null && getConf().has(legacyKey)) {
log.infof("%s is deprecated, use %s instead", legacyKey, "server.port");
if (defaultValue == 8080 && legacyKey != null && getConf().has(legacyKey)){
log.infof("%s is deprecated, use %s instead,the defaultValue is %s", "server.port", legacyKey,"8080");
return getConf().getInt(legacyKey);
}
if (legacyKey != null && getConf().has(legacyKey)) {
log.infof("%s is deprecated, use %s instead", "server.port", legacyKey);
return getConf().getInt(legacyKey);
}
int port = getConf().getInt("server.port", defaultValue);