Add missing @Nullable annotations on parameters
Issue: SPR-15540
This commit is contained in:
@@ -16,6 +16,7 @@
|
||||
|
||||
package org.springframework.web.socket.messaging;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.simp.stomp.StompCommand;
|
||||
import org.springframework.messaging.simp.stomp.StompHeaderAccessor;
|
||||
@@ -35,7 +36,8 @@ public class StompSubProtocolErrorHandler implements SubProtocolErrorHandler<byt
|
||||
|
||||
|
||||
@Override
|
||||
public Message<byte[]> handleClientMessageProcessingError(Message<byte[]> clientMessage, Throwable ex) {
|
||||
@Nullable
|
||||
public Message<byte[]> handleClientMessageProcessingError(@Nullable Message<byte[]> clientMessage, Throwable ex) {
|
||||
StompHeaderAccessor accessor = StompHeaderAccessor.create(StompCommand.ERROR);
|
||||
accessor.setMessage(ex.getMessage());
|
||||
accessor.setLeaveMutable(true);
|
||||
|
||||
@@ -37,6 +37,7 @@ import org.springframework.http.server.ServerHttpRequest;
|
||||
import org.springframework.http.server.ServerHttpResponse;
|
||||
import org.springframework.http.server.ServletServerHttpRequest;
|
||||
import org.springframework.http.server.ServletServerHttpResponse;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.web.socket.WebSocketExtension;
|
||||
import org.springframework.web.socket.WebSocketHandler;
|
||||
@@ -101,7 +102,7 @@ public abstract class AbstractStandardUpgradeStrategy implements RequestUpgradeS
|
||||
|
||||
@Override
|
||||
public void upgrade(ServerHttpRequest request, ServerHttpResponse response,
|
||||
String selectedProtocol, List<WebSocketExtension> selectedExtensions, Principal user,
|
||||
@Nullable String selectedProtocol, List<WebSocketExtension> selectedExtensions, Principal user,
|
||||
WebSocketHandler wsHandler, Map<String, Object> attrs) throws HandshakeFailureException {
|
||||
|
||||
HttpHeaders headers = request.getHeaders();
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.springframework.beans.factory.config.CustomScopeConfigurer;
|
||||
import org.springframework.beans.factory.xml.XmlBeanDefinitionReader;
|
||||
import org.springframework.core.MethodParameter;
|
||||
import org.springframework.core.io.ClassPathResource;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.messaging.converter.ByteArrayMessageConverter;
|
||||
@@ -540,5 +541,5 @@ class TestValidator implements Validator {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) { }
|
||||
public void validate(@Nullable Object target, Errors errors) { }
|
||||
}
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.converter.StringMessageConverter;
|
||||
import org.springframework.messaging.simp.config.MessageBrokerRegistry;
|
||||
import org.springframework.messaging.simp.stomp.StompCommand;
|
||||
@@ -171,7 +172,7 @@ public class WebSocketStompClientIntegrationTests {
|
||||
return String.class;
|
||||
}
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, Object payload) {
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object payload) {
|
||||
received.add((String) payload);
|
||||
}
|
||||
});
|
||||
@@ -208,7 +209,7 @@ public class WebSocketStompClientIntegrationTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, Object payload) {
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object payload) {
|
||||
logger.error("STOMP error frame " + headers + " payload=" + payload);
|
||||
}
|
||||
|
||||
|
||||
@@ -34,6 +34,7 @@ import org.springframework.http.HttpHeaders;
|
||||
import org.springframework.http.HttpMethod;
|
||||
import org.springframework.http.HttpStatus;
|
||||
import org.springframework.http.client.ClientHttpResponse;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.simp.stomp.StompCommand;
|
||||
@@ -213,7 +214,7 @@ public class RestTemplateXhrTransportTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public <T> T execute(URI url, HttpMethod method, RequestCallback callback, ResponseExtractor<T> extractor) throws RestClientException {
|
||||
public <T> T execute(URI url, HttpMethod method, @Nullable RequestCallback callback, @Nullable ResponseExtractor<T> extractor) throws RestClientException {
|
||||
try {
|
||||
extractor.extractData(this.responses.remove());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user