treat empty property as null

pull/496/head
Nitin 9 years ago
parent 1056a339a2
commit 2320bef366

@ -38,7 +38,7 @@ public abstract class PoolStats
public PoolStats(final long timeoutMs) public PoolStats(final long timeoutMs)
{ {
this.timeoutMs = timeoutMs; this.timeoutMs = timeoutMs;
this.reloadAt = new AtomicLong(0); this.reloadAt = new AtomicLong();
this.clock = ClockSource.INSTANCE; this.clock = ClockSource.INSTANCE;
} }

@ -67,14 +67,14 @@ abstract class PoolBase
this.config = config; this.config = config;
this.networkTimeout = -1; this.networkTimeout = -1;
this.catalog = config.getCatalog(); this.catalog = config.getCatalog() == null || config.getCatalog().isEmpty() ? null : config.getCatalog();
this.isReadOnly = config.isReadOnly(); this.isReadOnly = config.isReadOnly();
this.isAutoCommit = config.isAutoCommit(); this.isAutoCommit = config.isAutoCommit();
this.transactionIsolation = UtilityElf.getTransactionIsolation(config.getTransactionIsolation()); this.transactionIsolation = UtilityElf.getTransactionIsolation(config.getTransactionIsolation());
this.isQueryTimeoutSupported = UNINITIALIZED; this.isQueryTimeoutSupported = UNINITIALIZED;
this.isNetworkTimeoutSupported = UNINITIALIZED; this.isNetworkTimeoutSupported = UNINITIALIZED;
this.isUseJdbc4Validation = config.getConnectionTestQuery() == null; this.isUseJdbc4Validation = config.getConnectionTestQuery() == null || config.getConnectionTestQuery().isEmpty();
this.isIsolateInternalQueries = config.isIsolateInternalQueries(); this.isIsolateInternalQueries = config.isIsolateInternalQueries();
this.poolName = config.getPoolName(); this.poolName = config.getPoolName();

@ -94,7 +94,7 @@ public class ConcurrentBag<T extends IConcurrentBagEntry> implements AutoCloseab
this.listener = listener; this.listener = listener;
this.weakThreadLocals = useWeakThreadLocals(); this.weakThreadLocals = useWeakThreadLocals();
this.waiters = new AtomicInteger(0); this.waiters = new AtomicInteger();
this.sharedList = new CopyOnWriteArrayList<>(); this.sharedList = new CopyOnWriteArrayList<>();
this.synchronizer = new QueuedSequenceSynchronizer(); this.synchronizer = new QueuedSequenceSynchronizer();
if (weakThreadLocals) { if (weakThreadLocals) {

@ -115,7 +115,7 @@ public final class UtilityElf
*/ */
public static int getTransactionIsolation(final String transactionIsolationName) public static int getTransactionIsolation(final String transactionIsolationName)
{ {
if (transactionIsolationName != null) { if (transactionIsolationName != null && !transactionIsolationName.isEmpty()) {
try { try {
final String upperName = transactionIsolationName.toUpperCase(); final String upperName = transactionIsolationName.toUpperCase();
if (upperName.startsWith("TRANSACTION_")) { if (upperName.startsWith("TRANSACTION_")) {

Loading…
Cancel
Save