From faf9a2c8ac95f9d3e21b20477533b12f87ad203f Mon Sep 17 00:00:00 2001 From: ljacqu Date: Sat, 28 Nov 2015 23:59:04 +0100 Subject: [PATCH] Create builder for command description; refactor command classes - Create builder class for CommandDescription - Remove redundant methods in command registration classes (e.g. certain validation is superfluous because we only instantiate the classes internally) - Replace multiple occurrences where a field is directly instantiated e.g. with a list and then its value is overwritten by a constructor = redundant instantiation of objects --- .../command/CommandArgumentDescription.java | 54 +-- .../authme/command/CommandDescription.java | 375 +++++++----------- .../xephi/authme/command/CommandManager.java | 126 +++--- .../authme/command/CommandPermissions.java | 52 +-- .../authme/command/help/HelpPrinter.java | 2 +- .../command/help/HelpSyntaxHelperTest.java | 72 ++-- 6 files changed, 265 insertions(+), 416 deletions(-) diff --git a/src/main/java/fr/xephi/authme/command/CommandArgumentDescription.java b/src/main/java/fr/xephi/authme/command/CommandArgumentDescription.java index c486a382..af14a16e 100644 --- a/src/main/java/fr/xephi/authme/command/CommandArgumentDescription.java +++ b/src/main/java/fr/xephi/authme/command/CommandArgumentDescription.java @@ -7,7 +7,7 @@ public class CommandArgumentDescription { // TODO: Allow argument to consist of infinite parts.