test_class.file: driver/src/test/java/pgnio/ConnectionPoolTest.java
test_class.identifier: ConnectionPoolTest
test_class.superclass: extends DbTestBase
test_case.body: @Test
    public void testFirstLazyConnectionIsOnlyOne() throws Exception {
      try (ConnectionPool pool = new ConnectionPool(newDefaultConfig().poolSize(5))) {
        long count = pool.withConnection(this::getConnectionCount).get();
        Assert.assertEquals(1L, count);
        count = pool.withConnection(this::getConnectionCount).get();
        Assert.assertEquals(1L, count);
      }
    }
test_case.class_method_signature: ConnectionPoolTest.testFirstLazyConnectionIsOnlyOne()
test_case.full_signature: @Test public void testFirstLazyConnectionIsOnlyOne()
test_case.identifier: testFirstLazyConnectionIsOnlyOne
test_case.invocations: poolSize newDefaultConfig get withConnection assertEquals get withConnection assertEquals
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFirstLazyConnectionIsOnlyOne()
focal_class.declarator: log = Logger.getLogger(ConnectionPool.class.getName())
focal_class.modifier: protected static final
focal_class.original_string: protected static final Logger log = Logger.getLogger(ConnectionPool.class.getName());
focal_class.type: Logger
focal_class.var_name: log
focal_class.declarator: config
focal_class.modifier: protected final
focal_class.original_string: protected final Config config;
focal_class.type: Config
focal_class.var_name: config
focal_class.declarator: connections
focal_class.modifier: protected final
focal_class.original_string: protected final BlockingQueue<CompletableFuture<QueryReadyConnection.AutoCommit>> connections;
focal_class.type: BlockingQueue<CompletableFuture<QueryReadyConnection.AutoCommit>>
focal_class.var_name: connections
focal_class.declarator: closed
focal_class.modifier: protected volatile
focal_class.original_string: protected volatile boolean closed;
focal_class.type: boolean
focal_class.var_name: closed
focal_class.declarator: remainingNewConnectionsOnBorrow = new AtomicInteger()
focal_class.modifier: protected final
focal_class.original_string: protected final AtomicInteger remainingNewConnectionsOnBorrow = new AtomicInteger();
focal_class.type: AtomicInteger
focal_class.var_name: remainingNewConnectionsOnBorrow
focal_class.file: driver/src/main/java/pgnio/ConnectionPool.java
focal_class.identifier: ConnectionPool
focal_class.interfaces: implements AutoCloseable
focal_class.class_method_signature: ConnectionPool.ConnectionPool(Config config)
focal_class.full_signature: @SuppressWarnings("initialization") public  ConnectionPool(Config config)
focal_class.identifier: ConnectionPool
focal_class.modifiers: @SuppressWarnings("initialization") public
focal_class.parameters: (Config config)
focal_class.signature:  ConnectionPool(Config config)
focal_class.class_method_signature: ConnectionPool.borrowConnection()
focal_class.full_signature: public CompletableFuture<QueryReadyConnection.AutoCommit> borrowConnection()
focal_class.identifier: borrowConnection
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CompletableFuture<QueryReadyConnection.AutoCommit>
focal_class.signature: CompletableFuture<QueryReadyConnection.AutoCommit> borrowConnection()
focal_class.class_method_signature: ConnectionPool.borrowConnection(long timeout, TimeUnit unit)
focal_class.full_signature: public CompletableFuture<QueryReadyConnection.AutoCommit> borrowConnection(long timeout, TimeUnit unit)
focal_class.identifier: borrowConnection
focal_class.modifiers: public
focal_class.parameters: (long timeout, TimeUnit unit)
focal_class.return: CompletableFuture<QueryReadyConnection.AutoCommit>
focal_class.signature: CompletableFuture<QueryReadyConnection.AutoCommit> borrowConnection(long timeout, TimeUnit unit)
focal_class.class_method_signature: ConnectionPool.newConnection()
focal_class.full_signature: protected CompletableFuture<QueryReadyConnection.AutoCommit> newConnection()
focal_class.identifier: newConnection
focal_class.modifiers: protected
focal_class.parameters: ()
focal_class.return: CompletableFuture<QueryReadyConnection.AutoCommit>
focal_class.signature: CompletableFuture<QueryReadyConnection.AutoCommit> newConnection()
focal_class.class_method_signature: ConnectionPool.returnConnection(QueryReadyConnection.@Nullable AutoCommit conn)
focal_class.full_signature: @SuppressWarnings("dereference.of.nullable") public void returnConnection(QueryReadyConnection.@Nullable AutoCommit conn)
focal_class.identifier: returnConnection
focal_class.modifiers: @SuppressWarnings("dereference.of.nullable") public
focal_class.parameters: (QueryReadyConnection.@Nullable AutoCommit conn)
focal_class.return: void
focal_class.signature: void returnConnection(QueryReadyConnection.@Nullable AutoCommit conn)
focal_class.class_method_signature: ConnectionPool.withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.full_signature: public CompletableFuture<T> withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.identifier: withConnection
focal_class.modifiers: public
focal_class.parameters: (Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.return: CompletableFuture<T>
focal_class.signature: CompletableFuture<T> withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.class_method_signature: ConnectionPool.withConnection(long waitForConnTimeout, TimeUnit waitForConnUnit,
        Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.full_signature: public CompletableFuture<T> withConnection(long waitForConnTimeout, TimeUnit waitForConnUnit,
        Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.identifier: withConnection
focal_class.modifiers: public
focal_class.parameters: (long waitForConnTimeout, TimeUnit waitForConnUnit,
        Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.return: CompletableFuture<T>
focal_class.signature: CompletableFuture<T> withConnection(long waitForConnTimeout, TimeUnit waitForConnUnit,
        Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_class.class_method_signature: ConnectionPool.terminateAll()
focal_class.full_signature: public CompletableFuture<Void> terminateAll()
focal_class.identifier: terminateAll
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: CompletableFuture<Void>
focal_class.signature: CompletableFuture<Void> terminateAll()
focal_class.class_method_signature: ConnectionPool.close()
focal_class.full_signature: @Override public void close()
focal_class.identifier: close
focal_class.modifiers: @Override public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void close()
focal_method.body: public <T> CompletableFuture<T> withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn) {
      return withConnection(config.defaultTimeout, config.defaultTimeoutUnit, fn);
    }
focal_method.class_method_signature: ConnectionPool.withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_method.full_signature: public CompletableFuture<T> withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_method.identifier: withConnection
focal_method.invocations: withConnection
focal_method.modifiers: public
focal_method.parameters: (Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)
focal_method.return: CompletableFuture<T>
focal_method.signature: CompletableFuture<T> withConnection(Function<QueryReadyConnection.AutoCommit, CompletableFuture<T>> fn)