Minor optimizations.

pull/158/head
Brett Wooldridge 10 years ago
parent b317b23f5b
commit 028996b508

@ -34,19 +34,16 @@ public final class PoolBagEntry extends BagEntry
PoolBagEntry(final Connection connection, long maxLifetime) {
this.connection = connection;
expirationTime = (maxLifetime > 0 ? System.currentTimeMillis() + maxLifetime : Long.MAX_VALUE);
lastAccess = System.currentTimeMillis();
expirationTime = (maxLifetime > 0 ? lastAccess + maxLifetime : Long.MAX_VALUE);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("Connection: ").append(connection).append('\n');
sb.append("Expiration: ").append(expirationTime).append('\n');
sb.append("Last access: ").append(lastAccess).append('\n');
sb.append("Last open: ").append(lastOpenTime);
return sb.toString();
return "Connection......" + connection + "\n"
+ " Expiration...." + expirationTime + "\n"
+ " Last access.." + lastAccess + "\n"
+ " Last open....." + lastOpenTime + "\n";
}
}

@ -34,19 +34,17 @@ public final class PoolBagEntry extends BagEntry
PoolBagEntry(final Connection connection, long maxLifetime) {
this.connection = connection;
expirationTime = (maxLifetime > 0 ? System.currentTimeMillis() + maxLifetime : Long.MAX_VALUE);
lastAccess = System.currentTimeMillis();
expirationTime = (maxLifetime > 0 ? lastAccess + maxLifetime : Long.MAX_VALUE);
}
@Override
public String toString()
{
StringBuilder sb = new StringBuilder();
sb.append("Connection: ").append(connection).append('\n');
sb.append("Expiration: ").append(expirationTime).append('\n');
sb.append("Last access: ").append(lastAccess).append('\n');
sb.append("Last open: ").append(lastOpenTime);
return sb.toString();
return "Connection......" + connection + "\n"
+ " Expiration...." + expirationTime + "\n"
+ " Last access.." + lastAccess + "\n"
+ " Last open....." + lastOpenTime + "\n";
}
}

Loading…
Cancel
Save