<commit_before>package no.nordicsemi.actuators;

import android.content.Context;

import org.droidparts.Injector;
import org.droidparts.annotation.inject.InjectDependency;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;

public abstract class Actuator {

    @InjectDependency
    Context mContext;

    private static HashMap<Integer, Actuator> mActuators;

    static {
        mActuators = createActuatorList();
    }

    public abstract int getId();

    public Actuator() {
        Injector.inject(mContext, this);
    }

    abstract void actuate(JSONObject arguments) throws JSONException;

    public static void actuate(int actuatorId, String arguments) throws JSONException {
        mActuators.get(actuatorId).actuate(arguments);
    }

    public void actuate(String arguments) throws JSONException {
        actuate(new JSONObject(arguments));<commit_msg>Fix Actuator injection<commit_after>package no.nordicsemi.actuators;

import android.content.Context;

import org.droidparts.Injector;
import org.droidparts.annotation.inject.InjectDependency;
import org.json.JSONException;
import org.json.JSONObject;

import java.util.HashMap;

public abstract class Actuator {

    @InjectDependency
    Context mContext;

    private static HashMap<Integer, Actuator> mActuators;

    static {
        mActuators = createActuatorList();
    }

    public abstract int getId();

    public Actuator() {
        Injector.inject(Injector.getApplicationContext(), this);
    }

    abstract void actuate(JSONObject arguments) throws JSONException;

    public static void actuate(int actuatorId, String arguments) throws JSONException {
        mActuators.get(actuatorId).actuate(arguments);
    }

    public void actuate(String arguments) throws JSONException {
        actuate(new JSONObject(arguments));
{'fraction_non_alphanumeric': 0.08175419599350298, 'fraction_numerical': 0.0, 'mean_word_length': 4.076923076923077, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '4738757', 'n_tokens_mistral': 537, 'n_tokens_neox': 525, 'n_words': 123}