<commit_before>package net.craftminecraft.bungee.bungeeban.command;

import net.craftminecraft.bungee.bungeeban.BanManager;
import net.craftminecraft.bungee.bungeeban.BungeeBan;
import net.craftminecraft.bungee.bungeeban.banstore.BanEntry;
import net.craftminecraft.bungee.bungeeban.banstore.FileBanStore;
import net.craftminecraft.bungee.bungeeban.banstore.IBanStore;
import net.craftminecraft.bungee.bungeeban.banstore.MySQLBanStore;
import net.craftminecraft.bungee.bungeeban.util.MainConfig;
import net.craftminecraft.bungee.bungeeban.util.Utils;
import net.craftminecraft.bungee.bungeeyaml.InvalidConfigurationException;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Command;

public class MigrateCommand extends Command {
	BungeeBan plugin;
	public MigrateCommand(BungeeBan plugin) {
		super("migrate", "bans.command.importbans");
		this.plugin = plugin;
	}
	
	@Override
	public void execute(CommandSender sender, String[] args) {
		if (sender instanceof ProxiedPlayer) {
			if (!Utils.hasPermission(sender, "migrate", "")) {
				return;
			}
		}
		if (args.length != 1) {
			sender.sendMessage(ChatColor.RED + "Wrong command format. <required> [optional]");
			sender.sendMessage(ChatColor.RED + "/migrate <mysql|file>");
			return;
		}
		IBanStore store;
		if (args[0] == "file") {
			store = new FileBanStore();
		} else if (args[0] == "mysql") {
			store = new MySQLBanStore(this.plugin.getLogger(), MainConfig.getInstance());
		} else {
			sender.sendMessage(ChatColor.RED + "Wrong command format. <required> [optional]");
			sender.sendMessage(ChatColor.RED + "/migrate <mysql|file>");
			return;
		}
		for (BanEntry entry : BanManager.getBanList()) {
			store.ban(entry);
		}
		BanManager.setBanStore(store);
		MainConfig.getInstance().storagetype = args[0];
		try {
			MainConfig.getInstance().save();
		} catch (InvalidConfigurationException e) {
			e.printStackTrace();
		}
		sender.sendMessage("Bans successfully moved to new banstore type");
	}
}<commit_msg>Fix equalty check to make java happy. I hate you java, to be so illogical. You may die in agony, stupid language.<commit_after>package net.craftminecraft.bungee.bungeeban.command;

import net.craftminecraft.bungee.bungeeban.BanManager;
import net.craftminecraft.bungee.bungeeban.BungeeBan;
import net.craftminecraft.bungee.bungeeban.banstore.BanEntry;
import net.craftminecraft.bungee.bungeeban.banstore.FileBanStore;
import net.craftminecraft.bungee.bungeeban.banstore.IBanStore;
import net.craftminecraft.bungee.bungeeban.banstore.MySQLBanStore;
import net.craftminecraft.bungee.bungeeban.util.MainConfig;
import net.craftminecraft.bungee.bungeeban.util.Utils;
import net.craftminecraft.bungee.bungeeyaml.InvalidConfigurationException;
import net.md_5.bungee.api.ChatColor;
import net.md_5.bungee.api.CommandSender;
import net.md_5.bungee.api.connection.ProxiedPlayer;
import net.md_5.bungee.api.plugin.Command;

public class MigrateCommand extends Command {
	BungeeBan plugin;
	public MigrateCommand(BungeeBan plugin) {
		super("migrate", "bans.command.importbans");
		this.plugin = plugin;
	}
	
	@Override
	public void execute(CommandSender sender, String[] args) {
		if (sender instanceof ProxiedPlayer) {
			if (!Utils.hasPermission(sender, "migrate", "")) {
				return;
			}
		}
		if (args.length != 1) {
			sender.sendMessage(ChatColor.RED + "Wrong command format. <required> [optional]");
			sender.sendMessage(ChatColor.RED + "/migrate <mysql|file>");
			return;
		}
		IBanStore store;
		if (args[0].equals("file")) {
			store = new FileBanStore();
		} else if (args[0].equals("mysql")) {
			store = new MySQLBanStore(this.plugin.getLogger(), MainConfig.getInstance());
		} else {
			sender.sendMessage(ChatColor.RED + "Wrong command format. <required> [optional]");
			sender.sendMessage(ChatColor.RED + "/migrate <mysql|file>");
			return;
		}
		for (BanEntry entry : BanManager.getBanList()) {
			store.ban(entry);
		}
		BanManager.setBanStore(store);
		MainConfig.getInstance().storagetype = args[0];
		try {
			MainConfig.getInstance().save();
		} catch (InvalidConfigurationException e) {
			e.printStackTrace();
		}
		sender.sendMessage("Bans successfully moved to new banstore type");
	}
}
{'fraction_non_alphanumeric': 0.12848513011152415, 'fraction_numerical': 0.0037174721189591076, 'mean_word_length': 5.1587982832618025, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '5713954', 'n_tokens_mistral': 1580, 'n_tokens_neox': 1468, 'n_words': 255}