Browse Source

Polishing

5.0.x
Juergen Hoeller 5 years ago
parent
commit
04a2cd49d4
  1. 9
      spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java
  2. 11
      spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java
  3. 11
      spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java
  4. 11
      spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java
  5. 20
      spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java
  6. 8
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java
  7. 3
      spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestAttributeMethodArgumentResolver.java
  8. 12
      spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java
  9. 17
      spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java
  10. 21
      spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java

9
spring-context/src/main/java/org/springframework/context/ConfigurableApplicationContext.java

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -148,11 +148,12 @@ public interface ConfigurableApplicationContext extends ApplicationContext, Life
void addProtocolResolver(ProtocolResolver resolver); void addProtocolResolver(ProtocolResolver resolver);
/** /**
* Load or refresh the persistent representation of the configuration, * Load or refresh the persistent representation of the configuration, which
* which might an XML file, properties file, or relational database schema. * might be from Java-based configuration, an XML file, a properties file, a
* relational database schema, or some other format.
* <p>As this is a startup method, it should destroy already created singletons * <p>As this is a startup method, it should destroy already created singletons
* if it fails, to avoid dangling resources. In other words, after invocation * if it fails, to avoid dangling resources. In other words, after invocation
* of that method, either all or no singletons at all should be instantiated. * of this method, either all or no singletons at all should be instantiated.
* @throws BeansException if the bean factory could not be initialized * @throws BeansException if the bean factory could not be initialized
* @throws IllegalStateException if already initialized and multiple refresh * @throws IllegalStateException if already initialized and multiple refresh
* attempts are not supported * attempts are not supported

11
spring-context/src/main/java/org/springframework/ejb/config/AbstractJndiLocatingBeanDefinitionParser.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2007 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -24,7 +24,9 @@ import org.springframework.beans.factory.xml.AbstractSimpleBeanDefinitionParser;
import org.springframework.util.StringUtils; import org.springframework.util.StringUtils;
import org.springframework.util.xml.DomUtils; import org.springframework.util.xml.DomUtils;
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.*; import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.DEFAULT_VALUE;
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.LAZY_INIT_ATTRIBUTE;
import static org.springframework.beans.factory.xml.BeanDefinitionParserDelegate.TRUE_VALUE;
/** /**
* Abstract base class for BeanDefinitionParsers which build * Abstract base class for BeanDefinitionParsers which build
@ -47,8 +49,9 @@ abstract class AbstractJndiLocatingBeanDefinitionParser extends AbstractSimpleBe
@Override @Override
protected boolean isEligibleAttribute(String attributeName) { protected boolean isEligibleAttribute(String attributeName) {
return (super.isEligibleAttribute(attributeName) && !ENVIRONMENT_REF.equals(attributeName) && !LAZY_INIT_ATTRIBUTE return (super.isEligibleAttribute(attributeName) &&
.equals(attributeName)); !ENVIRONMENT_REF.equals(attributeName) &&
!LAZY_INIT_ATTRIBUTE.equals(attributeName));
} }
@Override @Override

11
spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericCallMetaDataProvider.java

@ -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"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -43,12 +43,11 @@ import org.springframework.util.StringUtils;
*/ */
public class GenericCallMetaDataProvider implements CallMetaDataProvider { public class GenericCallMetaDataProvider implements CallMetaDataProvider {
/** Logger available to subclasses */ /** Logger available to subclasses. */
protected static final Log logger = LogFactory.getLog(CallMetaDataProvider.class); protected static final Log logger = LogFactory.getLog(CallMetaDataProvider.class);
private boolean procedureColumnMetaDataUsed = false;
private String userName; private final String userName;
private boolean supportsCatalogsInProcedureCalls = true; private boolean supportsCatalogsInProcedureCalls = true;
@ -58,7 +57,9 @@ public class GenericCallMetaDataProvider implements CallMetaDataProvider {
private boolean storesLowerCaseIdentifiers = false; private boolean storesLowerCaseIdentifiers = false;
private List<CallParameterMetaData> callParameterMetaData = new ArrayList<>(); private boolean procedureColumnMetaDataUsed = false;
private final List<CallParameterMetaData> callParameterMetaData = new ArrayList<>();
/** /**

11
spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistration.java

@ -16,7 +16,6 @@
package org.springframework.web.reactive.config; package org.springframework.web.reactive.config;
import java.util.ArrayList;
import java.util.Arrays; import java.util.Arrays;
import org.springframework.web.cors.CorsConfiguration; import org.springframework.web.cors.CorsConfiguration;
@ -28,6 +27,7 @@ import org.springframework.web.cors.CorsConfiguration;
* @author Sebastien Deleuze * @author Sebastien Deleuze
* @author Rossen Stoyanchev * @author Rossen Stoyanchev
* @since 5.0 * @since 5.0
* @see CorsConfiguration
* @see CorsRegistry * @see CorsRegistry
*/ */
public class CorsRegistration { public class CorsRegistration {
@ -39,6 +39,7 @@ public class CorsRegistration {
public CorsRegistration(String pathPattern) { public CorsRegistration(String pathPattern) {
this.pathPattern = pathPattern; this.pathPattern = pathPattern;
// Same implicit default values as the @CrossOrigin annotation + allows simple methods
this.config = new CorsConfiguration().applyPermitDefaultValues(); this.config = new CorsConfiguration().applyPermitDefaultValues();
} }
@ -58,7 +59,7 @@ public class CorsRegistration {
* See the Spring Framework reference for more on this filter. * See the Spring Framework reference for more on this filter.
*/ */
public CorsRegistration allowedOrigins(String... origins) { public CorsRegistration allowedOrigins(String... origins) {
this.config.setAllowedOrigins(new ArrayList<>(Arrays.asList(origins))); this.config.setAllowedOrigins(Arrays.asList(origins));
return this; return this;
} }
@ -69,7 +70,7 @@ public class CorsRegistration {
* are allowed. * are allowed.
*/ */
public CorsRegistration allowedMethods(String... methods) { public CorsRegistration allowedMethods(String... methods) {
this.config.setAllowedMethods(new ArrayList<>(Arrays.asList(methods))); this.config.setAllowedMethods(Arrays.asList(methods));
return this; return this;
} }
@ -83,7 +84,7 @@ public class CorsRegistration {
* <p>By default all headers are allowed. * <p>By default all headers are allowed.
*/ */
public CorsRegistration allowedHeaders(String... headers) { public CorsRegistration allowedHeaders(String... headers) {
this.config.setAllowedHeaders(new ArrayList<>(Arrays.asList(headers))); this.config.setAllowedHeaders(Arrays.asList(headers));
return this; return this;
} }
@ -96,7 +97,7 @@ public class CorsRegistration {
* <p>By default this is not set. * <p>By default this is not set.
*/ */
public CorsRegistration exposedHeaders(String... headers) { public CorsRegistration exposedHeaders(String... headers) {
this.config.setExposedHeaders(new ArrayList<>(Arrays.asList(headers))); this.config.setExposedHeaders(Arrays.asList(headers));
return this; return this;
} }

20
spring-webflux/src/main/java/org/springframework/web/reactive/config/CorsRegistry.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2016 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -37,18 +37,12 @@ public class CorsRegistry {
/** /**
* Enable cross origin request handling for the specified path pattern. * Enable cross-origin request handling for the specified path pattern.
*
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as * <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}). * well as Ant-style path patterns (such as {@code "/admin/**"}).
* * <p>By default, the {@code CorsConfiguration} for this mapping is
* <p>The following defaults are applied to the {@link CorsRegistration}: * initialized with default values as described in
* <ul> * {@link CorsConfiguration#applyPermitDefaultValues()}.
* <li>Allow all origins.</li>
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
* <li>Allow all headers.</li>
* <li>Set max age to 1800 seconds (30 minutes).</li>
* </ul>
*/ */
public CorsRegistration addMapping(String pathPattern) { public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern); CorsRegistration registration = new CorsRegistration(pathPattern);
@ -56,6 +50,10 @@ public class CorsRegistry {
return registration; return registration;
} }
/**
* Return the registered {@link CorsConfiguration} objects,
* keyed by path pattern.
*/
protected Map<String, CorsConfiguration> getCorsConfigurations() { protected Map<String, CorsConfiguration> getCorsConfigurations() {
Map<String, CorsConfiguration> configs = new LinkedHashMap<>(this.registrations.size()); Map<String, CorsConfiguration> configs = new LinkedHashMap<>(this.registrations.size());
for (CorsRegistration registration : this.registrations) { for (CorsRegistration registration : this.registrations) {

8
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/ControllerMethodResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -83,7 +83,7 @@ class ControllerMethodResolver {
AnnotationUtils.findAnnotation(method, ModelAttribute.class) != null); AnnotationUtils.findAnnotation(method, ModelAttribute.class) != null);
private static Log logger = LogFactory.getLog(ControllerMethodResolver.class); private static final Log logger = LogFactory.getLog(ControllerMethodResolver.class);
private final List<SyncHandlerMethodArgumentResolver> initBinderResolvers; private final List<SyncHandlerMethodArgumentResolver> initBinderResolvers;
@ -95,14 +95,12 @@ class ControllerMethodResolver {
private final ReactiveAdapterRegistry reactiveAdapterRegistry; private final ReactiveAdapterRegistry reactiveAdapterRegistry;
private final Map<Class<?>, Set<Method>> initBinderMethodCache = new ConcurrentHashMap<>(64); private final Map<Class<?>, Set<Method>> initBinderMethodCache = new ConcurrentHashMap<>(64);
private final Map<Class<?>, Set<Method>> modelAttributeMethodCache = new ConcurrentHashMap<>(64); private final Map<Class<?>, Set<Method>> modelAttributeMethodCache = new ConcurrentHashMap<>(64);
private final Map<Class<?>, ExceptionHandlerMethodResolver> exceptionHandlerCache = new ConcurrentHashMap<>(64); private final Map<Class<?>, ExceptionHandlerMethodResolver> exceptionHandlerCache = new ConcurrentHashMap<>(64);
private final Map<ControllerAdviceBean, Set<Method>> initBinderAdviceCache = new LinkedHashMap<>(64); private final Map<ControllerAdviceBean, Set<Method>> initBinderAdviceCache = new LinkedHashMap<>(64);
private final Map<ControllerAdviceBean, Set<Method>> modelAttributeAdviceCache = new LinkedHashMap<>(64); private final Map<ControllerAdviceBean, Set<Method>> modelAttributeAdviceCache = new LinkedHashMap<>(64);
@ -169,7 +167,7 @@ class ControllerMethodResolver {
boolean requestMappingMethod = !readers.isEmpty() && supportDataBinding; boolean requestMappingMethod = !readers.isEmpty() && supportDataBinding;
// Annotation-based... // Annotation-based...
List<HandlerMethodArgumentResolver> result = new ArrayList<>(); List<HandlerMethodArgumentResolver> result = new ArrayList<>(30);
result.add(new RequestParamMethodArgumentResolver(beanFactory, adapterRegistry, false)); result.add(new RequestParamMethodArgumentResolver(beanFactory, adapterRegistry, false));
result.add(new RequestParamMapMethodArgumentResolver(adapterRegistry)); result.add(new RequestParamMapMethodArgumentResolver(adapterRegistry));
result.add(new PathVariableMethodArgumentResolver(beanFactory, adapterRegistry)); result.add(new PathVariableMethodArgumentResolver(beanFactory, adapterRegistry));

3
spring-webflux/src/main/java/org/springframework/web/reactive/result/method/annotation/RequestAttributeMethodArgumentResolver.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -38,7 +38,6 @@ import org.springframework.web.server.ServerWebInputException;
*/ */
public class RequestAttributeMethodArgumentResolver extends AbstractNamedValueSyncArgumentResolver { public class RequestAttributeMethodArgumentResolver extends AbstractNamedValueSyncArgumentResolver {
/** /**
* @param factory a bean factory to use for resolving ${...} * @param factory a bean factory to use for resolving ${...}
* placeholder and #{...} SpEL expressions in default values; * placeholder and #{...} SpEL expressions in default values;

12
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistration.java

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

17
spring-webmvc/src/main/java/org/springframework/web/servlet/config/annotation/CorsRegistry.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2017 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -39,20 +39,11 @@ public class CorsRegistry {
/** /**
* Enable cross-origin request handling for the specified path pattern. * Enable cross-origin request handling for the specified path pattern.
*
* <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as * <p>Exact path mapping URIs (such as {@code "/admin"}) are supported as
* well as Ant-style path patterns (such as {@code "/admin/**"}). * well as Ant-style path patterns (such as {@code "/admin/**"}).
* <p>By default, all origins, all headers, credentials and {@code GET}, * <p>By default, the {@code CorsConfiguration} for this mapping is
* {@code HEAD}, and {@code POST} methods are allowed, and the max age * initialized with default values as described in
* is set to 30 minutes. * {@link CorsConfiguration#applyPermitDefaultValues()}.
*
* <p>The following defaults are applied to the {@link CorsRegistration}:
* <ul>
* <li>Allow all origins.</li>
* <li>Allow "simple" methods {@code GET}, {@code HEAD} and {@code POST}.</li>
* <li>Allow all headers.</li>
* <li>Set max age to 1800 seconds (30 minutes).</li>
* </ul>
*/ */
public CorsRegistration addMapping(String pathPattern) { public CorsRegistration addMapping(String pathPattern) {
CorsRegistration registration = new CorsRegistration(pathPattern); CorsRegistration registration = new CorsRegistration(pathPattern);

21
spring-webmvc/src/main/java/org/springframework/web/servlet/mvc/method/annotation/RequestMappingHandlerAdapter.java

@ -1,5 +1,5 @@
/* /*
* Copyright 2002-2019 the original author or authors. * Copyright 2002-2020 the original author or authors.
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -151,7 +151,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
private List<HttpMessageConverter<?>> messageConverters; private List<HttpMessageConverter<?>> messageConverters;
private List<Object> requestResponseBodyAdvice = new ArrayList<>(); private final List<Object> requestResponseBodyAdvice = new ArrayList<>();
@Nullable @Nullable
private WebBindingInitializer webBindingInitializer; private WebBindingInitializer webBindingInitializer;
@ -180,7 +180,6 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
@Nullable @Nullable
private ConfigurableBeanFactory beanFactory; private ConfigurableBeanFactory beanFactory;
private final Map<Class<?>, SessionAttributesHandler> sessionAttributesHandlerCache = new ConcurrentHashMap<>(64); private final Map<Class<?>, SessionAttributesHandler> sessionAttributesHandlerCache = new ConcurrentHashMap<>(64);
private final Map<Class<?>, Set<Method>> initBinderCache = new ConcurrentHashMap<>(64); private final Map<Class<?>, Set<Method>> initBinderCache = new ConcurrentHashMap<>(64);
@ -412,7 +411,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* processing thread has exited and ends when the request is dispatched again * processing thread has exited and ends when the request is dispatched again
* for further processing of the concurrently produced result. * for further processing of the concurrently produced result.
* <p>If this value is not set, the default timeout of the underlying * <p>If this value is not set, the default timeout of the underlying
* implementation is used, e.g. 10 seconds on Tomcat with Servlet 3. * implementation is used.
* @param timeout the timeout value in milliseconds * @param timeout the timeout value in milliseconds
*/ */
public void setAsyncRequestTimeout(long timeout) { public void setAsyncRequestTimeout(long timeout) {
@ -639,7 +638,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* and custom resolvers provided via {@link #setCustomArgumentResolvers}. * and custom resolvers provided via {@link #setCustomArgumentResolvers}.
*/ */
private List<HandlerMethodArgumentResolver> getDefaultArgumentResolvers() { private List<HandlerMethodArgumentResolver> getDefaultArgumentResolvers() {
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(); List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(30);
// Annotation-based argument resolution // Annotation-based argument resolution
resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false)); resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false));
@ -686,7 +685,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* methods including built-in and custom resolvers. * methods including built-in and custom resolvers.
*/ */
private List<HandlerMethodArgumentResolver> getDefaultInitBinderArgumentResolvers() { private List<HandlerMethodArgumentResolver> getDefaultInitBinderArgumentResolvers() {
List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(); List<HandlerMethodArgumentResolver> resolvers = new ArrayList<>(20);
// Annotation-based argument resolution // Annotation-based argument resolution
resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false)); resolvers.add(new RequestParamMethodArgumentResolver(getBeanFactory(), false));
@ -719,7 +718,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
* custom handlers provided via {@link #setReturnValueHandlers}. * custom handlers provided via {@link #setReturnValueHandlers}.
*/ */
private List<HandlerMethodReturnValueHandler> getDefaultReturnValueHandlers() { private List<HandlerMethodReturnValueHandler> getDefaultReturnValueHandlers() {
List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(); List<HandlerMethodReturnValueHandler> handlers = new ArrayList<>(20);
// Single-purpose return value types // Single-purpose return value types
handlers.add(new ModelAndViewMethodReturnValueHandler()); handlers.add(new ModelAndViewMethodReturnValueHandler());
@ -834,7 +833,7 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
synchronized (this.sessionAttributesHandlerCache) { synchronized (this.sessionAttributesHandlerCache) {
sessionAttrHandler = this.sessionAttributesHandlerCache.get(handlerType); sessionAttrHandler = this.sessionAttributesHandlerCache.get(handlerType);
if (sessionAttrHandler == null) { if (sessionAttrHandler == null) {
sessionAttrHandler = new SessionAttributesHandler(handlerType, sessionAttributeStore); sessionAttrHandler = new SessionAttributesHandler(handlerType, this.sessionAttributeStore);
this.sessionAttributesHandlerCache.put(handlerType, sessionAttrHandler); this.sessionAttributesHandlerCache.put(handlerType, sessionAttrHandler);
} }
} }
@ -957,9 +956,9 @@ public class RequestMappingHandlerAdapter extends AbstractHandlerMethodAdapter
} }
List<InvocableHandlerMethod> initBinderMethods = new ArrayList<>(); List<InvocableHandlerMethod> initBinderMethods = new ArrayList<>();
// Global methods first // Global methods first
this.initBinderAdviceCache.forEach((clazz, methodSet) -> { this.initBinderAdviceCache.forEach((controllerAdviceBean, methodSet) -> {
if (clazz.isApplicableToBeanType(handlerType)) { if (controllerAdviceBean.isApplicableToBeanType(handlerType)) {
Object bean = clazz.resolveBean(); Object bean = controllerAdviceBean.resolveBean();
for (Method method : methodSet) { for (Method method : methodSet) {
initBinderMethods.add(createInitBinderMethod(bean, method)); initBinderMethods.add(createInitBinderMethod(bean, method));
} }

Loading…
Cancel
Save