if (result != null && getLogger() != null)
if (result != null && !connectionAdded && getLogger() != null)
        public PingablePooledConnection take() throws SQLException {                        long startTime = System.currentTimeMillis();            if (LOG_DEBUG_INFO && getLogger() != null)                getLogger().debug(                    "Thread "                        + Thread.currentThread().getName()                        + " wants to take connection.");            PingablePooledConnection result = null;            try {                if (queue.isEmpty()) {                    while (result == null) {                                                if (!keepBlocking(startTime))                            throw new SQLException(                                "Could not obtain connection during " +                                 "blocking timeout (" + blockingTimeout + " ms)");                        boolean connectionAdded = false;                        try {                            connectionAdded = addConnection();                        } catch (SQLException sqlex) {                            if (getLogger() != null)                                getLogger().warn(                                    "Could not create connection."                                    + sqlex.getMessage());                            // could not add connection... bad luck                            // let's wait more                        }                        if (connectionAdded) {                            String message =                                "Pool "                                    + queueName                                    + " is empty and will block here."                                    + " Thread "                                    + Thread.currentThread().getName();                            if (SHOW_STACK_ON_BLOCK) {                                if (getLogger() != null)                                    getLogger().warn(message, new Exception());                            } else {                                if (getLogger() != null)                                    getLogger().warn(message);                            }                            blocked = true;                        }                                                result = (PingablePooledConnection) queue.poll(                            getConfiguration().getRetryInterval());                                                    if (result == null && getLogger() != null)                            getLogger().warn("No connection in pool. Thread " +                                Thread.currentThread().getName());                        else                        if (result != null && getLogger() != null)                            getLogger().info("Obtained connection. Thread " +                                 Thread.currentThread().getName());                    }                } else {                    result = (PingablePooledConnection)queue.take();                }            } catch (InterruptedException iex) {                throw new SQLException(                    "No free connection was available and "                        + "waiting thread was interrupted. Sorry.");            }            size--;            workingConnections.add(result);            if (LOG_DEBUG_INFO && getLogger() != null)                getLogger().debug(                    "Thread "+ Thread.currentThread().getName() +                     " got connection.");            return result;        }