<commit_before>package edu.cmu.sv.trailscribe.controller;

import java.util.ArrayList;
import java.util.List;

import android.os.AsyncTask;

import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import edu.cmu.sv.trailscribe.dao.KmlDataSource;
import edu.cmu.sv.trailscribe.dao.MapDataSource;
import edu.cmu.sv.trailscribe.model.AsyncTaskCompleteListener;
import edu.cmu.sv.trailscribe.model.data.Kml;
import edu.cmu.sv.trailscribe.model.data.Map;
import edu.cmu.sv.trailscribe.model.data.SyncItem;
import edu.cmu.sv.trailscribe.model.data.SyncItems;
import edu.cmu.sv.trailscribe.utils.BackendFacade;
import edu.cmu.sv.trailscribe.utils.SyncItemSerializer;
import edu.cmu.sv.trailscribe.view.TrailScribeApplication;

public class SynchronizationCenterController 
	extends AsyncTask<String, Void, Void> implements AsyncTaskCompleteListener<String>{
	
	private final String endpoint = "http://trail-scribe.mlep.net/sync/";
	private AsyncTaskCompleteListener<ArrayList<SyncItem>> mTaskCompletedCallback;
	MapDataSource mMapsDataSource = new MapDataSource(TrailScribeApplication.mDBHelper);
	KmlDataSource mKmlsDataSource = new KmlDataSource(TrailScribeApplication.mDBHelper);
	
	public SynchronizationCenterController(AsyncTaskCompleteListener<ArrayList<SyncItem>> callback){
		this.mTaskCompletedCallback = callback;
	}
	
	// This method is invoked by the BackendFacade once the response from the backend is available
	@Override
	public void onTaskCompleted(String syncResult) {
		ArrayList<SyncItem> itemsToSync = null;

		JsonParser jsonParser = new JsonParser();<commit_msg>Refactoring. Removing import of class SyncItems already removed<commit_after>package edu.cmu.sv.trailscribe.controller;

import java.util.ArrayList;
import java.util.List;

import android.os.AsyncTask;

import com.google.gson.GsonBuilder;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;

import edu.cmu.sv.trailscribe.dao.KmlDataSource;
import edu.cmu.sv.trailscribe.dao.MapDataSource;
import edu.cmu.sv.trailscribe.model.AsyncTaskCompleteListener;
import edu.cmu.sv.trailscribe.model.data.Kml;
import edu.cmu.sv.trailscribe.model.data.Map;
import edu.cmu.sv.trailscribe.model.data.SyncItem;
import edu.cmu.sv.trailscribe.utils.BackendFacade;
import edu.cmu.sv.trailscribe.utils.SyncItemSerializer;
import edu.cmu.sv.trailscribe.view.TrailScribeApplication;

public class SynchronizationCenterController 
	extends AsyncTask<String, Void, Void> implements AsyncTaskCompleteListener<String>{
	
	private final String endpoint = "http://trail-scribe.mlep.net/sync/";
	private AsyncTaskCompleteListener<ArrayList<SyncItem>> mTaskCompletedCallback;
	MapDataSource mMapsDataSource = new MapDataSource(TrailScribeApplication.mDBHelper);
	KmlDataSource mKmlsDataSource = new KmlDataSource(TrailScribeApplication.mDBHelper);
	
	public SynchronizationCenterController(AsyncTaskCompleteListener<ArrayList<SyncItem>> callback){
		this.mTaskCompletedCallback = callback;
	}
	
	// This method is invoked by the BackendFacade once the response from the backend is available
	@Override
	public void onTaskCompleted(String syncResult) {
		ArrayList<SyncItem> itemsToSync = null;

		JsonParser jsonParser = new JsonParser();
{'fraction_non_alphanumeric': 0.09246171967020024, 'fraction_numerical': 0.0, 'mean_word_length': 6.599552572706935, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, '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': '3232606', 'n_tokens_mistral': 1091, 'n_tokens_neox': 1068, 'n_words': 194}