Refine null-safety in spring-web and spring-websocket

See gh-32475
This commit is contained in:
Sébastien Deleuze
2024-03-25 11:02:44 +01:00
parent c4b615052e
commit a63ebe7e9d
59 changed files with 106 additions and 23 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.web.reactive.handler;
import org.springframework.core.annotation.AnnotatedElementUtils;
import org.springframework.http.HttpStatusCode;
import org.springframework.lang.Nullable;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.server.handler.ResponseStatusExceptionHandler;
@@ -38,6 +39,7 @@ import org.springframework.web.server.handler.ResponseStatusExceptionHandler;
public class WebFluxResponseStatusExceptionHandler extends ResponseStatusExceptionHandler {
@Override
@Nullable
protected HttpStatusCode determineStatus(Throwable ex) {
HttpStatusCode statusCode = super.determineStatus(ex);
if (statusCode == null) {

View File

@@ -66,6 +66,7 @@ public class RequestAttributeMethodArgumentResolver extends AbstractNamedValueSy
}
@Override
@Nullable
protected Object resolveNamedValue(String name, MethodParameter parameter, ServerWebExchange exchange) {
Object value = exchange.getAttribute(name);
ReactiveAdapter toAdapter = getAdapterRegistry().getAdapter(parameter.getParameterType());