From e0bb9e700bcaa95b0771c7b856b4cbf3842defb8 Mon Sep 17 00:00:00 2001 From: Andy Wilkinson Date: Tue, 19 Sep 2017 20:52:51 +0100 Subject: [PATCH] Tidy up generics in WebFluxEndpointHandlerMapping Closes gh-10113 --- .../web/reactive/WebFluxEndpointHandlerMapping.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMapping.java b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMapping.java index ff1a2fb593a..23783f5abbf 100644 --- a/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMapping.java +++ b/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/endpoint/web/reactive/WebFluxEndpointHandlerMapping.java @@ -202,8 +202,8 @@ public class WebFluxEndpointHandlerMapping extends RequestMappingInfoHandlerMapp this.operationInvoker = operationInvoker; } - @SuppressWarnings({ "unchecked", "rawtypes" }) - Publisher> doHandle(ServerWebExchange exchange, + @SuppressWarnings({ "unchecked" }) + Publisher> doHandle(ServerWebExchange exchange, Map body) { Map arguments = new HashMap<>((Map) exchange .getAttribute(HandlerMapping.URI_TEMPLATE_VARIABLES_ATTRIBUTE)); @@ -212,8 +212,7 @@ public class WebFluxEndpointHandlerMapping extends RequestMappingInfoHandlerMapp } exchange.getRequest().getQueryParams().forEach((name, values) -> arguments .put(name, values.size() == 1 ? values.get(0) : values)); - return (Publisher) handleResult( - (Publisher) this.operationInvoker.invoke(arguments), + return handleResult((Publisher) this.operationInvoker.invoke(arguments), exchange.getRequest().getMethod()); } @@ -247,7 +246,7 @@ public class WebFluxEndpointHandlerMapping extends RequestMappingInfoHandlerMapp } @ResponseBody - public Publisher> handle(ServerWebExchange exchange, + public Publisher> handle(ServerWebExchange exchange, @RequestBody(required = false) Map body) { return doHandle(exchange, body); } @@ -264,7 +263,7 @@ public class WebFluxEndpointHandlerMapping extends RequestMappingInfoHandlerMapp } @ResponseBody - public Publisher> handle(ServerWebExchange exchange) { + public Publisher> handle(ServerWebExchange exchange) { return doHandle(exchange, null); }