<commit_before>package sleepyweasel.purplefluffernutter.storage;

import android.content.ContentProvider;
import android.content.ContentUris;
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 java.util.ArrayList;

import sleepyweasel.purplefluffernutter.MovieEntry;
import sleepyweasel.purplefluffernutter.MovieEntryStorage;

public class MovieContentProvider extends ContentProvider implements MovieEntryStorage {

    private static final String MOVIES_TABLE_NAME = "movies";
    private static final String PROVIDER_NAME = "sleepyweasel.purplefluffernutter.MoviesProvider";
    private static final String URL = "content://" + PROVIDER_NAME + "/movies";
    private static final Uri CONTENT_URI = Uri.parse(URL);

    static final String TITLE_COLUMN_NAME = "title";
    static final String YEAR_COLUMN_NAME = "year";

    @Override
    public boolean onCreate() {
        Context context = getContext();
        DatabaseHelper databaseHelper = new DatabaseHelper(context);
        database = databaseHelper.getWritableDatabase();
        return (database != null);
    }

    @Override
    public boolean isEmpty() {
        return true;
    }

    @Override
    public void addMovie(MovieEntry entry) {
        ContentValues values = new ContentValues();
        values.put(TITLE_COLUMN_NAME, entry.getTitle());
        values.put(YEAR_COLUMN_NAME, entry.getYear());
        insert(CONTENT_URI, values);
    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public MovieEntry getEntry(int id) {
        return null;
    }

    @Override
    public MovieEntry getEntryByTitle(String movieTitle) {
        return null;
    }

    @Override
    public void clear() {

    }

    @Override
    public ArrayList<String> getMovieTitles() {
        return null;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        return null;
    }

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

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        long rowID = database.insert(MOVIES_TABLE_NAME, "", values);
        if (rowID > 0) {
            Uri changeUri = ContentUris.withAppendedId(CONTENT_URI, rowID);
            getContext().getContentResolver().notifyChange(changeUri, null);
            return changeUri;
        }
        return null;
    }

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

    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        return 0;
    }

    private SQLiteDatabase database;

    private static class DatabaseHelper extends SQLiteOpenHelper {

        private static final int DATABASE_VERSION = 1;
        private static final String DATABASE_NAME = "Repository";
        private static final String CREATE_DB_TABLE = " CREATE TABLE " + MOVIES_TABLE_NAME +
                " (_id INTEGER PRIMARY KEY AUTOINCREMENT, title TEXT NOT NULL, year TEXT NOT NULL);";

        public DatabaseHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            db.execSQL(CREATE_DB_TABLE);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            db.execSQL("DROP TABLE IF EXISTS movies");
            onCreate(db);
        }
    }
}<commit_msg>Reorganize MovieContentProvider class<commit_after>package sleepyweasel.purplefluffernutter.storage;

import android.content.ContentProvider;
import android.content.ContentUris;
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 java.util.ArrayList;

import sleepyweasel.purplefluffernutter.MovieEntry;
import sleepyweasel.purplefluffernutter.MovieEntryStorage;

public class MovieContentProvider extends ContentProvider implements MovieEntryStorage {

    public static final String PROVIDER_NAME = "sleepyweasel.purplefluffernutter.MoviesProvider";

    private static final String URL = "content://" + PROVIDER_NAME + "/movies";
    private static final Uri CONTENT_URI = Uri.parse(URL);

    private SQLiteDatabase database;

    static final String TITLE_COLUMN_NAME = "title";
    static final String YEAR_COLUMN_NAME = "year";

    private static final String MOVIES_TABLE_NAME = "movies";

    private static class DatabaseHelper extends SQLiteOpenHelper {

        private static final int DATABASE_VERSION = 1;
        private static final String DATABASE_NAME = "Repository";
        private static final String ID_COLUMN = "_id INTEGER PRIMARY KEY AUTOINCREMENT";
        private static final String TITLE_COLUMN = TITLE_COLUMN_NAME + " TEXT NOT NULL";
        private static final String YEAR_COLUMN = YEAR_COLUMN_NAME + " TEXT NOT NULL";

        public DatabaseHelper(Context context) {
            super(context, DATABASE_NAME, null, DATABASE_VERSION);
        }

        @Override
        public void onCreate(SQLiteDatabase db) {
            String CREATE_DB_TABLE = " CREATE TABLE " + MOVIES_TABLE_NAME +
                    " ( " + ID_COLUMN + ", " + TITLE_COLUMN + ", " + YEAR_COLUMN + ");";
            db.execSQL(CREATE_DB_TABLE);
        }

        @Override
        public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
            db.execSQL("DROP TABLE IF EXISTS movies");
            onCreate(db);
        }
    }

    @Override
    public boolean onCreate() {
        Context context = getContext();
        DatabaseHelper databaseHelper = new DatabaseHelper(context);
        database = databaseHelper.getWritableDatabase();
        return (database != null);
    }

    @Override
    public boolean isEmpty() {
        return true;
    }

    @Override
    public void addMovie(MovieEntry entry) {
        ContentValues values = new ContentValues();
        values.put(TITLE_COLUMN_NAME, entry.getTitle());
        values.put(YEAR_COLUMN_NAME, entry.getYear());
        insert(CONTENT_URI, values);
    }

    @Override
    public int size() {
        return 0;
    }

    @Override
    public MovieEntry getEntry(int id) {
        return null;
    }

    @Override
    public MovieEntry getEntryByTitle(String movieTitle) {
        return null;
    }

    @Override
    public void clear() {

    }

    @Override
    public ArrayList<String> getMovieTitles() {
        return null;
    }

    @Override
    public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder) {
        return null;
    }

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

    @Override
    public Uri insert(Uri uri, ContentValues values) {
        long rowID = database.insert(MOVIES_TABLE_NAME, "", values);
        if (rowID > 0) {
            Uri changeUri = ContentUris.withAppendedId(CONTENT_URI, rowID);
            getContext().getContentResolver().notifyChange(changeUri, null);
            return changeUri;
        }
        return null;
    }

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

    @Override
    public int update(Uri uri, ContentValues values, String selection, String[] selectionArgs) {
        return 0;
    }
}
{'fraction_non_alphanumeric': 0.08180170851669687, 'fraction_numerical': 0.0012943308309603934, 'mean_word_length': 2.9064711830131444, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 7, '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': '3754925', 'n_tokens_mistral': 2199, 'n_tokens_neox': 2094, 'n_words': 565}