// Path: sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java
// public static class DbStats {
//     /** name of the database */
//     public String dbName;
// 
//     /** the page size for the database */
//     public long pageSize;
// 
//     /** the database size */
//     public long dbSize;
// 
//     /** documented here http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html */
//     public int lookaside;
// 
//     /** statement cache stats: hits/misses/cachesize */
//     public String cache;
// 
//     public DbStats(String dbName, long pageCount, long pageSize, int lookaside,
//         int hits, int misses, int cachesize) {
//         this.dbName = dbName;
//         this.pageSize = pageSize / 1024;
//         dbSize = (pageCount * pageSize) / 1024;
//         this.lookaside = lookaside;
//         this.cache = hits + "/" + misses + "/" + cachesize;
//     }
// }


import java.util.ArrayList;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.LockSupport;
import org.sqlite.database.sqlite.CloseGuard;
import org.sqlite.database.sqlite.SQLiteDebug.DbStats;
import android.os.CancellationSignal;
import android.os.OperationCanceledException;
import android.os.SystemClock;
import android.util.Log;
import android.util.Printer;
import java.io.Closeable;
        Log.w(TAG, "A SQLiteConnection object for database '"
                + mConfiguration.label + "' was leaked!  Please fix your application "
                + "to end transactions in progress properly and to close the database "
                + "when it is no longer needed.");

        mConnectionLeaked.set(true);
    }

    // Can't throw.
    private void closeAvailableConnectionsAndLogExceptionsLocked() {
        closeAvailableNonPrimaryConnectionsAndLogExceptionsLocked();

        if (mAvailablePrimaryConnection != null) {
            closeConnectionAndLogExceptionsLocked(mAvailablePrimaryConnection);
            mAvailablePrimaryConnection = null;
        }
    }

    // Can't throw.
    private void closeAvailableNonPrimaryConnectionsAndLogExceptionsLocked() {
        final int count = mAvailableNonPrimaryConnections.size();
        for (int i = 0; i < count; i++) {
            closeConnectionAndLogExceptionsLocked(mAvailableNonPrimaryConnections.get(i));
        }
        mAvailableNonPrimaryConnections.clear();
    }

    // Can't throw.
    private void closeExcessConnectionsAndLogExceptionsLocked() {
        int availableCount = mAvailableNonPrimaryConnections.size();
// Path: sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteDebug.java
// public static class DbStats {
//     /** name of the database */
//     public String dbName;
// 
//     /** the page size for the database */
//     public long pageSize;
// 
//     /** the database size */
//     public long dbSize;
// 
//     /** documented here http://www.sqlite.org/c3ref/c_dbstatus_lookaside_used.html */
//     public int lookaside;
// 
//     /** statement cache stats: hits/misses/cachesize */
//     public String cache;
// 
//     public DbStats(String dbName, long pageCount, long pageSize, int lookaside,
//         int hits, int misses, int cachesize) {
//         this.dbName = dbName;
//         this.pageSize = pageSize / 1024;
//         dbSize = (pageCount * pageSize) / 1024;
//         this.lookaside = lookaside;
//         this.cache = hits + "/" + misses + "/" + cachesize;
//     }
// }


// Path: sqlite3/src/main/java/org/sqlite/database/sqlite/SQLiteConnectionPool.java
import java.util.ArrayList;
import java.util.Map;
import java.util.WeakHashMap;
import java.util.concurrent.atomic.AtomicBoolean;
import java.util.concurrent.locks.LockSupport;
import org.sqlite.database.sqlite.CloseGuard;
import org.sqlite.database.sqlite.SQLiteDebug.DbStats;
import android.os.CancellationSignal;
import android.os.OperationCanceledException;
import android.os.SystemClock;
import android.util.Log;
import android.util.Printer;
import java.io.Closeable;

        Log.w(TAG, "A SQLiteConnection object for database '"
                + mConfiguration.label + "' was leaked!  Please fix your application "
                + "to end transactions in progress properly and to close the database "
                + "when it is no longer needed.");

        mConnectionLeaked.set(true);
    }

    // Can't throw.
    private void closeAvailableConnectionsAndLogExceptionsLocked() {
        closeAvailableNonPrimaryConnectionsAndLogExceptionsLocked();

        if (mAvailablePrimaryConnection != null) {
            closeConnectionAndLogExceptionsLocked(mAvailablePrimaryConnection);
            mAvailablePrimaryConnection = null;
        }
    }

    // Can't throw.
    private void closeAvailableNonPrimaryConnectionsAndLogExceptionsLocked() {
        final int count = mAvailableNonPrimaryConnections.size();
        for (int i = 0; i < count; i++) {
            closeConnectionAndLogExceptionsLocked(mAvailableNonPrimaryConnections.get(i));
        }
        mAvailableNonPrimaryConnections.clear();
    }

    // Can't throw.
    private void closeExcessConnectionsAndLogExceptionsLocked() {
        int availableCount = mAvailableNonPrimaryConnections.size();
        while (availableCount-- > mMaxConnectionPoolSize - 1) {