<commit_before>package net.krinsoft.chat.targets;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import net.krinsoft.chat.PlayerManager;
import net.krinsoft.chat.api.Target;
import net.krinsoft.chat.util.Replacer;
import net.krinsoft.chat.util.Replacer.Handler;

import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import com.herocraftonline.dev.heroes.Heroes;
import com.herocraftonline.dev.heroes.persistence.Hero;

/**
 *
 * @author krinsdeath
 */
@SuppressWarnings("javadoc")
public class ChatPlayer implements Target {
    private static class NodeGrabber implements Replacer.Handler {
        final String node;

        NodeGrabber(final String node) {
            this.node = node;
        }

        @Override
        public String getValue(final Object... scope) {
            String value = ((ConfigurationSection) scope[2]).getString(node);
            if (value == null) {
                value = ((ConfigurationSection) scope[1]).getString(node);
            }
            return value;
        }
    }

    public enum Type {
        GLOBAL("global"),
        NORMAL("normal"),
        WHISPER_RECEIVE("whisper_receive"),
        WHISPER_SEND("whisper_send");

        private String type;

        private Type(final String type) {
            this.type = type;
        }

        public String getName() {
            return this.type;
        }

    }
    private final static Replacer[] replacers;
    private final static Replacer[] replacers_whisper;
    static {
        final Handler AFK = new NodeGrabber("afk");
        final Handler GROUP = new NodeGrabber("group");<commit_msg>Actually fixed the NullPointerException instead of just ignoring it.<commit_after>package net.krinsoft.chat.targets;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

import net.krinsoft.chat.PlayerManager;
import net.krinsoft.chat.api.Target;
import net.krinsoft.chat.util.Replacer;
import net.krinsoft.chat.util.Replacer.Handler;

import org.bukkit.ChatColor;
import org.bukkit.configuration.ConfigurationSection;
import org.bukkit.entity.Player;
import org.bukkit.plugin.Plugin;

import com.herocraftonline.dev.heroes.Heroes;
import com.herocraftonline.dev.heroes.persistence.Hero;

/**
 *
 * @author krinsdeath
 */
@SuppressWarnings("javadoc")
public class ChatPlayer implements Target {
    private static class NodeGrabber implements Replacer.Handler {
        final String node;

        NodeGrabber(final String node) {
            this.node = node;
        }

        @Override
        public String getValue(final Object... scope) {
            String value = null;
            if (scope[2] != null) {
                value = ((ConfigurationSection) scope[2]).getString(node);
            }
            if (value == null) {
                value = ((ConfigurationSection) scope[1]).getString(node);
            }
            return value;
        }
    }

    public enum Type {
        GLOBAL("global"),
        NORMAL("normal"),
        WHISPER_RECEIVE("whisper_receive"),
        WHISPER_SEND("whisper_send");

        private String type;

        private Type(final String type) {
            this.type = type;
        }

        public String getName() {
            return this.type;
        }

    }
    private final static Replacer[] replacers;
    private final static Replacer[] replacers_whisper;
    static {
        final Handler AFK = new NodeGrabber("afk");
        final Handler GROUP = new NodeGrabber("group");
{'fraction_non_alphanumeric': 0.10305653232350555, 'fraction_numerical': 0.001352447930754666, 'mean_word_length': 2.6361848574237956, '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': '5040878', 'n_tokens_mistral': 1108, 'n_tokens_neox': 1069, 'n_words': 240}