Polishing contribution
Closes gh-25780
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2020 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -19,7 +19,6 @@ package org.springframework.web.servlet.mvc.method.annotation;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.Reader;
|
||||
import java.lang.annotation.Annotation;
|
||||
import java.security.Principal;
|
||||
import java.time.ZoneId;
|
||||
import java.util.Locale;
|
||||
@@ -85,13 +84,12 @@ public class ServletRequestMethodArgumentResolver implements HandlerMethodArgume
|
||||
@Override
|
||||
public boolean supportsParameter(MethodParameter parameter) {
|
||||
Class<?> paramType = parameter.getParameterType();
|
||||
final Annotation[] parameterAnnotations = parameter.getParameterAnnotations();
|
||||
return (WebRequest.class.isAssignableFrom(paramType) ||
|
||||
ServletRequest.class.isAssignableFrom(paramType) ||
|
||||
MultipartRequest.class.isAssignableFrom(paramType) ||
|
||||
HttpSession.class.isAssignableFrom(paramType) ||
|
||||
(pushBuilder != null && pushBuilder.isAssignableFrom(paramType)) ||
|
||||
(Principal.class.isAssignableFrom(paramType) && parameterAnnotations.length == 0) ||
|
||||
(Principal.class.isAssignableFrom(paramType) && parameter.getParameterAnnotations().length == 0) ||
|
||||
InputStream.class.isAssignableFrom(paramType) ||
|
||||
Reader.class.isAssignableFrom(paramType) ||
|
||||
HttpMethod.class == paramType ||
|
||||
|
||||
Reference in New Issue
Block a user