<commit_before>package io.cordova.reactnative.mocks;

import android.app.Activity;
import android.content.Intent;

import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;

import java.util.concurrent.ExecutorService;

public class CordovaInterfaceProxy implements CordovaInterface {
    protected Activity activity;
    protected CordovaPlugin activityResultCallback;

    @Override
    public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) {
        setActivityResultCallback(command);
        try {
            activity.startActivityForResult(intent, requestCode);
        } catch (RuntimeException e) { // E.g.: ActivityNotFoundException
            activityResultCallback = null;
            throw e;
        }
    }

    @Override
    public void setActivityResultCallback(CordovaPlugin plugin) {

    }

    @Override
    public Activity getActivity() {
        return this.activity;
    }

    @Override
    public Object onMessage(String id, Object data) {
        return null;
    }

    @Override
    public ExecutorService getThreadPool() {
        return null;
    }

    public void setActivity(Activity activity) {
        this.activity = activity;
    }
}<commit_msg>Enabled a new threadPool for plugins that use threads<commit_after>package io.cordova.reactnative.mocks;

import android.app.Activity;
import android.content.Intent;

import org.apache.cordova.CordovaInterface;
import org.apache.cordova.CordovaPlugin;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class CordovaInterfaceProxy implements CordovaInterface {
    protected Activity activity;
    protected CordovaPlugin activityResultCallback;
    private ExecutorService threadPool;

    @Override
    public void startActivityForResult(CordovaPlugin command, Intent intent, int requestCode) {
        setActivityResultCallback(command);
        try {
            activity.startActivityForResult(intent, requestCode);
        } catch (RuntimeException e) { // E.g.: ActivityNotFoundException
            activityResultCallback = null;
            throw e;
        }
    }

    @Override
    public void setActivityResultCallback(CordovaPlugin plugin) {

    }

    @Override
    public Activity getActivity() {
        return this.activity;
    }

    @Override
    public Object onMessage(String id, Object data) {
        return null;
    }

    @Override
    public ExecutorService getThreadPool() {
        if (this.threadPool == null) {
            this.threadPool = Executors.newCachedThreadPool();
        }
        return this.threadPool;
    }

    public void setActivity(Activity activity) {
        this.activity = activity;
    }
}
{'fraction_non_alphanumeric': 0.07273391812865497, 'fraction_numerical': 0.0, 'mean_word_length': 3.048816568047337, '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': '3145125', 'n_tokens_mistral': 710, 'n_tokens_neox': 694, 'n_words': 172}