<commit_before>package com.gaiagps.iburn;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by davidbrodsky on 7/1/15.
 */
public class PrefsHelper {

    private static final String SHOWED_WELCOME = "welcomed";                // boolean
    private static final String POPULATED_DB_VERSION = "db_populated_ver";  // long
    private static final String VALID_UNLOCK_CODE = "unlocked_2015";        // boolean

    private static final String SHARED_PREFS_NAME = PrefsHelper.class.getSimpleName();

    private SharedPreferences sharedPrefs;
    private SharedPreferences.Editor editor;

    public PrefsHelper(Context context) {
        sharedPrefs = context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
        editor = sharedPrefs.edit();
    }

    /**
     * @return whether a valid unlock code has been presented for this year
     */
    public boolean enteredValidUnlockCode() {
        return sharedPrefs.getBoolean(VALID_UNLOCK_CODE, false);
    }

    public void setEnteredValidUnlockCode(boolean didEnter) {
        editor.putBoolean(VALID_UNLOCK_CODE, didEnter);
    }

    public boolean didShowWelcome() {
        return sharedPrefs.getBoolean(SHOWED_WELCOME, true);
    }

    public void setDidShowWelcome(boolean didShow) {
        editor.putBoolean(SHOWED_WELCOME, didShow).apply();
    }

    public void setDatabaseVersion(long version) {
        editor.putLong(POPULATED_DB_VERSION, version);
        editor.commit();
    }

    public long getDatabaseVersion() {
        return sharedPrefs.getLong(POPULATED_DB_VERSION, 0);
    }
}<commit_msg>PrefsHelper add missing apply()<commit_after>package com.gaiagps.iburn;

import android.content.Context;
import android.content.SharedPreferences;

/**
 * Created by davidbrodsky on 7/1/15.
 */
public class PrefsHelper {

    private static final String SHOWED_WELCOME = "welcomed";                // boolean
    private static final String POPULATED_DB_VERSION = "db_populated_ver";  // long
    private static final String VALID_UNLOCK_CODE = "unlocked_2015";        // boolean

    private static final String SHARED_PREFS_NAME = PrefsHelper.class.getSimpleName();

    private SharedPreferences sharedPrefs;
    private SharedPreferences.Editor editor;

    public PrefsHelper(Context context) {
        sharedPrefs = context.getSharedPreferences(SHARED_PREFS_NAME, Context.MODE_PRIVATE);
        editor = sharedPrefs.edit();
    }

    /**
     * @return whether a valid unlock code has been presented for this year
     */
    public boolean enteredValidUnlockCode() {
        return sharedPrefs.getBoolean(VALID_UNLOCK_CODE, false);
    }

    public void setEnteredValidUnlockCode(boolean didEnter) {
        editor.putBoolean(VALID_UNLOCK_CODE, didEnter).apply();
    }

    public boolean didShowWelcome() {
        return sharedPrefs.getBoolean(SHOWED_WELCOME, true);
    }

    public void setDidShowWelcome(boolean didShow) {
        editor.putBoolean(SHOWED_WELCOME, didShow).apply();
    }

    public void setDatabaseVersion(long version) {
        editor.putLong(POPULATED_DB_VERSION, version);
        editor.commit();
    }

    public long getDatabaseVersion() {
        return sharedPrefs.getLong(POPULATED_DB_VERSION, 0);
    }
}
{'fraction_non_alphanumeric': 0.08333333333333333, 'fraction_numerical': 0.005494505494505495, 'mean_word_length': 3.3986577181208055, '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': '3134965', 'n_tokens_mistral': 991, 'n_tokens_neox': 939, 'n_words': 211}