Consistent use of @Nullable in spring-test
This commit also removes nullability from two common spots: ResolvableType.getType() and TargetSource.getTarget(), both of which are never effectively null with any regular implementation. For such scenarios, a non-null empty type/target is the cleaner contract. Issue: SPR-15540
This commit is contained in:
@@ -28,7 +28,6 @@ import org.springframework.core.ResolvableType;
|
||||
import org.springframework.lang.Nullable;
|
||||
import org.springframework.messaging.Message;
|
||||
import org.springframework.messaging.handler.HandlerMethod;
|
||||
import org.springframework.util.Assert;
|
||||
import org.springframework.util.ClassUtils;
|
||||
import org.springframework.util.ReflectionUtils;
|
||||
|
||||
@@ -289,9 +288,7 @@ public class InvocableHandlerMethod extends HandlerMethod {
|
||||
|
||||
@Override
|
||||
public Type getGenericParameterType() {
|
||||
Type returnType = this.returnType.getType();
|
||||
Assert.state(returnType != null, "No return type");
|
||||
return returnType;
|
||||
return this.returnType.getType();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -417,7 +417,7 @@ public class StompHeaders implements MultiValueMap<String, String>, Serializable
|
||||
}
|
||||
|
||||
@Override
|
||||
public void addAll(String headerName, List<String> headerValues) {
|
||||
public void addAll(String headerName, List<? extends String> headerValues) {
|
||||
List<String> currentValues = headers.computeIfAbsent(headerName, k -> new LinkedList<>());
|
||||
currentValues.addAll(headerValues);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user