This commit is contained in:
Gabriele C
2016-10-09 23:46:07 +02:00
parent 87f88cb32a
commit 700ab5f3e4
10 changed files with 7 additions and 16 deletions
@@ -52,7 +52,7 @@ public class ClassCollector {
* @param <T> the parent type
* @return list of matching classes
*/
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public <T> List<Class<? extends T>> collectClasses(Class<T> parent) {
List<Class<?>> classes = collectClasses(parent::isAssignableFrom);
return new ArrayList<>((List) classes);
@@ -38,6 +38,7 @@ public class HelpMessagesServiceTest {
@Mock
private MessageFileHandlerProvider messageFileHandlerProvider;
@SuppressWarnings("unchecked")
@BeforeInjecting
public void initializeHandler() {
MessageFileHandler handler = new MessageFileHandler(getJarFile(TEST_FILE), "messages/messages_en.yml");
@@ -493,7 +493,7 @@ public class OnJoinVerifierTest {
return player;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
private void returnOnlineListFromBukkitServer(Collection<Player> onlineList) {
// 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.
@@ -247,7 +247,7 @@ public class AsynchronousLoginTest {
return player;
}
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
private void mockOnlinePlayersInBukkitService() {
// 127.0.0.4: albania (online), brazil (offline)
Player playerA = mockPlayer("albania");
@@ -190,7 +190,7 @@ public class AntiBotServiceTest {
}
@Test
@SuppressWarnings("unchecked")
@SuppressWarnings({ "unchecked", "rawtypes" })
public void shouldInformPlayersOnActivation() {
// given - listening antibot
runSyncDelayedTaskWithDelay(bukkitService);
@@ -6,8 +6,6 @@ import org.junit.BeforeClass;
import org.junit.Test;
import java.util.UUID;
import java.util.regex.Pattern;
import static org.hamcrest.Matchers.equalTo;
import static org.junit.Assert.assertThat;
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
*/
@SuppressWarnings("unchecked")
public <T extends Enum<T> & PermissionNode> Map<String, String> gatherNodesWithJavaDoc() {
Map<String, String> result = new TreeMap<>();
result.put("authme.admin.*", "Give access to all admin commands.");