Merge branch '5.1.x'
This commit is contained in:
@@ -377,7 +377,7 @@ public class BeanDefinitionParserDelegate {
|
||||
*/
|
||||
public BeanDefinitionDefaults getBeanDefinitionDefaults() {
|
||||
BeanDefinitionDefaults bdd = new BeanDefinitionDefaults();
|
||||
bdd.setLazyInit("TRUE".equalsIgnoreCase(this.defaults.getLazyInit()));
|
||||
bdd.setLazyInit(TRUE_VALUE.equalsIgnoreCase(this.defaults.getLazyInit()));
|
||||
bdd.setAutowireMode(getAutowireMode(DEFAULT_VALUE));
|
||||
bdd.setInitMethodName(this.defaults.getInitMethod());
|
||||
bdd.setDestroyMethodName(this.defaults.getDestroyMethod());
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2018 the original author or authors.
|
||||
* Copyright 2002-2019 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.
|
||||
@@ -82,8 +82,9 @@ public abstract class LogFormatUtils {
|
||||
*/
|
||||
public static void traceDebug(Log logger, Function<Boolean, String> messageFactory) {
|
||||
if (logger.isDebugEnabled()) {
|
||||
String logMessage = messageFactory.apply(logger.isTraceEnabled());
|
||||
if (logger.isTraceEnabled()) {
|
||||
boolean traceEnabled = logger.isTraceEnabled();
|
||||
String logMessage = messageFactory.apply(traceEnabled);
|
||||
if (traceEnabled) {
|
||||
logger.trace(logMessage);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -64,6 +64,8 @@ import org.springframework.util.StringUtils;
|
||||
* <li>{@link #set(String, String)} sets the header value to a single string value</li>
|
||||
* </ul>
|
||||
*
|
||||
* <p>Note that {@code HttpHeaders} generally treats header names in a case-insensitive manner.
|
||||
*
|
||||
* @author Arjen Poutsma
|
||||
* @author Sebastien Deleuze
|
||||
* @author Brian Clozel
|
||||
@@ -416,6 +418,7 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
/**
|
||||
* Construct a new, empty instance of the {@code HttpHeaders} object.
|
||||
* <p>This is the common constructor, using a case-insensitive map structure.
|
||||
*/
|
||||
public HttpHeaders() {
|
||||
this(CollectionUtils.toMultiValueMap(new LinkedCaseInsensitiveMap<>(8, Locale.ENGLISH)));
|
||||
@@ -423,6 +426,9 @@ public class HttpHeaders implements MultiValueMap<String, String>, Serializable
|
||||
|
||||
/**
|
||||
* Construct a new {@code HttpHeaders} instance backed by an existing map.
|
||||
* <p>This constructor is available as an optimization for adapting to existing
|
||||
* headers map structures, primarily for internal use within the framework.
|
||||
* @param headers the headers map (expected to operate with case-insensitive keys)
|
||||
* @since 5.1
|
||||
*/
|
||||
public HttpHeaders(MultiValueMap<String, String> headers) {
|
||||
|
||||
@@ -117,7 +117,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
public void setAlwaysUseFullPath(boolean alwaysUseFullPath) {
|
||||
this.urlPathHelper.setAlwaysUseFullPath(alwaysUseFullPath);
|
||||
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
|
||||
((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setAlwaysUseFullPath(alwaysUseFullPath);
|
||||
((UrlBasedCorsConfigurationSource) this.corsConfigurationSource).setAlwaysUseFullPath(alwaysUseFullPath);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,7 +128,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
public void setUrlDecode(boolean urlDecode) {
|
||||
this.urlPathHelper.setUrlDecode(urlDecode);
|
||||
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
|
||||
((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setUrlDecode(urlDecode);
|
||||
((UrlBasedCorsConfigurationSource) this.corsConfigurationSource).setUrlDecode(urlDecode);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,7 +139,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
public void setRemoveSemicolonContent(boolean removeSemicolonContent) {
|
||||
this.urlPathHelper.setRemoveSemicolonContent(removeSemicolonContent);
|
||||
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
|
||||
((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setRemoveSemicolonContent(removeSemicolonContent);
|
||||
((UrlBasedCorsConfigurationSource) this.corsConfigurationSource).setRemoveSemicolonContent(removeSemicolonContent);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
Assert.notNull(urlPathHelper, "UrlPathHelper must not be null");
|
||||
this.urlPathHelper = urlPathHelper;
|
||||
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
|
||||
((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setUrlPathHelper(urlPathHelper);
|
||||
((UrlBasedCorsConfigurationSource) this.corsConfigurationSource).setUrlPathHelper(urlPathHelper);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -173,7 +173,7 @@ public abstract class AbstractHandlerMapping extends WebApplicationObjectSupport
|
||||
Assert.notNull(pathMatcher, "PathMatcher must not be null");
|
||||
this.pathMatcher = pathMatcher;
|
||||
if (this.corsConfigurationSource instanceof UrlBasedCorsConfigurationSource) {
|
||||
((UrlBasedCorsConfigurationSource)this.corsConfigurationSource).setPathMatcher(pathMatcher);
|
||||
((UrlBasedCorsConfigurationSource) this.corsConfigurationSource).setPathMatcher(pathMatcher);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -169,7 +169,7 @@ public class MvcNamespaceTests {
|
||||
|
||||
|
||||
@Before
|
||||
public void setUp() throws Exception {
|
||||
public void setup() throws Exception {
|
||||
TestMockServletContext servletContext = new TestMockServletContext();
|
||||
appContext = new XmlWebApplicationContext();
|
||||
appContext.setServletContext(servletContext);
|
||||
@@ -889,7 +889,7 @@ public class MvcNamespaceTests {
|
||||
AbstractHandlerMapping handlerMapping = (AbstractHandlerMapping)appContext.getBean(beanName);
|
||||
assertNotNull(handlerMapping);
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(handlerMapping);
|
||||
Map<String, CorsConfiguration> configs = ((UrlBasedCorsConfigurationSource)accessor
|
||||
Map<String, CorsConfiguration> configs = ((UrlBasedCorsConfigurationSource) accessor
|
||||
.getPropertyValue("corsConfigurationSource")).getCorsConfigurations();
|
||||
assertNotNull(configs);
|
||||
assertEquals(1, configs.size());
|
||||
@@ -914,7 +914,7 @@ public class MvcNamespaceTests {
|
||||
AbstractHandlerMapping handlerMapping = (AbstractHandlerMapping)appContext.getBean(beanName);
|
||||
assertNotNull(handlerMapping);
|
||||
DirectFieldAccessor accessor = new DirectFieldAccessor(handlerMapping);
|
||||
Map<String, CorsConfiguration> configs = ((UrlBasedCorsConfigurationSource)accessor
|
||||
Map<String, CorsConfiguration> configs = ((UrlBasedCorsConfigurationSource) accessor
|
||||
.getPropertyValue("corsConfigurationSource")).getCorsConfigurations();
|
||||
assertNotNull(configs);
|
||||
assertEquals(2, configs.size());
|
||||
|
||||
Reference in New Issue
Block a user