From cb4108c1b4638e83cb891e9d3acfc68cf1e1052c Mon Sep 17 00:00:00 2001 From: NayXegp Date: Sat, 27 Oct 2018 04:01:03 +0200 Subject: [PATCH] #2539: Regex free command split --- .../main/java/net/md_5/bungee/api/plugin/PluginManager.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java index 096538a7..05dbe499 100644 --- a/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java +++ b/api/src/main/java/net/md_5/bungee/api/plugin/PluginManager.java @@ -22,7 +22,6 @@ import java.util.Stack; import java.util.jar.JarEntry; import java.util.jar.JarFile; import java.util.logging.Level; -import java.util.regex.Pattern; import lombok.RequiredArgsConstructor; import net.md_5.bungee.api.ChatColor; import net.md_5.bungee.api.CommandSender; @@ -42,7 +41,6 @@ import org.yaml.snakeyaml.introspector.PropertyUtils; public class PluginManager { - private static final Pattern argsSplit = Pattern.compile( " " ); /*========================================================================*/ private final ProxyServer proxy; /*========================================================================*/ @@ -126,7 +124,7 @@ public class PluginManager */ public boolean dispatchCommand(CommandSender sender, String commandLine, List tabResults) { - String[] split = argsSplit.split( commandLine, -1 ); + String[] split = commandLine.split( " ", -1 ); // Check for chat that only contains " " if ( split.length == 0 ) {