Add missing @Nullable annotations on parameters
Issue: SPR-15540
This commit is contained in:
@@ -24,6 +24,7 @@ import java.util.Map;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
import org.springframework.messaging.simp.SimpMessageHeaderAccessor;
|
||||
@@ -156,12 +157,12 @@ public class MessageConverterTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object convertFromInternal(Message<?> message, Class<?> targetClass, Object conversionHint) {
|
||||
protected Object convertFromInternal(Message<?> message, Class<?> targetClass, @Nullable Object conversionHint) {
|
||||
return "success-from";
|
||||
}
|
||||
|
||||
@Override
|
||||
protected Object convertToInternal(Object payload, MessageHeaders headers, Object conversionHint) {
|
||||
protected Object convertToInternal(Object payload, @Nullable MessageHeaders headers, @Nullable Object conversionHint) {
|
||||
return "success-to";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,6 +33,7 @@ import org.mockito.Mock;
|
||||
import org.mockito.MockitoAnnotations;
|
||||
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageChannel;
|
||||
import org.springframework.messaging.MessageHeaders;
|
||||
@@ -511,7 +512,7 @@ public class SimpAnnotationMethodMessageHandlerTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
public void validate(@Nullable Object target, Errors errors) {
|
||||
String value = (String) target;
|
||||
if (invalidValue.equals(value)) {
|
||||
errors.reject("invalid value '"+invalidValue+"'");
|
||||
|
||||
@@ -31,6 +31,7 @@ import org.springframework.context.annotation.AnnotationConfigApplicationContext
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
import org.springframework.context.support.StaticApplicationContext;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.MessageHandler;
|
||||
import org.springframework.messaging.converter.ByteArrayMessageConverter;
|
||||
@@ -562,7 +563,7 @@ public class MessageBrokerConfigurationTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void validate(Object target, Errors errors) {
|
||||
public void validate(@Nullable Object target, Errors errors) {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ import org.junit.Rule;
|
||||
import org.junit.Test;
|
||||
import org.junit.rules.TestName;
|
||||
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.converter.StringMessageConverter;
|
||||
import org.springframework.messaging.simp.stomp.StompSession.Subscription;
|
||||
import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler;
|
||||
@@ -139,7 +140,7 @@ public class ReactorNettyTcpStompClientTests {
|
||||
}
|
||||
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, Object payload) {
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object payload) {
|
||||
logger.error("STOMP error frame " + headers + " payload=" + payload);
|
||||
}
|
||||
|
||||
@@ -178,7 +179,7 @@ public class ReactorNettyTcpStompClientTests {
|
||||
return String.class;
|
||||
}
|
||||
@Override
|
||||
public void handleFrame(StompHeaders headers, Object payload) {
|
||||
public void handleFrame(StompHeaders headers, @Nullable Object payload) {
|
||||
received.add((String) payload);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user