<commit_before>package engineer.carrot.warren.thump.cursevoice;

import engineer.carrot.warren.thump.api.IThumpMinecraftSink;
import engineer.carrot.warren.thump.helper.LogHelper;
import net.minecraft.util.StringUtils;

/**
 * Created by progwml6 on 7/4/16.
 */
public class CurseIntegration {
    protected String username;
    protected String password;
    protected String serverName;
    protected String channelName;
    protected IThumpMinecraftSink sink;
    private CurseThread thread;

    public CurseIntegration (String username, String password, String serverName, String channelName, IThumpMinecraftSink sink) {
        this.username = username;
        this.password = password;
        this.serverName = serverName;
        this.channelName = channelName;
        this.sink = sink;

    }

    public void setUsername (String user) {
        this.username = username;
    }

    public void setPassword (String pass) {
        this.password = <PASSWORD>;
    }

    public void setChannelName (String name) {
        this.channelName = name;
    }

    public void setServerName (String name) {
        this.serverName = name;
    }

    public void setSink (IThumpMinecraftSink sink) {
        this.sink = sink;
    }

    public void init () {
        LogHelper.info("starting up curse integration");
        if (!StringUtils.isNullOrEmpty(username) && !StringUtils.isNullOrEmpty(password)) {
            thread = new CurseThread(this);
            thread.setName("Thump - Curse");
            thread.start();
            LogHelper.info("CV plugin has started up");
        } else {
            LogHelper.info("not starting curse plugin as user/password was null or empty");
        }
    }

    public void sendToCurse (String message) {
        if (thread != null && thread.webSocket != null && thread.channel != null) {
            if (message == null) {
               LogHelper.info("Don't attempt to send null messages!!!!!");
            } else {
                thread.webSocket.sendMessage(thread.channel, message);
            }
        } else {
            LogHelper.error("curse thread not configured. Could not send message {} to curse", message);
        }
    }

    public void shutdown () {
        //TODO logout??
        thread.interrupt();
    }

}<commit_msg>don't attempt to interrupt the thread if it doesn't exist<commit_after>package engineer.carrot.warren.thump.cursevoice;

import engineer.carrot.warren.thump.api.IThumpMinecraftSink;
import engineer.carrot.warren.thump.helper.LogHelper;
import net.minecraft.util.StringUtils;

/**
 * Created by progwml6 on 7/4/16.
 */
public class CurseIntegration {
    protected String username;
    protected String password;
    protected String serverName;
    protected String channelName;
    protected IThumpMinecraftSink sink;
    private CurseThread thread;

    public CurseIntegration (String username, String password, String serverName, String channelName, IThumpMinecraftSink sink) {
        this.username = username;
        this.password = password;
        this.serverName = serverName;
        this.channelName = channelName;
        this.sink = sink;

    }

    public void setUsername (String user) {
        this.username = username;
    }

    public void setPassword (String pass) {
        this.password = <PASSWORD>;
    }

    public void setChannelName (String name) {
        this.channelName = name;
    }

    public void setServerName (String name) {
        this.serverName = name;
    }

    public void setSink (IThumpMinecraftSink sink) {
        this.sink = sink;
    }

    public void init () {
        LogHelper.info("starting up curse integration");
        if (!StringUtils.isNullOrEmpty(username) && !StringUtils.isNullOrEmpty(password)) {
            thread = new CurseThread(this);
            thread.setName("Thump - Curse");
            thread.start();
            LogHelper.info("CV plugin has started up");
        } else {
            LogHelper.info("not starting curse plugin as user/password was null or empty");
        }
    }

    public void sendToCurse (String message) {
        if (thread != null && thread.webSocket != null && thread.channel != null) {
            if (message == null) {
                LogHelper.info("Don't attempt to send null messages!!!!!");
            } else {
                thread.webSocket.sendMessage(thread.channel, message);
            }
        } else {
            LogHelper.error("curse thread not configured. Could not send message {} to curse", message);
        }
    }

    public void shutdown () {
        //TODO logout??
        if (thread != null) {
            thread.interrupt();
        }
    }

}
{'fraction_non_alphanumeric': 0.09818569903948772, 'fraction_numerical': 0.0021344717182497333, 'mean_word_length': 2.378514780100937, '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': '1795451', 'n_tokens_mistral': 1301, 'n_tokens_neox': 1272, 'n_words': 342}