<commit_before>package com.example.profbola.bakingtime.services;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;

import com.example.profbola.bakingtime.models.Recipe;
import com.example.profbola.bakingtime.utils.RecipeNetworkUtil;
import com.example.profbola.bakingtime.utils.RecipeParser;

import org.json.JSONArray;

import java.util.List;

/**
 * Created by prof.BOLA on 7/5/2017.
 */

public class RecipeService extends IntentService {


    private static final String NAME = RecipeService.class.getName();

    public static final String ACTION_SYC_RECIPES
            = "com.example.profbola.bakingtime.services.action.sync_recipes";
    /**
     * Creates an IntentService.  Invoked by the superclass's constructor.
     */
    public RecipeService() {
        super(NAME);
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        if (intent != null) {
            final String action = intent.getAction();
            if (ACTION_SYC_RECIPES.equals(action)) {
                handleActionSynRecipes();
            }
        }
    }

    private void handleActionSynRecipes() {
        JSONArray jsonArray = RecipeNetworkUtil.getRecipeFromApi();
        List<Recipe> mRecipes = RecipeParser.parse(jsonArray);

    }

    public static void startActionSyncRecipes(Context context) {
        Intent intent = new Intent(context, RecipeService.class);
        intent.setAction(ACTION_SYC_RECIPES);
        context.startService(intent);
    }
}
<commit_msg>Modify RecipeService to Sync to DB<commit_after>package com.example.profbola.bakingtime.services;

import android.app.IntentService;
import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;

import com.example.profbola.bakingtime.models.Recipe;
import com.example.profbola.bakingtime.utils.RecipeNetworkUtil;
import com.example.profbola.bakingtime.utils.RecipeParser;

import org.json.JSONArray;

import java.util.List;

/**
 * Created by prof.BOLA on 7/5/2017.
 */

public class RecipeService extends IntentService {


    private static final String NAME = RecipeService.class.getName();

    public static final String ACTION_SYC_RECIPES
            = "com.example.profbola.bakingtime.services.action.sync_recipes";
    /**
     * Creates an IntentService.  Invoked by the superclass's constructor.
     */
    public RecipeService() {
        super(NAME);
    }

    @Override
    protected void onHandleIntent(@Nullable Intent intent) {
        if (intent != null) {
            final String action = intent.getAction();
            if (ACTION_SYC_RECIPES.equals(action)) {
                handleActionSynRecipes();
            }
        }
    }

    private void handleActionSynRecipes() {
        RecipeTasks.writeRecipes(this);
    }

    public static void startActionSyncRecipes(Context context) {
        Intent intent = new Intent(context, RecipeService.class);
        intent.setAction(ACTION_SYC_RECIPES);
        context.startService(intent);
    }
}

{'fraction_non_alphanumeric': 0.0941024814695456, 'fraction_numerical': 0.003867225265871737, 'mean_word_length': 3.1889338731443995, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '2146425', 'n_tokens_mistral': 927, 'n_tokens_neox': 889, 'n_words': 180}