<commit_before>package forager.client;

import java.lang.ProcessBuilder.Redirect;

import forager.events.TaskSpec;

public class TaskThread implements Runnable {

    private TaskSpec task;
    private Forager forager;

    public TaskThread(TaskSpec task, Forager forager) {
        this.task = task;
        this.forager = forager;
    }

    public void run() {
        try {
            String[] command = task.command.split("\\s+");
            ProcessBuilder pb = new ProcessBuilder(command);

            pb.redirectOutput(Redirect.INHERIT);
            pb.redirectError(Redirect.INHERIT);

            Process p = pb.start();
            p.waitFor();
            forager.finalizeTask(task);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
<commit_msg>Retrieve process exit status<commit_after>package forager.client;

import java.lang.ProcessBuilder.Redirect;

import forager.events.TaskSpec;

public class TaskThread implements Runnable {

    private TaskSpec task;
    private Forager forager;

    public TaskThread(TaskSpec task, Forager forager) {
        this.task = task;
        this.forager = forager;
    }

    public void run() {
        try {
            String[] command = task.command.split("\\s+");
            ProcessBuilder pb = new ProcessBuilder(command);

            pb.redirectOutput(Redirect.INHERIT);
            pb.redirectError(Redirect.INHERIT);

            Process p = pb.start();
            int i = p.waitFor();

            forager.finalizeTask(task);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}

{'fraction_non_alphanumeric': 0.1011166253101737, 'fraction_numerical': 0.0, 'mean_word_length': 2.1627450980392156, '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': '4132907', 'n_tokens_mistral': 451, 'n_tokens_neox': 441, 'n_words': 101}