From eba88b27737fc4ea848d1cc054de4dae3df646df Mon Sep 17 00:00:00 2001 From: Nathan Adams Date: Wed, 21 Jun 2017 14:36:17 +0200 Subject: [PATCH] More cleanup --- build.gradle | 2 +- src/main/java/com/mojang/brigadier/CommandDispatcher.java | 2 +- .../mojang/brigadier/arguments/IntegerArgumentType.java | 2 +- .../com/mojang/brigadier/builder/ArgumentBuilder.java | 2 +- .../mojang/brigadier/builder/LiteralArgumentBuilder.java | 2 +- .../mojang/brigadier/builder/RequiredArgumentBuilder.java | 6 +++--- .../java/com/mojang/brigadier/CommandDispatcherTest.java | 8 +++++--- .../com/mojang/brigadier/CommandDispatcherUsagesTest.java | 8 +++++--- .../brigadier/arguments/IntegerArgumentTypeTest.java | 2 +- .../com/mojang/brigadier/builder/ArgumentBuilderTest.java | 2 +- .../brigadier/builder/LiteralArgumentBuilderTest.java | 3 ++- .../brigadier/builder/RequiredArgumentBuilderTest.java | 6 ++++-- .../com/mojang/brigadier/context/CommandContextTest.java | 5 +++-- .../exceptions/ParameterizedCommandExceptionTypeTest.java | 2 +- .../mojang/brigadier/tree/ArgumentCommandNodeTest.java | 4 ++-- .../com/mojang/brigadier/tree/LiteralCommandNodeTest.java | 4 ++-- .../com/mojang/brigadier/tree/RootCommandNodeTest.java | 2 +- 17 files changed, 35 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 2b9365b..3701db9 100644 --- a/build.gradle +++ b/build.gradle @@ -58,7 +58,7 @@ artifacts { test { testLogging { events "failed", "skipped" - showStandardStreams true + showStandardStreams = true showExceptions true } } diff --git a/src/main/java/com/mojang/brigadier/CommandDispatcher.java b/src/main/java/com/mojang/brigadier/CommandDispatcher.java index f2671a1..e043bff 100644 --- a/src/main/java/com/mojang/brigadier/CommandDispatcher.java +++ b/src/main/java/com/mojang/brigadier/CommandDispatcher.java @@ -42,7 +42,7 @@ public class CommandDispatcher { context.getCommand().run(context); } - protected CommandContext parseNodes(CommandNode node, String command, CommandContextBuilder contextBuilder) throws CommandException { + private CommandContext parseNodes(CommandNode node, String command, CommandContextBuilder contextBuilder) throws CommandException { CommandException exception = null; for (CommandNode child : node.getChildren()) { diff --git a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java index 4748e08..d597c68 100644 --- a/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java +++ b/src/main/java/com/mojang/brigadier/arguments/IntegerArgumentType.java @@ -17,7 +17,7 @@ public class IntegerArgumentType implements CommandArgumentType { private final int minimum; private final int maximum; - protected IntegerArgumentType(int minimum, int maximum) { + private IntegerArgumentType(int minimum, int maximum) { this.minimum = minimum; this.maximum = maximum; } diff --git a/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java index 8bd54bd..4c5696f 100644 --- a/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/ArgumentBuilder.java @@ -26,7 +26,7 @@ public abstract class ArgumentBuilder> { return getThis(); } - public Command getCommand() { + protected Command getCommand() { return command; } diff --git a/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java b/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java index 83f21df..1d6f7a1 100644 --- a/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java +++ b/src/main/java/com/mojang/brigadier/builder/LiteralArgumentBuilder.java @@ -19,7 +19,7 @@ public class LiteralArgumentBuilder extends ArgumentBuilder extends ArgumentBuilder type; - protected RequiredArgumentBuilder(String name, CommandArgumentType type) { + private RequiredArgumentBuilder(String name, CommandArgumentType type) { this.name = name; this.type = type; } @@ -22,11 +22,11 @@ public class RequiredArgumentBuilder extends ArgumentBuilder getType() { + private CommandArgumentType getType() { return type; } - public String getName() { + private String getName() { return name; } diff --git a/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java b/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java index 7c37f30..9eb70b0 100644 --- a/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java +++ b/src/test/java/com/mojang/brigadier/CommandDispatcherTest.java @@ -24,9 +24,11 @@ import static org.mockito.Mockito.*; @RunWith(MockitoJUnitRunner.class) public class CommandDispatcherTest { - CommandDispatcher subject; - @Mock Command command; - @Mock Object source; + private CommandDispatcher subject; + @Mock + private Command command; + @Mock + private Object source; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/CommandDispatcherUsagesTest.java b/src/test/java/com/mojang/brigadier/CommandDispatcherUsagesTest.java index c4484a2..2228080 100644 --- a/src/test/java/com/mojang/brigadier/CommandDispatcherUsagesTest.java +++ b/src/test/java/com/mojang/brigadier/CommandDispatcherUsagesTest.java @@ -20,9 +20,11 @@ import static org.junit.Assert.fail; @RunWith(MockitoJUnitRunner.class) public class CommandDispatcherUsagesTest { - CommandDispatcher subject; - @Mock Object source; - @Mock Command command; + private CommandDispatcher subject; + @Mock + private Object source; + @Mock + private Command command; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java index 0ed6195..c3f3f0d 100644 --- a/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java +++ b/src/test/java/com/mojang/brigadier/arguments/IntegerArgumentTypeTest.java @@ -19,7 +19,7 @@ import static org.junit.Assert.assertThat; import static org.junit.Assert.fail; public class IntegerArgumentTypeTest { - IntegerArgumentType type; + private IntegerArgumentType type; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java index 0ef59ba..3ac84fe 100644 --- a/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/ArgumentBuilderTest.java @@ -11,7 +11,7 @@ import static org.hamcrest.Matchers.hasSize; import static org.junit.Assert.assertThat; public class ArgumentBuilderTest { - TestableArgumentBuilder builder; + private TestableArgumentBuilder builder; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java index 5100c26..341f605 100644 --- a/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/LiteralArgumentBuilderTest.java @@ -13,8 +13,9 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class LiteralArgumentBuilderTest { - LiteralArgumentBuilder builder; + private LiteralArgumentBuilder builder; @Mock + private Command command; @Before diff --git a/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java index 2d09237..c851216 100644 --- a/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java +++ b/src/test/java/com/mojang/brigadier/builder/RequiredArgumentBuilderTest.java @@ -14,9 +14,11 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class RequiredArgumentBuilderTest { - @Mock CommandArgumentType type; - RequiredArgumentBuilder builder; @Mock + private CommandArgumentType type; + private RequiredArgumentBuilder builder; + @Mock + private Command command; @Before diff --git a/src/test/java/com/mojang/brigadier/context/CommandContextTest.java b/src/test/java/com/mojang/brigadier/context/CommandContextTest.java index ed1ca9d..c643a81 100644 --- a/src/test/java/com/mojang/brigadier/context/CommandContextTest.java +++ b/src/test/java/com/mojang/brigadier/context/CommandContextTest.java @@ -18,8 +18,9 @@ import static org.mockito.Mockito.mock; @RunWith(MockitoJUnitRunner.class) public class CommandContextTest { - CommandContextBuilder builder; - @Mock Object source; + private CommandContextBuilder builder; + @Mock + private Object source; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java b/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java index 9dd48fa..008db3f 100644 --- a/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java +++ b/src/test/java/com/mojang/brigadier/exceptions/ParameterizedCommandExceptionTypeTest.java @@ -12,7 +12,7 @@ import static org.junit.Assert.assertThat; @SuppressWarnings("ThrowableResultOfMethodCallIgnored") public class ParameterizedCommandExceptionTypeTest { - ParameterizedCommandExceptionType type; + private ParameterizedCommandExceptionType type; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java index beac3c1..eb01037 100644 --- a/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/ArgumentCommandNodeTest.java @@ -20,8 +20,8 @@ import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class ArgumentCommandNodeTest extends AbstractCommandNodeTest { - ArgumentCommandNode node; - CommandContextBuilder contextBuilder; + private ArgumentCommandNode node; + private CommandContextBuilder contextBuilder; @Override protected CommandNode getCommandNode() { diff --git a/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java index 5530d96..1ddcfdb 100644 --- a/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/LiteralCommandNodeTest.java @@ -18,8 +18,8 @@ import static org.junit.Assert.fail; import static org.mockito.Mockito.mock; public class LiteralCommandNodeTest extends AbstractCommandNodeTest { - LiteralCommandNode node; - CommandContextBuilder contextBuilder; + private LiteralCommandNode node; + private CommandContextBuilder contextBuilder; @Override protected CommandNode getCommandNode() { diff --git a/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java b/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java index 2e23986..5bb45f5 100644 --- a/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java +++ b/src/test/java/com/mojang/brigadier/tree/RootCommandNodeTest.java @@ -10,7 +10,7 @@ import static org.hamcrest.Matchers.is; import static org.junit.Assert.assertThat; public class RootCommandNodeTest extends AbstractCommandNodeTest { - RootCommandNode node; + private RootCommandNode node; @Override protected CommandNode getCommandNode() {