Minor cleanup.

pull/131/head
Brett Wooldridge 11 years ago
parent 775cba7db5
commit a7e8852a9f

@ -410,7 +410,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
{ {
try { try {
final boolean timeoutEnabled = (configuration.getConnectionTimeout() != Integer.MAX_VALUE); final boolean timeoutEnabled = (configuration.getConnectionTimeout() != Integer.MAX_VALUE);
timeoutMs = timeoutEnabled ? Math.max(1000L, timeoutMs) : 0; timeoutMs = timeoutEnabled ? Math.max(1000L, timeoutMs) : 0L;
if (isJdbc4ConnectionTest) { if (isJdbc4ConnectionTest) {
return connection.isValid((int) TimeUnit.MILLISECONDS.toSeconds(timeoutMs)); return connection.isValid((int) TimeUnit.MILLISECONDS.toSeconds(timeoutMs));
@ -484,7 +484,7 @@ public final class HikariPool implements HikariPoolMBean, IBagStateListener
} }
assassinExecutor.shutdown(); assassinExecutor.shutdown();
assassinExecutor.awaitTermination(5, TimeUnit.SECONDS); assassinExecutor.awaitTermination(5L, TimeUnit.SECONDS);
} }
/** /**

@ -133,7 +133,7 @@ public class ConcurrentBag<T extends com.zaxxer.hikari.util.ConcurrentBag.IBagMa
timeout -= (System.nanoTime() - startScan); timeout -= (System.nanoTime() - startScan);
} }
while (timeout > 0); while (timeout > 0L);
return null; return null;
} }
@ -164,7 +164,7 @@ public class ConcurrentBag<T extends com.zaxxer.hikari.util.ConcurrentBag.IBagMa
synchronizer.releaseShared(System.nanoTime()); synchronizer.releaseShared(System.nanoTime());
} }
else { else {
throw new IllegalStateException("Value was returned to the bag that was not borrowed: "); throw new IllegalStateException("Value was returned to the bag that was not borrowed: " + value);
} }
} }
@ -319,7 +319,7 @@ public class ConcurrentBag<T extends com.zaxxer.hikari.util.ConcurrentBag.IBagMa
@Override @Override
protected long tryAcquireShared(long startScanTime) protected long tryAcquireShared(long startScanTime)
{ {
return getState() >= startScanTime && !java67hasQueuedPredecessors() ? 1 : -1; return getState() >= startScanTime && !java67hasQueuedPredecessors() ? 1L : -1L;
} }
/** {@inheritDoc} */ /** {@inheritDoc} */

Loading…
Cancel
Save