<commit_before>package com.g11x.checklistapp;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.database.Cursor;
import android.net.Uri;
import android.support.annotation.Nullable;

/** Application data repository. */
public class LocalRepository extends ContentProvider {
    @Override
    public boolean onCreate() {
        return false;
    }

    @Nullable
    @Override
    public Cursor query(Uri uri, String[] strings, String s, String[] strings1, String s1) {
        return null;
    }

    @Nullable
    @Override
    public String getType(Uri uri) {
        return null;
    }

    @Nullable
    @Override
    public Uri insert(Uri uri, ContentValues contentValues) {
        return null;
    }

    @Override
    public int delete(Uri uri, String s, String[] strings) {
        return 0;
    }

    @Override
    public int update(Uri uri, ContentValues contentValues, String s, String[] strings) {
        return 0;
    }
}<commit_msg>Baseline mechanics for creating a SQLite DB backed ContentProvider.<commit_after>package com.g11x.checklistapp;

import android.content.ContentProvider;
import android.content.ContentValues;
import android.content.Context;
import android.database.Cursor;
import android.database.sqlite.SQLiteDatabase;
import android.database.sqlite.SQLiteOpenHelper;
import android.net.Uri;
import android.support.annotation.Nullable;

/** Application data repository. */
public class LocalRepository extends ContentProvider {
    // Defines the database name
    private static final String DB_NAME = "g11x_checklistapp";

    // A string that defines the SQL statement for creating a table
    private static final String SQL_CREATE_MAIN =
        "CREATE TABLE important_info "
        + "(_ID INTEGER PRIMARY KEY, INFO TEXT);";

     // Helper class that actually creates and manages the provider's underlying data repository.
    protected static final class MainDatabaseHelper extends SQLiteOpenHelper {
        // Instantiates an open helper for the provider's SQLite data repository. Do not do database
        // creation and upgrade here.
        MainDatabaseHelper(Context context) {
            super(context, DB_NAME, null, 1);
        }

        // Creates the data repository. This is called when the provider attempts to open the
        // repository and SQLite reports that it doesn't exist.
        public void onCreate(SQLiteDatabase db) {

            // Creates the main table
            db.execSQL(SQL_CREATE_MAIN);
        }

        @Override
        public void onUpgrade(SQLiteDatabase sqLiteDatabase, int i, int i1) {
            // TODO: This seems useful. Learn how to use it.
        }
    }

    // Defines a handle to the database helper object. The MainDatabaseHelper class is defined in a
    // following snippet.
    private MainDatabaseHelper openHelper;

    // Holds the database object
    private SQLiteDatabase db;

    @Override
    public boolean onCreate() {
        // Creates a new helper object. This method always returns quickly. Notice that the
        // database itself isn't created or opened until SQLiteOpenHelper.getWritableDatabase
        // is called.
        openHelper = new MainDatabaseHelper(getContext());
        return true;
    }

    @Nullable
    @Override
    public Cursor query(Uri uri, String[] strings, String s, String[] strings1, String s1) {
        return null;
    }

    @Nullable
    @Override
    public String getType(Uri uri) {
        return null;
    }

    @Nullable
    @Override
    public Uri insert(Uri uri, ContentValues contentValues) {
        // Insert code here to determine which table to open, handle error-checking, and so forth
        // ...

        // Gets a writeable database. This will trigger its creation if it doesn't already exist.
        db = openHelper.getWritableDatabase();
        return null;
    }

    @Override
    public int delete(Uri uri, String s, String[] strings) {
        return 0;
    }

    @Override
    public int update(Uri uri, ContentValues contentValues, String s, String[] strings) {
        return 0;
    }
}
{'fraction_non_alphanumeric': 0.07367910809500727, 'fraction_numerical': 0.003877847794474067, 'mean_word_length': 2.7314647377938517, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '2494499', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1026, 'n_words': 392}