@@ -178,15 +178,15 @@ protected void validate() {
178
178
hostName = getNullIfEmpty (hostName );
179
179
if (Objects .isNull (hostName )) {
180
180
hostName = "localhost" ;
181
- log .warn ("The param hostName not set, use the default value 'localhost'" );
181
+ log .warn ("The param hostName not set, will use the default value 'localhost'" );
182
182
}
183
183
184
184
if (!checkHostNameValid (hostName ))
185
185
throw new RuntimeException (String .format ("Invalid hostName: %s" , hostName ));
186
186
187
187
if (port <= 0 ) {
188
188
port = 8848 ;
189
- log .warn ("Invalid port, use the default value 8848." );
189
+ log .warn ("Invalid port, will use the default value 8848." );
190
190
}
191
191
192
192
userId = getNullIfEmpty (userId );
@@ -203,7 +203,7 @@ protected void validate() {
203
203
204
204
if (initialPoolSize <= 0 ) {
205
205
initialPoolSize = 5 ;
206
- log .warn ("The number of connection pools is invalid, use the default value 5." );
206
+ log .warn ("The number of connection pools is invalid, will use the default value 5." );
207
207
}
208
208
209
209
if (initialPoolSize > 0 && minimumPoolSize == -1 && maximumPoolSize == -1 ) {
@@ -214,36 +214,34 @@ protected void validate() {
214
214
215
215
if (initialPoolSize < 0 ) {
216
216
// 新逻辑(不填init,如果mini、max也不填,这俩参数给默认值,填了照常取值但是要做判断):mini、max 不填的话,自动设置默认值
217
- if (minimumPoolSize < 0 && maximumPoolSize < 0 ) {
217
+ if (minimumPoolSize <= 0 && maximumPoolSize <= 0 ) {
218
218
minimumPoolSize = 5 ;
219
- log .warn ("The param 'minimumIdle' cannot less than or equal to 0, use the default value 5." );
219
+ log .warn ("The param 'minimumIdle' cannot less than or equal to 0, will use the default value 5." );
220
220
221
221
maximumPoolSize = 5 ;
222
- log .warn ("The param 'maximumPoolSize' cannot less than or equal to 0, use the default value 5." );
222
+ log .warn ("The param 'maximumPoolSize' cannot less than or equal to 0, will use the default value 5." );
223
223
} else if (minimumPoolSize > 0 && maximumPoolSize > 0 ) {
224
224
if (maximumPoolSize < minimumPoolSize ) {
225
225
maximumPoolSize = minimumPoolSize ;
226
226
log .warn ("The param 'maximumPoolSize' cannot less than 'minimumIdle', 'maximumPoolSize' will be set equal to 'minimumIdle' value." );
227
227
}
228
228
}
229
229
} else {
230
- if (minimumPoolSize < 0 && maximumPoolSize < 0 ) {
230
+ if (minimumPoolSize <= 0 ) {
231
231
minimumPoolSize = 5 ;
232
- log .warn ("The param 'minimumIdle' cannot less than or equal to 0, use the default value 5." );
233
-
232
+ log .warn ("The param 'minimumIdle' cannot less than or equal to 0, will use the default value 5." );
233
+ } else if ( maximumPoolSize <= 0 ) {
234
234
maximumPoolSize = 5 ;
235
- log .warn ("The param 'maximumPoolSize' cannot less than or equal to 0, use the default value 5." );
236
- } else if (minimumPoolSize > 0 && maximumPoolSize > 0 ) {
237
- if (maximumPoolSize < minimumPoolSize ) {
235
+ log .warn ("The param 'maximumPoolSize' cannot less than or equal to 0, will use the default value 5." );
236
+ } else if (maximumPoolSize < minimumPoolSize ) {
238
237
maximumPoolSize = minimumPoolSize ;
239
238
log .warn ("The param 'maximumPoolSize' cannot less than 'minimumIdle', 'maximumPoolSize' will be set equal to 'minimumIdle' value." );
240
- }
241
239
}
242
240
}
243
241
244
242
if (idleTimeout < 10000 ) {
245
243
idleTimeout = 600000 ;
246
- log .warn ("The param 'idleTimeout' cannot less than 10000ms, use the default value 600000ms(10min)" );
244
+ log .warn ("The param 'idleTimeout' cannot less than 10000ms, will use the default value 600000ms(10min)" );
247
245
}
248
246
}
249
247
0 commit comments