Cleanup
This commit is contained in:
parent
87f88cb32a
commit
700ab5f3e4
@ -1,7 +1,6 @@
|
|||||||
package fr.xephi.authme.command.executable.authme;
|
package fr.xephi.authme.command.executable.authme;
|
||||||
|
|
||||||
import fr.xephi.authme.AuthMe;
|
import fr.xephi.authme.AuthMe;
|
||||||
import fr.xephi.authme.command.CommandService;
|
|
||||||
import fr.xephi.authme.command.ExecutableCommand;
|
import fr.xephi.authme.command.ExecutableCommand;
|
||||||
import fr.xephi.authme.service.BukkitService;
|
import fr.xephi.authme.service.BukkitService;
|
||||||
import org.bukkit.ChatColor;
|
import org.bukkit.ChatColor;
|
||||||
@ -17,9 +16,6 @@ public class VersionCommand implements ExecutableCommand {
|
|||||||
@Inject
|
@Inject
|
||||||
private BukkitService bukkitService;
|
private BukkitService bukkitService;
|
||||||
|
|
||||||
@Inject
|
|
||||||
private CommandService commandService;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void executeCommand(CommandSender sender, List<String> arguments) {
|
public void executeCommand(CommandSender sender, List<String> arguments) {
|
||||||
// Show some version info
|
// Show some version info
|
||||||
@ -40,7 +36,7 @@ public class VersionCommand implements ExecutableCommand {
|
|||||||
sender.sendMessage(ChatColor.GOLD + "License: " + ChatColor.WHITE + "GNU GPL v3.0"
|
sender.sendMessage(ChatColor.GOLD + "License: " + ChatColor.WHITE + "GNU GPL v3.0"
|
||||||
+ ChatColor.GRAY + ChatColor.ITALIC + " (See LICENSE file)");
|
+ ChatColor.GRAY + ChatColor.ITALIC + " (See LICENSE file)");
|
||||||
sender.sendMessage(ChatColor.GOLD + "Copyright: " + ChatColor.WHITE
|
sender.sendMessage(ChatColor.GOLD + "Copyright: " + ChatColor.WHITE
|
||||||
+ "Copyright (c) Xephi 2015. All rights reserved.");
|
+ "Copyright (c) AuthMe-Team 2016. All rights reserved.");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -4,8 +4,6 @@ import net.ricecode.similarity.LevenshteinDistanceStrategy;
|
|||||||
import net.ricecode.similarity.StringSimilarityService;
|
import net.ricecode.similarity.StringSimilarityService;
|
||||||
import net.ricecode.similarity.StringSimilarityServiceImpl;
|
import net.ricecode.similarity.StringSimilarityServiceImpl;
|
||||||
|
|
||||||
import java.io.File;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Utility class for String operations.
|
* Utility class for String operations.
|
||||||
*/
|
*/
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
package fr.xephi.authme.util;
|
package fr.xephi.authme.util;
|
||||||
|
|
||||||
import fr.xephi.authme.ConsoleLogger;
|
import fr.xephi.authme.ConsoleLogger;
|
||||||
import org.bukkit.OfflinePlayer;
|
|
||||||
import org.bukkit.entity.Player;
|
|
||||||
|
|
||||||
import java.util.regex.Pattern;
|
import java.util.regex.Pattern;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@ -52,7 +52,7 @@ public class ClassCollector {
|
|||||||
* @param <T> the parent type
|
* @param <T> the parent type
|
||||||
* @return list of matching classes
|
* @return list of matching classes
|
||||||
*/
|
*/
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public <T> List<Class<? extends T>> collectClasses(Class<T> parent) {
|
public <T> List<Class<? extends T>> collectClasses(Class<T> parent) {
|
||||||
List<Class<?>> classes = collectClasses(parent::isAssignableFrom);
|
List<Class<?>> classes = collectClasses(parent::isAssignableFrom);
|
||||||
return new ArrayList<>((List) classes);
|
return new ArrayList<>((List) classes);
|
||||||
|
|||||||
@ -38,6 +38,7 @@ public class HelpMessagesServiceTest {
|
|||||||
@Mock
|
@Mock
|
||||||
private MessageFileHandlerProvider messageFileHandlerProvider;
|
private MessageFileHandlerProvider messageFileHandlerProvider;
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@BeforeInjecting
|
@BeforeInjecting
|
||||||
public void initializeHandler() {
|
public void initializeHandler() {
|
||||||
MessageFileHandler handler = new MessageFileHandler(getJarFile(TEST_FILE), "messages/messages_en.yml");
|
MessageFileHandler handler = new MessageFileHandler(getJarFile(TEST_FILE), "messages/messages_en.yml");
|
||||||
|
|||||||
@ -493,7 +493,7 @@ public class OnJoinVerifierTest {
|
|||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
private void returnOnlineListFromBukkitServer(Collection<Player> onlineList) {
|
private void returnOnlineListFromBukkitServer(Collection<Player> onlineList) {
|
||||||
// Note ljacqu 20160529: The compiler gets lost in generics because Collection<? extends Player> is returned
|
// Note ljacqu 20160529: The compiler gets lost in generics because Collection<? extends Player> is returned
|
||||||
// from getOnlinePlayers(). We need to uncheck onlineList to a simple Collection or it will refuse to compile.
|
// from getOnlinePlayers(). We need to uncheck onlineList to a simple Collection or it will refuse to compile.
|
||||||
|
|||||||
@ -247,7 +247,7 @@ public class AsynchronousLoginTest {
|
|||||||
return player;
|
return player;
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
private void mockOnlinePlayersInBukkitService() {
|
private void mockOnlinePlayersInBukkitService() {
|
||||||
// 127.0.0.4: albania (online), brazil (offline)
|
// 127.0.0.4: albania (online), brazil (offline)
|
||||||
Player playerA = mockPlayer("albania");
|
Player playerA = mockPlayer("albania");
|
||||||
|
|||||||
@ -190,7 +190,7 @@ public class AntiBotServiceTest {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
@SuppressWarnings("unchecked")
|
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||||
public void shouldInformPlayersOnActivation() {
|
public void shouldInformPlayersOnActivation() {
|
||||||
// given - listening antibot
|
// given - listening antibot
|
||||||
runSyncDelayedTaskWithDelay(bukkitService);
|
runSyncDelayedTaskWithDelay(bukkitService);
|
||||||
|
|||||||
@ -6,8 +6,6 @@ import org.junit.BeforeClass;
|
|||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import java.util.regex.Pattern;
|
|
||||||
|
|
||||||
import static org.hamcrest.Matchers.equalTo;
|
import static org.hamcrest.Matchers.equalTo;
|
||||||
import static org.junit.Assert.assertThat;
|
import static org.junit.Assert.assertThat;
|
||||||
import static org.mockito.BDDMockito.given;
|
import static org.mockito.BDDMockito.given;
|
||||||
|
|||||||
@ -32,6 +32,7 @@ public class PermissionNodesGatherer {
|
|||||||
*
|
*
|
||||||
* @return Ordered map whose keys are the permission nodes and the values the associated JavaDoc
|
* @return Ordered map whose keys are the permission nodes and the values the associated JavaDoc
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
public <T extends Enum<T> & PermissionNode> Map<String, String> gatherNodesWithJavaDoc() {
|
public <T extends Enum<T> & PermissionNode> Map<String, String> gatherNodesWithJavaDoc() {
|
||||||
Map<String, String> result = new TreeMap<>();
|
Map<String, String> result = new TreeMap<>();
|
||||||
result.put("authme.admin.*", "Give access to all admin commands.");
|
result.put("authme.admin.*", "Give access to all admin commands.");
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user