From 39eb9fcc886010e535992bc74e9a046512e8be94 Mon Sep 17 00:00:00 2001 From: lucky8987 Date: Wed, 4 Dec 2024 01:25:38 +0800 Subject: [PATCH] Updates to instanceof with variable --- .../gateway/webflux/config/ProxyExchangeArgumentResolver.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spring-cloud-gateway-webflux/src/main/java/org/springframework/cloud/gateway/webflux/config/ProxyExchangeArgumentResolver.java b/spring-cloud-gateway-webflux/src/main/java/org/springframework/cloud/gateway/webflux/config/ProxyExchangeArgumentResolver.java index 7aa521631b..7a7ef29c4a 100644 --- a/spring-cloud-gateway-webflux/src/main/java/org/springframework/cloud/gateway/webflux/config/ProxyExchangeArgumentResolver.java +++ b/spring-cloud-gateway-webflux/src/main/java/org/springframework/cloud/gateway/webflux/config/ProxyExchangeArgumentResolver.java @@ -74,8 +74,7 @@ public boolean supportsParameter(MethodParameter parameter) { private Type type(MethodParameter parameter) { Type type = parameter.getGenericParameterType(); - if (type instanceof ParameterizedType) { - ParameterizedType param = (ParameterizedType) type; + if (type instanceof ParameterizedType param) { type = param.getActualTypeArguments()[0]; } if (type instanceof TypeVariable || type instanceof WildcardType) {