Skip to content

Commit 090d756

Browse files
author
lucaijun
committed
AJ-565: code review
1 parent 116c9dd commit 090d756

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/com/xxdb/SimpleDBConnectionPool.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ protected class SimpleDBConnectionPoolImpl {
109109
if (userId.isEmpty() || password.isEmpty())
110110
log.warn("Create connection pool successfully without log in.");
111111
else
112-
log.info("Create connection pool successfully with log in.");
112+
log.info(String.format("Create connection pool successfully with user: %s log in.", userId));
113113
} catch (Exception e) {
114114
log.error("Create connection pool failure, because " + e.getMessage());
115115
throw new RuntimeException(e);
@@ -202,14 +202,14 @@ public void login(String userId, String password, boolean enableEncryption) thro
202202
@Override
203203
public void close() {
204204
if (isBusy())
205-
log.error("Cannot release the connection,is running now.");
205+
log.error("Cannot release the connection, is running now.");
206206
else {
207207
try {
208208
BasicInt ret = (BasicInt) run("1+1", true);
209209
if (!ret.isNull() && (ret.getInt() == 2))
210210
inUse.compareAndSet(true, false);
211211
else
212-
log.error("Cannot release memory,release connection failure.");
212+
log.error("Cannot release memory, release connection failure.");
213213
} catch (Exception e) {
214214
log.error("Cannot release memory, because " + e.getMessage());
215215
}

src/com/xxdb/SimpleDBConnectionPoolConfig.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -122,11 +122,11 @@ public void setHighAvailabilitySites(String[] highAvailabilitySites) {
122122
this.highAvailabilitySites = highAvailabilitySites;
123123
}
124124

125-
public void validate() {
125+
protected void validate() {
126126
hostName = getNullIfEmpty(hostName);
127127
if (Objects.isNull(hostName)) {
128128
hostName = "localhost";
129-
log.warn("HostName not set, use the default value 'localhost'");
129+
log.warn("The param hostName not set, use the default value 'localhost'");
130130
}
131131
if (!checkHostNameValid(hostName))
132132
throw new RuntimeException(String.format("Invalid hostName: %s", hostName));
@@ -137,12 +137,12 @@ public void validate() {
137137
userId = getNullIfEmpty(userId);
138138
if (Objects.isNull(userId)){
139139
userId = "";
140-
log.warn("Logging in needs userId.");
140+
log.warn("Log in needs userId.");
141141
}
142142
password = getNullIfEmpty(password);
143143
if (Objects.isNull(password)){
144144
password = "";
145-
log.warn("Logging in needs password.");
145+
log.warn("Log in needs password.");
146146
}
147147
if (initialPoolSize <= 0) {
148148
initialPoolSize = 5;

0 commit comments

Comments
 (0)