<commit_before>package shillelagh;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.Map;

import shillelagh.internal.ShillelaghInjector;
import shillelagh.internal.ShillelaghProcessor;

public final class Shillelagh {
    private Shillelagh() {
        // No instantiation
    }

    static final Map<Class<?>, Class<?>> CACHED_CLASSES = new LinkedHashMap<>();

    private static final String TAG = "Shillelagh";
    private static boolean debug = false;

    /** Turn on/off debug logging. */
    public static void setDebug(boolean debug) {
        Shillelagh.debug = debug;
    }

    public static void createTable(SQLiteDatabase database, Class<?> tableObject) {
        try {
            final Class<?> shillelagh = findShillelaghForClass(tableObject);
            final Method method = shillelagh.getMethod(ShillelaghInjector.CREATE_TABLE);
            database.execSQL((String) method.invoke(null));
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new UnableToCreateTableException("Unable to create table for " + tableObject.getName(), e);
        }
    }

    private static Class<?> findShillelaghForClass(Class<?> clazz) throws ClassNotFoundException {
        Class<?> shillelagh = CACHED_CLASSES.get(clazz);<commit_msg>Code Cleanup<commit_after>package shillelagh;

import android.database.sqlite.SQLiteDatabase;
import android.util.Log;

import java.lang.reflect.Method;
import java.util.LinkedHashMap;
import java.util.Map;

import shillelagh.internal.ShillelaghInjector;
import shillelagh.internal.ShillelaghProcessor;

public final class Shillelagh {
    private Shillelagh() {
        // No instantiation
    }

    private static final Map<Class<?>, Class<?>> CACHED_CLASSES = new LinkedHashMap<>();

    private static final String TAG = "Shillelagh";
    private static boolean debug = false;

    /** Turn on/off debug logging. */
    public static void setDebug(boolean debug) {
        Shillelagh.debug = debug;
    }

    public static void createTable(SQLiteDatabase database, Class<?> tableObject) {
        try {
            final Class<?> shillelagh = findShillelaghForClass(tableObject);
            final Method method = shillelagh.getMethod(ShillelaghInjector.CREATE_TABLE);
            database.execSQL((String) method.invoke(null));
        } catch (RuntimeException e) {
            throw e;
        } catch (Exception e) {
            throw new UnableToCreateTableException("Unable to create table for " + tableObject.getName(), e);
        }
    }

    private static Class<?> findShillelaghForClass(Class<?> clazz) throws ClassNotFoundException {
        Class<?> shillelagh = CACHED_CLASSES.get(clazz);
{'fraction_non_alphanumeric': 0.09747420846673782, 'fraction_numerical': 0.0, 'mean_word_length': 3.3596899224806203, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '7745', 'n_tokens_mistral': 806, 'n_tokens_neox': 801, 'n_words': 197}