Browse Source

Suppress warnings and remove unused imports

pull/449/head
Sam Brannen 12 years ago
parent
commit
597ef099d0
  1. 3
      spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompReactorNettyTcpClient.java
  2. 3
      spring-messaging/src/main/java/org/springframework/messaging/support/AbstractSubscribableChannel.java
  3. 4
      spring-messaging/src/main/java/org/springframework/messaging/support/ExecutorSubscribableChannel.java
  4. 3
      spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java
  5. 5
      spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java
  6. 4
      spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandlerTests.java
  7. 5
      spring-messaging/src/test/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistrationTests.java
  8. 3
      spring-messaging/src/test/java/org/springframework/messaging/simp/user/UserDestinationMessageHandlerTests.java
  9. 3
      spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java
  10. 1
      spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationTests.java
  11. 4
      spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupportTests.java
  12. 1
      spring-websocket/src/test/java/org/springframework/web/socket/messaging/StompSubProtocolHandlerTests.java
  13. 3
      spring-websocket/src/test/java/org/springframework/web/socket/server/DefaultHandshakeHandlerTests.java
  14. 4
      spring-websocket/src/test/java/org/springframework/web/socket/sockjs/support/AbstractSockJsServiceTests.java

3
spring-messaging/src/main/java/org/springframework/messaging/simp/stomp/StompReactorNettyTcpClient.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.messaging.simp.stomp;
import org.springframework.messaging.tcp.reactor.ReactorNettyTcpClient;
import reactor.tcp.encoding.Codec;
/**
* A variation of {@link ReactorNettyTcpClient} for sending and receiving STOMP frames.

3
spring-messaging/src/main/java/org/springframework/messaging/support/AbstractSubscribableChannel.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -20,7 +20,6 @@ import org.springframework.messaging.MessageHandler; @@ -20,7 +20,6 @@ import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.SubscribableChannel;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;

4
spring-messaging/src/main/java/org/springframework/messaging/support/ExecutorSubscribableChannel.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,8 +16,6 @@ @@ -16,8 +16,6 @@
package org.springframework.messaging.support;
import java.util.Set;
import java.util.concurrent.CopyOnWriteArraySet;
import java.util.concurrent.Executor;
import org.springframework.messaging.Message;

3
spring-messaging/src/main/java/org/springframework/messaging/support/GenericMessage.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -17,7 +17,6 @@ @@ -17,7 +17,6 @@
package org.springframework.messaging.support;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;
import org.springframework.messaging.Message;

5
spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SendToMethodReturnValueHandlerTests.java

@ -23,17 +23,18 @@ import javax.security.auth.Subject; @@ -23,17 +23,18 @@ import javax.security.auth.Subject;
import org.junit.Before;
import org.junit.Test;
import org.mockito.ArgumentCaptor;
import org.mockito.Captor;
import org.mockito.Mock;
import org.mockito.MockitoAnnotations;
import org.springframework.core.MethodParameter;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
import org.springframework.messaging.simp.SimpMessagingTemplate;
import org.springframework.messaging.simp.TestPrincipal;
import org.springframework.messaging.simp.annotation.SendToUser;
import org.springframework.messaging.simp.user.DestinationUserNameProvider;
import org.springframework.messaging.support.MessageBuilder;
@ -70,8 +71,8 @@ public class SendToMethodReturnValueHandlerTests { @@ -70,8 +71,8 @@ public class SendToMethodReturnValueHandlerTests {
private MethodParameter sendToUserDefaultDestReturnType;
@SuppressWarnings("unchecked")
@Before
@SuppressWarnings({ "unchecked", "rawtypes" })
public void setup() throws Exception {
MockitoAnnotations.initMocks(this);

4
spring-messaging/src/test/java/org/springframework/messaging/simp/annotation/support/SubscriptionMethodReturnValueHandlerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -65,8 +65,8 @@ public class SubscriptionMethodReturnValueHandlerTests { @@ -65,8 +65,8 @@ public class SubscriptionMethodReturnValueHandlerTests {
private MethodParameter messageMappingReturnType;
@SuppressWarnings("unchecked")
@Before
@SuppressWarnings({ "unchecked", "rawtypes" })
public void setup() throws Exception {
MockitoAnnotations.initMocks(this);

5
spring-messaging/src/test/java/org/springframework/messaging/simp/config/StompBrokerRelayRegistrationTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -16,8 +16,8 @@ @@ -16,8 +16,8 @@
package org.springframework.messaging.simp.config;
import org.junit.Before;
import org.junit.Test;
import org.springframework.messaging.MessageChannel;
import org.springframework.messaging.StubMessageChannel;
import org.springframework.messaging.SubscribableChannel;
@ -25,7 +25,6 @@ import org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler; @@ -25,7 +25,6 @@ import org.springframework.messaging.simp.stomp.StompBrokerRelayMessageHandler;
import java.util.Arrays;
import static org.junit.Assert.assertArrayEquals;
import static org.junit.Assert.assertEquals;
/**

3
spring-messaging/src/test/java/org/springframework/messaging/simp/user/UserDestinationMessageHandlerTests.java

@ -59,6 +59,7 @@ public class UserDestinationMessageHandlerTests { @@ -59,6 +59,7 @@ public class UserDestinationMessageHandlerTests {
@Test
@SuppressWarnings("rawtypes")
public void handleSubscribe() {
when(this.brokerChannel.send(Mockito.any(Message.class))).thenReturn(true);
this.messageHandler.handleMessage(createMessage(SimpMessageType.SUBSCRIBE, "joe", SESSION_ID, "/user/queue/foo"));
@ -71,6 +72,7 @@ public class UserDestinationMessageHandlerTests { @@ -71,6 +72,7 @@ public class UserDestinationMessageHandlerTests {
}
@Test
@SuppressWarnings("rawtypes")
public void handleUnsubscribe() {
when(this.brokerChannel.send(Mockito.any(Message.class))).thenReturn(true);
this.messageHandler.handleMessage(createMessage(SimpMessageType.UNSUBSCRIBE, "joe", "123", "/user/queue/foo"));
@ -83,6 +85,7 @@ public class UserDestinationMessageHandlerTests { @@ -83,6 +85,7 @@ public class UserDestinationMessageHandlerTests {
}
@Test
@SuppressWarnings("rawtypes")
public void handleMessage() {
this.registry.registerSessionId("joe", "123");
when(this.brokerChannel.send(Mockito.any(Message.class))).thenReturn(true);

3
spring-websocket/src/test/java/org/springframework/web/socket/config/HandlersBeanDefinitionParserTests.java

@ -151,6 +151,7 @@ public class HandlersBeanDefinitionParserTests { @@ -151,6 +151,7 @@ public class HandlersBeanDefinitionParserTests {
}
@Test
@SuppressWarnings("unchecked")
public void sockJsSupport() {
loadBeanDefinitions("websocket-config-handlers-sockjs.xml");
SimpleUrlHandlerMapping handlerMapping = appContext.getBean(SimpleUrlHandlerMapping.class);
@ -183,6 +184,7 @@ public class HandlersBeanDefinitionParserTests { @@ -183,6 +184,7 @@ public class HandlersBeanDefinitionParserTests {
}
@Test
@SuppressWarnings("unchecked")
public void sockJsAttributesSupport() {
loadBeanDefinitions("websocket-config-handlers-sockjs-attributes.xml");
SimpleUrlHandlerMapping handlerMapping = appContext.getBean(SimpleUrlHandlerMapping.class);
@ -270,6 +272,7 @@ class FooTestInterceptor implements HandshakeInterceptor { @@ -270,6 +272,7 @@ class FooTestInterceptor implements HandshakeInterceptor {
class BarTestInterceptor extends FooTestInterceptor {}
@SuppressWarnings({ "unchecked", "rawtypes" })
class TestTaskScheduler implements TaskScheduler {
@Override
public ScheduledFuture schedule(Runnable task, Trigger trigger) { return null; }

1
spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketConfigurationTests.java

@ -31,7 +31,6 @@ import org.springframework.context.annotation.Configuration; @@ -31,7 +31,6 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.web.socket.AbstractWebSocketIntegrationTests;
import org.springframework.web.socket.JettyWebSocketTestServer;
import org.springframework.web.socket.TomcatWebSocketTestServer;
import org.springframework.web.socket.UndertowTestServer;
import org.springframework.web.socket.WebSocketSession;
import org.springframework.web.socket.client.jetty.JettyWebSocketClient;
import org.springframework.web.socket.client.standard.StandardWebSocketClient;

4
spring-websocket/src/test/java/org/springframework/web/socket/config/annotation/WebSocketMessageBrokerConfigurationSupportTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -35,8 +35,6 @@ import org.springframework.messaging.handler.annotation.MessageMapping; @@ -35,8 +35,6 @@ import org.springframework.messaging.handler.annotation.MessageMapping;
import org.springframework.messaging.handler.annotation.SendTo;
import org.springframework.messaging.simp.SimpMessageType;
import org.springframework.messaging.simp.annotation.SubscribeMapping;
import org.springframework.messaging.simp.config.ChannelRegistration;
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
import org.springframework.messaging.simp.stomp.StompCommand;
import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
import org.springframework.stereotype.Controller;

1
spring-websocket/src/test/java/org/springframework/web/socket/messaging/StompSubProtocolHandlerTests.java

@ -57,6 +57,7 @@ public class StompSubProtocolHandlerTests { @@ -57,6 +57,7 @@ public class StompSubProtocolHandlerTests {
private MessageChannel channel;
@SuppressWarnings("rawtypes")
private ArgumentCaptor<Message> messageCaptor;

3
spring-websocket/src/test/java/org/springframework/web/socket/server/DefaultHandshakeHandlerTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -33,7 +33,6 @@ import org.springframework.web.socket.WebSocketHandler; @@ -33,7 +33,6 @@ import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.handler.TextWebSocketHandler;
import org.springframework.web.socket.WebSocketHttpHeaders;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.*;
/**

4
spring-websocket/src/test/java/org/springframework/web/socket/sockjs/support/AbstractSockJsServiceTests.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2013 the original author or authors.
* Copyright 2002-2014 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@ -28,7 +28,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; @@ -28,7 +28,6 @@ import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
import org.springframework.web.socket.AbstractHttpRequestTests;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.sockjs.SockJsException;
import org.springframework.web.socket.sockjs.transport.TransportType;
import static org.junit.Assert.*;
@ -164,6 +163,7 @@ public class AbstractSockJsServiceTests extends AbstractHttpRequestTests { @@ -164,6 +163,7 @@ public class AbstractSockJsServiceTests extends AbstractHttpRequestTests {
private String sessionId;
@SuppressWarnings("unused")
private String transport;
private WebSocketHandler handler;

Loading…
Cancel
Save