Polishing

This commit is contained in:
Juergen Hoeller
2020-07-17 17:48:33 +02:00
parent 30bf870810
commit e9898f7d52
10 changed files with 42 additions and 40 deletions

View File

@@ -67,9 +67,9 @@ public class CorsRegistration {
/**
* Set the HTTP methods to allow, e.g. {@code "GET"}, {@code "POST"}, etc.
* The special value {@code "*"} allows all methods.
* <p>By default "simple" methods, i.e. {@code GET}, {@code HEAD}, and
* {@code POST} are allowed.
* <p>The special value {@code "*"} allows all methods.
* <p>By default "simple" methods {@code GET}, {@code HEAD}, and {@code POST}
* are allowed.
*/
public CorsRegistration allowedMethods(String... methods) {
this.config.setAllowedMethods(Arrays.asList(methods));
@@ -77,9 +77,9 @@ public class CorsRegistration {
}
/**
* Set the list of headers that a preflight request can list as allowed
* for use during an actual request. The special value {@code "*"} may be
* used to allow all headers.
* Set the list of headers that a pre-flight request can list as allowed
* for use during an actual request.
* <p>The special value {@code "*"} may be used to allow all headers.
* <p>A header name is not required to be listed if it is one of:
* {@code Cache-Control}, {@code Content-Language}, {@code Expires},
* {@code Last-Modified}, or {@code Pragma} as per the CORS spec.

View File

@@ -39,10 +39,8 @@ public class CorsRegistry {
/**
* Enable cross-origin request handling for the specified path pattern.
*
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}).
*
* <p>By default, the {@code CorsConfiguration} for this mapping is
* initialized with default values as described in
* {@link CorsConfiguration#applyPermitDefaultValues()}.

View File

@@ -151,7 +151,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
private List<HttpMessageConverter<?>> messageConverters;
private List<Object> requestResponseBodyAdvice = new ArrayList<>();
private final List<Object> requestResponseBodyAdvice = new ArrayList<>();
@Nullable
private WebBindingInitializer webBindingInitializer;
@@ -632,7 +632,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* and custom resolvers provided via {@link #setCustomArgumentResolvers}.
*/
private List<HandlerMethodArgumentResolver> getDefaultArgumentResolvers() {
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(30);
// Annotation-based argument resolution
resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false));
@@ -679,7 +679,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* methods including built-in and custom resolvers.
*/
private List<HandlerMethodArgumentResolver> getDefaultInitBinderArgumentResolvers() {
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>();
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(20);
// Annotation-based argument resolution
resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false));
@@ -712,7 +712,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* custom handlers provided via {@link #setReturnValueHandlers}.
*/
private List<HandlerMethodReturnValueHandler> getDefaultReturnValueHandlers() {
List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>();
List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(20);
// Single-purpose return value types
handlers.add(new ModelAndViewMethodReturnValueHandler());