diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java index 1fd873d381..91380d5c0a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java @@ -165,9 +165,8 @@ public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver if (logger.isTraceEnabled()) { logger.trace("Loaded NamespaceHandler mappings: " + mappings); } - Map mappingsToUse = new ConcurrentHashMap<>(mappings.size()); - CollectionUtils.mergePropertiesIntoMap(mappings, mappingsToUse); - handlerMappings = mappingsToUse; + handlerMappings = new ConcurrentHashMap<>(mappings.size()); + CollectionUtils.mergePropertiesIntoMap(mappings, handlerMappings); this.handlerMappings = handlerMappings; } catch (IOException ex) { diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java index 257461792c..96ac31fda4 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java @@ -152,9 +152,8 @@ public class PluggableSchemaResolver implements EntityResolver { if (logger.isTraceEnabled()) { logger.trace("Loaded schema mappings: " + mappings); } - Map mappingsToUse = new ConcurrentHashMap<>(mappings.size()); - CollectionUtils.mergePropertiesIntoMap(mappings, mappingsToUse); - schemaMappings = mappingsToUse; + schemaMappings = new ConcurrentHashMap<>(mappings.size()); + CollectionUtils.mergePropertiesIntoMap(mappings, schemaMappings); this.schemaMappings = schemaMappings; } catch (IOException ex) { diff --git a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java index 1540f21b05..f3e54c996a 100644 --- a/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java +++ b/spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java @@ -436,11 +436,12 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { } /** - * Gets the validation mode for the specified {@link Resource}. If no explicit - * validation mode has been configured then the validation mode is - * {@link #detectValidationMode detected}. + * Determine the validation mode for the specified {@link Resource}. + * If no explicit validation mode has been configured, then the validation + * mode gets {@link #detectValidationMode detected} from the given resource. *

Override this method if you would like full control over the validation * mode, even when something other than {@link #VALIDATION_AUTO} was set. + * @see #detectValidationMode */ protected int getValidationModeForResource(Resource resource) { int validationModeToUse = getValidationMode(); @@ -458,7 +459,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { } /** - * Detects which kind of validation to perform on the XML file identified + * Detect which kind of validation to perform on the XML file identified * by the supplied {@link Resource}. If the file has a {@code DOCTYPE} * definition then DTD validation is used otherwise XSD validation is assumed. *

Override this method if you would like to customize resolution @@ -544,7 +545,8 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { /** * Create the default implementation of {@link NamespaceHandlerResolver} used if none is specified. - * Default implementation returns an instance of {@link DefaultNamespaceHandlerResolver}. + *

The default implementation returns an instance of {@link DefaultNamespaceHandlerResolver}. + * @see DefaultNamespaceHandlerResolver#DefaultNamespaceHandlerResolver(ClassLoader) */ protected NamespaceHandlerResolver createDefaultNamespaceHandlerResolver() { ClassLoader cl = (getResourceLoader() != null ? getResourceLoader().getClassLoader() : getBeanClassLoader());