Browse Source

Add more nullability annotations to module/spring-boot-cloudfoundry

See gh-46587
pull/47390/head
Moritz Halbritter 8 months ago
parent
commit
9e63ff7005
  1. 6
      module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/actuate/autoconfigure/endpoint/reactive/CloudFoundryWebFluxEndpointHandlerMapping.java
  2. 2
      module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/actuate/autoconfigure/endpoint/servlet/CloudFoundryWebEndpointServletHandlerMapping.java

6
module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/actuate/autoconfigure/endpoint/reactive/CloudFoundryWebFluxEndpointHandlerMapping.java

@ -148,13 +148,13 @@ class CloudFoundryWebFluxEndpointHandlerMapping extends AbstractWebFluxEndpointH @@ -148,13 +148,13 @@ class CloudFoundryWebFluxEndpointHandlerMapping extends AbstractWebFluxEndpointH
}
@Override
public Mono<ResponseEntity<Object>> handle(ServerWebExchange exchange, Map<String, String> body) {
public Mono<ResponseEntity<Object>> handle(ServerWebExchange exchange, @Nullable Map<String, String> body) {
return this.securityInterceptor.preHandle(exchange, this.endpointId.toLowerCaseString())
.flatMap((securityResponse) -> flatMapResponse(exchange, body, securityResponse));
}
private Mono<ResponseEntity<Object>> flatMapResponse(ServerWebExchange exchange, Map<String, String> body,
SecurityResponse securityResponse) {
private Mono<ResponseEntity<Object>> flatMapResponse(ServerWebExchange exchange,
@Nullable Map<String, String> body, SecurityResponse securityResponse) {
if (!securityResponse.getStatus().equals(HttpStatus.OK)) {
return Mono.just(new ResponseEntity<>(securityResponse.getStatus()));
}

2
module/spring-boot-cloudfoundry/src/main/java/org/springframework/boot/cloudfoundry/actuate/autoconfigure/endpoint/servlet/CloudFoundryWebEndpointServletHandlerMapping.java

@ -156,7 +156,7 @@ class CloudFoundryWebEndpointServletHandlerMapping extends AbstractWebMvcEndpoin @@ -156,7 +156,7 @@ class CloudFoundryWebEndpointServletHandlerMapping extends AbstractWebMvcEndpoin
}
@Override
public Object handle(HttpServletRequest request, Map<String, String> body) {
public @Nullable Object handle(HttpServletRequest request, @Nullable Map<String, String> body) {
SecurityResponse securityResponse = this.securityInterceptor.preHandle(request, this.endpointId);
if (!securityResponse.getStatus().equals(HttpStatus.OK)) {
return new ResponseEntity<Object>(securityResponse.getMessage(), securityResponse.getStatus());

Loading…
Cancel
Save