There is no need to judge whether the HandlerMethodArgumentResolver
supports it before getting the parameters
https://github.com/spring-projects/spring-framework/blob/v5.3.16/spring-web/src/main/java/org/springframework/web/method/support/InvocableHandlerMethod.java#L175-L177
Because method HandlerMethodArgumentResolverComposite#resolveArgument
already has the same logic
HandlerMethodArgumentResolverComposite#supportsParameter
also calls #getArgumentResolver
to determine whether the parameter is supported.
https://github.com/spring-projects/spring-framework/blob/v5.3.16/spring-web/src/main/java/org/springframework/web/method/support/HandlerMethodArgumentResolverComposite.java#L118-L121
Comment From: rstoyanchev
InvocableHandlerMethod
calls supportsParameter
before calling resolveArgument
as the API is supposed to be used. The check in HandlerMethodArgumentResolverComposite
is more of a defensive check, since resolveArgument
is a public method that could be called from any other place. Thanks for the suggestion but we'll keep it as is.