better method name

pull/499/head
Nitin 9 years ago
parent a491250ba1
commit fdce10f7db

@ -42,7 +42,7 @@ import com.codahale.metrics.health.HealthCheckRegistry;
import com.zaxxer.hikari.metrics.MetricsTrackerFactory;
import com.zaxxer.hikari.util.PropertyElf;
import static com.zaxxer.hikari.util.UtilityElf.nullOrNotEmpty;
import static com.zaxxer.hikari.util.UtilityElf.getNullIfEmpty;
public class HikariConfig implements HikariConfigMXBean
{
@ -749,14 +749,14 @@ public class HikariConfig implements HikariConfigMXBean
validateNumerics();
// treat empty property as null
catalog = nullOrNotEmpty(catalog);
connectionInitSql = nullOrNotEmpty(connectionInitSql);
connectionTestQuery = nullOrNotEmpty(connectionTestQuery);
transactionIsolationName = nullOrNotEmpty(transactionIsolationName);
dataSourceClassName = nullOrNotEmpty(dataSourceClassName);
dataSourceJndiName = nullOrNotEmpty(dataSourceJndiName);
driverClassName = nullOrNotEmpty(driverClassName);
jdbcUrl = nullOrNotEmpty(jdbcUrl);
catalog = getNullIfEmpty(catalog);
connectionInitSql = getNullIfEmpty(connectionInitSql);
connectionTestQuery = getNullIfEmpty(connectionTestQuery);
transactionIsolationName = getNullIfEmpty(transactionIsolationName);
dataSourceClassName = getNullIfEmpty(dataSourceClassName);
dataSourceJndiName = getNullIfEmpty(dataSourceJndiName);
driverClassName = getNullIfEmpty(driverClassName);
jdbcUrl = getNullIfEmpty(jdbcUrl);
if (poolName == null) {
poolName = "HikariPool-" + POOL_NUMBER.getAndIncrement();

@ -35,7 +35,7 @@ public final class UtilityElf
*
* @return null if string is null or empty
*/
public static String nullOrNotEmpty(final String text)
public static String getNullIfEmpty(final String text)
{
return text == null ? null : text.trim().isEmpty() ? null : text.trim();
}

@ -41,13 +41,16 @@ public class ShutdownTest
@Before
public void beforeTest()
{
TestElf.setSlf4jLogLevel(ShutdownTest.class, Level.DEBUG);
TestElf.setSlf4jLogLevel(PoolBase.class, Level.DEBUG);
TestElf.setSlf4jLogLevel(HikariPool.class, Level.DEBUG);
StubConnection.count.set(0);
}
@After
public void afterTest()
{
TestElf.setSlf4jLogLevel(PoolBase.class, Level.WARN);
TestElf.setSlf4jLogLevel(HikariPool.class, Level.WARN);
StubConnection.slowCreate = false;
}

Loading…
Cancel
Save