From 41c9903e9a446259b313f99d4bb452f82616b104 Mon Sep 17 00:00:00 2001 From: sgibb Date: Tue, 20 Jun 2023 18:23:04 -0400 Subject: [PATCH] polish --- .../GatewayMvcPropertiesBeanDefinitionRegistrar.java | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java index 01e2d74d1..886647452 100644 --- a/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java +++ b/spring-cloud-gateway-server-mvc/src/main/java/org/springframework/cloud/gateway/server/mvc/config/GatewayMvcPropertiesBeanDefinitionRegistrar.java @@ -165,13 +165,12 @@ public class GatewayMvcPropertiesBeanDefinitionRegistrar implements ImportBeanDe private void translate(MultiValueMap operations, String operationName, Map operationArgs, Class returnType, Consumer operationHandler) { String normalizedName = StringUtils.uncapitalize(operationName); - Optional filterOperationMethod = operations.get(normalizedName).stream() - .filter(operationMethod -> matchOperation(operationMethod, operationArgs)).findFirst(); - if (filterOperationMethod.isPresent()) { - ReflectiveOperationInvoker operationInvoker = new ReflectiveOperationInvoker(filterOperationMethod.get(), + Optional operationMethod = operations.get(normalizedName).stream() + .filter(opeMethod -> matchOperation(opeMethod, operationArgs)).findFirst(); + if (operationMethod.isPresent()) { + ReflectiveOperationInvoker operationInvoker = new ReflectiveOperationInvoker(operationMethod.get(), this.parameterValueMapper); - Map args = new HashMap<>(); - args.putAll(operationArgs); + Map args = new HashMap<>(operationArgs); InvocationContext context = new InvocationContext(args, trueNullOperationArgumentResolver); T handlerFilterFunction = operationInvoker.invoke(context); if (handlerFilterFunction != null) {