<commit_before>package nl.elastique.poetry.data.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.j256.ormlite.android.apptools.OpenHelperManager;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.util.HashMap;

public class DatabaseHelper extends OrmLiteSqliteOpenHelper
{
    private static final Logger sLogger = LoggerFactory.getLogger(DatabaseHelper.class);

    private static DatabaseConfiguration sConfiguration;

    protected static final HashMap<Class<?>, Dao<?, ?>> sCachedDaos = new HashMap<Class<?>, Dao<?,?>>();

    public DatabaseHelper(Context context)
    {
        super(context, sConfiguration.getDatabaseName(), null, sConfiguration.getModelVersion());
    }

    public DatabaseHelper(Context context, DatabaseConfiguration configuration)
    {
        super(context, configuration.getDatabaseName(), null, configuration.getModelVersion());

        sConfiguration = configuration;
    }

    public static void setConfiguration(DatabaseConfiguration configuration)
    {
        sConfiguration = configuration;
    }

    public static DatabaseHelper getHelper(Context context)
    {
        return OpenHelperManager.getHelper(context, DatabaseHelper.class);
    }

    public static DatabaseHelper getHelper(Context context, Class<? extends DatabaseHelper> classObject)
    {
        return OpenHelperManager.getHelper(context, classObject);
    }<commit_msg>improved DatabaseHelper.getHelper<commit_after>package nl.elastique.poetry.data.database;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import com.j256.ormlite.android.apptools.OpenHelperManager;
import com.j256.ormlite.android.apptools.OrmLiteSqliteOpenHelper;
import com.j256.ormlite.dao.Dao;
import com.j256.ormlite.support.ConnectionSource;
import com.j256.ormlite.table.TableUtils;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.sql.SQLException;
import java.util.HashMap;

public class DatabaseHelper extends OrmLiteSqliteOpenHelper
{
    private static final Logger sLogger = LoggerFactory.getLogger(DatabaseHelper.class);

    private static DatabaseConfiguration sConfiguration;

    protected static final HashMap<Class<?>, Dao<?, ?>> sCachedDaos = new HashMap<Class<?>, Dao<?,?>>();

    public DatabaseHelper(Context context)
    {
        super(context, sConfiguration.getDatabaseName(), null, sConfiguration.getModelVersion());
    }

    public DatabaseHelper(Context context, DatabaseConfiguration configuration)
    {
        super(context, configuration.getDatabaseName(), null, configuration.getModelVersion());

        sConfiguration = configuration;
    }

    public static void setConfiguration(DatabaseConfiguration configuration)
    {
        sConfiguration = configuration;
    }

    public static DatabaseHelper getHelper(Context context)
    {
        return OpenHelperManager.getHelper(context, DatabaseHelper.class);
    }

    public static <T extends DatabaseHelper> T getHelper(Context context, Class<T> classObject)
    {
        return OpenHelperManager.getHelper(context, classObject);
    }
{'fraction_non_alphanumeric': 0.09088209088209089, 'fraction_numerical': 0.010098010098010098, 'mean_word_length': 4.786941580756014, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5015274', 'n_tokens_mistral': 937, 'n_tokens_neox': 896, 'n_words': 188}