<commit_before>package nl.nberlijn.powercontrol.services.command;

import javafx.concurrent.Task;

import javafx.concurrent.WorkerStateEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Alert;
import nl.nberlijn.powercontrol.models.CommandModel;
import nl.nberlijn.powercontrol.ssh.SSHClientExecutor;

public class CommandTask extends Task<Boolean> {

    private CommandModel commandModel;

    public CommandTask(String command) {
        this.commandModel = new CommandModel(command);

        setOnSucceeded(new EventHandler<WorkerStateEvent>() {
            @Override
            public void handle(WorkerStateEvent event) {
                if (getValue().equals(true)) {
                    alertMessage(Alert.AlertType.INFORMATION, "Succeeded", "Succeeded", "The command " + commandModel.getName() + " has been successful executed");
                } else {
                    alertMessage(Alert.AlertType.ERROR, "Failed", "Failed", "Something went wrong while executing the " + commandModel.getName() + " command");
                }
            }
        });
    }

    @Override
    protected Boolean call() {
        try {
            new SSHClientExecutor(commandModel).execute();
        } catch (Exception e) {
            return false;
        }

        return true;
    }

    private void alertMessage(Alert.AlertType type, String title, String headerText, String contentText) {
        Alert alert = new Alert(type);
        alert.setTitle(title);
        alert.setHeaderText(headerText);
        alert.setContentText(contentText);
        alert.showAndWait();
    }

}
<commit_msg>Command name changed to lowercase<commit_after>package nl.nberlijn.powercontrol.services.command;

import javafx.concurrent.Task;

import javafx.concurrent.WorkerStateEvent;
import javafx.event.EventHandler;
import javafx.scene.control.Alert;
import nl.nberlijn.powercontrol.models.CommandModel;
import nl.nberlijn.powercontrol.ssh.SSHClientExecutor;

public class CommandTask extends Task<Boolean> {

    private CommandModel commandModel;

    public CommandTask(String command) {
        this.commandModel = new CommandModel(command);

        setOnSucceeded(new EventHandler<WorkerStateEvent>() {
            @Override
            public void handle(WorkerStateEvent event) {
                if (getValue().equals(true)) {
                    alertMessage(Alert.AlertType.INFORMATION, "Succeeded", "Succeeded", "The command " + commandModel.getName().toLowerCase() + " has been successful executed");
                } else {
                    alertMessage(Alert.AlertType.ERROR, "Failed", "Failed", "Something went wrong while executing the " + commandModel.getName().toLowerCase() + " command");
                }
            }
        });
    }

    @Override
    protected Boolean call() {
        try {
            new SSHClientExecutor(commandModel).execute();
        } catch (Exception e) {
            return false;
        }

        return true;
    }

    private void alertMessage(Alert.AlertType type, String title, String headerText, String contentText) {
        Alert alert = new Alert(type);
        alert.setTitle(title);
        alert.setHeaderText(headerText);
        alert.setContentText(contentText);
        alert.showAndWait();
    }

}

{'fraction_non_alphanumeric': 0.09848024316109423, 'fraction_numerical': 0.0, 'mean_word_length': 2.6936026936026938, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '6649232', 'n_tokens_mistral': 878, 'n_tokens_neox': 849, 'n_words': 186}