<commit_before>package ca.carleton.gcrc.n2android_mobile1.cordova;

import android.app.Activity;
import android.util.Log;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

import java.util.List;
import java.util.Vector;
import java.util.concurrent.ExecutorService;

import ca.carleton.gcrc.n2android_mobile1.connection.Connection;
import ca.carleton.gcrc.n2android_mobile1.connection.DocumentDb;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseDocInfo;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseLiteService;
import ca.carleton.gcrc.n2android_mobile1.connection.ConnectionInfo;
import ca.carleton.gcrc.n2android_mobile1.activities.EmbeddedCordovaActivity;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseManager;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseQuery;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseQueryResults;

/**
 * Created by jpfiset on 3/14/16.
 */
public class CordovaNunaliitPlugin extends CordovaPlugin {

    final protected String TAG = this.getClass().getSimpleName();

    private CordovaInterface cordovaInterface = null;
    private PluginActions actions = null;

    @Override
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
        super.initialize(cordova, webView);

        this.cordovaInterface = cordova;
        Log.v(TAG,"Cordova Interface: "+cordova.getClass().getSimpleName());

        this.actions = new PluginActions(cordovaInterface);

        Activity activity = cordova.getActivity();
        if( null != activity ){
            Log.v(TAG, "Activity: " + activity.getClass().getSimpleName());
        }
    }

    @Override
    public void pluginInitialize() {
        Log.i(TAG, "Plugin initialized. Service name: " + getServiceName());
    }

    @Override
    public boolean execute(String action, org.json.JSONArray args, CallbackContext callbackContext) throws JSONException {
        Log.v(TAG, "Action: " + action);


        ExecutorService threadPool = this.cordovaInterface.getThreadPool();

        if( "echo".equals(action) ) {
            threadPool.execute(new PluginRunnable(actions, args, callbackContext) {
                @Override
                public void pluginRun() throws Exception {
                    String message = getArguments().getString(0);
                    getActions().echo(message, getCallbackContext());
                }
            });
            return true;

        } else if( "getConnectionInfo".equals(action) ) {
            threadPool.execute(new PluginRunnable(actions, args, callbackContext) {
                @Override
                public void pluginRun() throws Exception {
                    getActions().getConnectionInfo(getCallbackContext());
                }
            });
            return true;
<commit_msg>Remove unnecessary package qualification from type<commit_after>package ca.carleton.gcrc.n2android_mobile1.cordova;

import android.app.Activity;
import android.util.Log;

import org.apache.cordova.CallbackContext;
import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;
import org.apache.cordova.CordovaWebView;
import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.json.JSONTokener;

import java.util.List;
import java.util.Vector;
import java.util.concurrent.ExecutorService;

import ca.carleton.gcrc.n2android_mobile1.connection.Connection;
import ca.carleton.gcrc.n2android_mobile1.connection.DocumentDb;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseDocInfo;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseLiteService;
import ca.carleton.gcrc.n2android_mobile1.connection.ConnectionInfo;
import ca.carleton.gcrc.n2android_mobile1.activities.EmbeddedCordovaActivity;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseManager;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseQuery;
import ca.carleton.gcrc.n2android_mobile1.couchbase.CouchbaseQueryResults;

/**
 * Created by jpfiset on 3/14/16.
 */
public class CordovaNunaliitPlugin extends CordovaPlugin {

    final protected String TAG = this.getClass().getSimpleName();

    private CordovaInterface cordovaInterface = null;
    private PluginActions actions = null;

    @Override
    public void initialize(CordovaInterface cordova, CordovaWebView webView) {
        super.initialize(cordova, webView);

        this.cordovaInterface = cordova;
        Log.v(TAG,"Cordova Interface: "+cordova.getClass().getSimpleName());

        this.actions = new PluginActions(cordovaInterface);

        Activity activity = cordova.getActivity();
        if( null != activity ){
            Log.v(TAG, "Activity: " + activity.getClass().getSimpleName());
        }
    }

    @Override
    public void pluginInitialize() {
        Log.i(TAG, "Plugin initialized. Service name: " + getServiceName());
    }

    @Override
    public boolean execute(String action, JSONArray args, CallbackContext callbackContext) throws JSONException {
        Log.v(TAG, "Action: " + action);


        ExecutorService threadPool = this.cordovaInterface.getThreadPool();

        if( "echo".equals(action) ) {
            threadPool.execute(new PluginRunnable(actions, args, callbackContext) {
                @Override
                public void pluginRun() throws Exception {
                    String message = getArguments().getString(0);
                    getActions().echo(message, getCallbackContext());
                }
            });
            return true;

        } else if( "getConnectionInfo".equals(action) ) {
            threadPool.execute(new PluginRunnable(actions, args, callbackContext) {
                @Override
                public void pluginRun() throws Exception {
                    getActions().getConnectionInfo(getCallbackContext());
                }
            });
            return true;

{'fraction_non_alphanumeric': 0.0974342318934719, 'fraction_numerical': 0.008444300097434233, 'mean_word_length': 3.3495762711864407, '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': '2658029', 'n_tokens_mistral': 1773, 'n_tokens_neox': 1711, 'n_words': 319}