Fix minor checkstyle issues

- Add JavaDoc where checkstyle expects it
- Fix line too long issues
- ...
This commit is contained in:
ljacqu
2017-05-07 11:59:01 +02:00
parent 1a48348824
commit 1f8307c8f6
43 changed files with 605 additions and 134 deletions
@@ -212,6 +212,7 @@ public class CommandInitializerTest {
testCollectionForCommand(command, CommandUtils.getMinNumberOfArguments(command), mandatoryArguments);
testCollectionForCommand(command, CommandUtils.getMaxNumberOfArguments(command), totalArguments);
}
private void testCollectionForCommand(CommandDescription command, int argCount,
Map<Class<? extends ExecutableCommand>, Integer> collection) {
final Class<? extends ExecutableCommand> clazz = command.getExecutableCommand();
@@ -82,7 +82,7 @@ public final class TestCommandsUtil {
throw new IllegalStateException("Could not find command with label '" + label + "'");
}
/** Shortcut command to initialize a new test command. */
/* Shortcut command to initialize a new test command. */
private static CommandDescription createCommand(PermissionNode permission, CommandDescription parent,
List<String> labels, Class<? extends ExecutableCommand> commandClass,
CommandArgumentDescription... arguments) {
@@ -103,7 +103,7 @@ public final class TestCommandsUtil {
return command.register();
}
/** Shortcut command to initialize a new argument description. */
/* Shortcut command to initialize a new argument description. */
private static CommandArgumentDescription newArgument(String label, boolean isOptional) {
return new CommandArgumentDescription(label, "'" + label + "' argument description", isOptional);
}
@@ -118,7 +118,7 @@ public class AccountsCommandTest {
// given
CommandSender sender = mock(CommandSender.class);
List<String> arguments = Collections.singletonList("123.45.67.89");
given(dataSource.getAllAuthsByIp("123.45.67.89")).willReturn(Collections.<String>emptyList());
given(dataSource.getAllAuthsByIp("123.45.67.89")).willReturn(Collections.emptyList());
// when
command.executeCommand(sender, arguments);
@@ -25,7 +25,7 @@ public class AuthMeCommandTest {
CommandSender sender = mock(CommandSender.class);
// when
command.executeCommand(sender, Collections.<String>emptyList());
command.executeCommand(sender, Collections.emptyList());
// then
ArgumentCaptor<String> messagesCaptor = ArgumentCaptor.forClass(String.class);
@@ -40,7 +40,7 @@ public class FirstSpawnCommandTest {
Player player = mock(Player.class);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(player).teleport(firstSpawn);
@@ -54,7 +54,7 @@ public class FirstSpawnCommandTest {
Player player = mock(Player.class);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(player).sendMessage(argThat(containsString("spawn has failed")));
@@ -90,15 +90,15 @@ public class LastLoginCommandTest {
CommandSender sender = mock(CommandSender.class);
given(sender.getName()).willReturn(name);
long lastLogin = System.currentTimeMillis() -
(412 * DAY_IN_MSEC + 10 * HOUR_IN_MSEC - 9000);
long lastLogin = System.currentTimeMillis()
- (412 * DAY_IN_MSEC + 10 * HOUR_IN_MSEC - 9000);
PlayerAuth auth = mock(PlayerAuth.class);
given(auth.getLastLogin()).willReturn(lastLogin);
given(auth.getIp()).willReturn("123.45.66.77");
given(dataSource.getAuth(name)).willReturn(auth);
// when
command.executeCommand(sender, Collections.<String>emptyList());
command.executeCommand(sender, Collections.emptyList());
// then
verify(dataSource).getAuth(name);
@@ -46,7 +46,7 @@ public class PurgeBannedPlayersCommandTest {
CommandSender sender = mock(CommandSender.class);
// when
command.executeCommand(sender, Collections.<String>emptyList());
command.executeCommand(sender, Collections.emptyList());
// then
verify(bukkitService).getBannedPlayers();
@@ -63,7 +63,7 @@ public class PurgeLastPositionCommandTest {
given(dataSource.getAuth(player)).willReturn(auth);
// when
command.executeCommand(sender, Collections.<String>emptyList());
command.executeCommand(sender, Collections.emptyList());
// then
verify(dataSource).getAuth(player);
@@ -39,7 +39,7 @@ public class SetFirstSpawnCommandTest {
given(spawnLoader.setFirstSpawn(location)).willReturn(true);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(spawnLoader).setFirstSpawn(location);
@@ -55,7 +55,7 @@ public class SetFirstSpawnCommandTest {
given(spawnLoader.setFirstSpawn(location)).willReturn(false);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(spawnLoader).setFirstSpawn(location);
@@ -41,7 +41,7 @@ public class SpawnCommandTest {
Player player = mock(Player.class);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(player).teleport(spawn);
@@ -55,7 +55,7 @@ public class SpawnCommandTest {
Player player = mock(Player.class);
// when
command.executeCommand(player, Collections.<String>emptyList());
command.executeCommand(player, Collections.emptyList());
// then
verify(player).sendMessage(argThat(containsString("Spawn has failed")));
@@ -47,7 +47,7 @@ public class SwitchAntiBotCommandTest {
CommandSender sender = mock(CommandSender.class);
// when
command.executeCommand(sender, Collections.<String>emptyList());
command.executeCommand(sender, Collections.emptyList());
// then
verify(sender).sendMessage(argThat(containsString("status: ACTIVE")));