Clean up warnings in spring-websocket

This commit is contained in:
Sam Brannen
2015-08-22 15:15:42 +02:00
parent 732a655f82
commit 914ba483b2
5 changed files with 8 additions and 11 deletions

View File

@@ -62,7 +62,6 @@ public class StompSubProtocolErrorHandler implements SubProtocolErrorHandler<byt
return handleInternal(accessor, errorMessage.getPayload(), null, null);
}
@SuppressWarnings("unused")
protected Message<byte[]> handleInternal(StompHeaderAccessor errorHeaderAccessor,
byte[] errorPayload, Throwable cause, StompHeaderAccessor clientHeaderAccessor) {

View File

@@ -372,8 +372,8 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
/**
* Handle STOMP messages going back out to WebSocket clients.
*/
@SuppressWarnings("unchecked")
@Override
@SuppressWarnings("unchecked")
public void handleMessageToClient(WebSocketSession session, Message<?> message) {
if (!(message.getPayload() instanceof byte[])) {
logger.error("Expected byte[] payload. Ignoring " + message + ".");
@@ -527,6 +527,7 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
return (headerAccessor.isMutable() ? headerAccessor : StompHeaderAccessor.wrap(message));
}
@SuppressWarnings("deprecation")
private StompHeaderAccessor afterStompSessionConnected(Message<?> message, StompHeaderAccessor accessor,
WebSocketSession session) {
@@ -573,6 +574,7 @@ public class StompSubProtocolHandler implements SubProtocolHandler, ApplicationE
}
@Override
@SuppressWarnings("deprecation")
public void afterSessionEnded(WebSocketSession session, CloseStatus closeStatus, MessageChannel outputChannel) {
this.decoders.remove(session.getId());

View File

@@ -112,8 +112,8 @@ public abstract class AbstractXhrTransport implements XhrTransport {
// Transport methods
@SuppressWarnings("deprecation")
@Override
@SuppressWarnings("deprecation")
public ListenableFuture<WebSocketSession> connect(TransportRequest request, WebSocketHandler handler) {
SettableListenableFuture<WebSocketSession> connectFuture = new SettableListenableFuture<WebSocketSession>();
XhrClientSockJsSession session = new XhrClientSockJsSession(request, handler, this, connectFuture);

View File

@@ -13,14 +13,13 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.web.socket.sockjs.client;
import java.net.URI;
import java.security.Principal;
import org.springframework.http.HttpHeaders;
import org.springframework.web.socket.WebSocketHandler;
import org.springframework.web.socket.WebSocketHttpHeaders;
import org.springframework.web.socket.sockjs.frame.SockJsMessageCodec;
/**
@@ -38,7 +37,7 @@ import org.springframework.web.socket.sockjs.frame.SockJsMessageCodec;
public interface TransportRequest {
/**
* Return information about the SockJS URL including server and session id..
* Return information about the SockJS URL including server and session ID.
*/
SockJsUrlInfo getSockJsUrlInfo();
@@ -49,14 +48,14 @@ public interface TransportRequest {
/**
* Return the headers to add to all other HTTP requests besides the handshake
* request such XHR receive and send requests.
* request such as XHR receive and send requests.
* @since 4.2
*/
HttpHeaders getHttpRequestHeaders();
/**
* Return the transport URL for the given transport.
* For an {@link XhrTransport} this is the URL for receiving messages.
* <p>For an {@link XhrTransport} this is the URL for receiving messages.
*/
URI getTransportUrl();

View File

@@ -72,7 +72,6 @@ import org.springframework.web.socket.server.support.WebSocketHttpRequestHandler
*/
public class WebSocketMessageBrokerConfigurationSupportTests {
@Test
public void handlerMapping() {
ApplicationContext config = createConfig(TestChannelConfig.class, TestConfigurer.class);
@@ -204,7 +203,6 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
}
@SuppressWarnings("unused")
@Controller
static class TestController {
@@ -220,7 +218,6 @@ public class WebSocketMessageBrokerConfigurationSupportTests {
}
}
@SuppressWarnings("unused")
@Configuration
static class TestConfigurer extends AbstractWebSocketMessageBrokerConfigurer {