Browse Source

Polishing

pull/1916/head
Juergen Hoeller 8 years ago
parent
commit
006db06d11
  1. 5
      spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java
  2. 5
      spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java
  3. 12
      spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java

5
spring-beans/src/main/java/org/springframework/beans/factory/xml/DefaultNamespaceHandlerResolver.java

@ -165,9 +165,8 @@ public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver @@ -165,9 +165,8 @@ public class DefaultNamespaceHandlerResolver implements NamespaceHandlerResolver
if (logger.isDebugEnabled()) {
logger.debug("Loaded NamespaceHandler mappings: " + mappings);
}
Map<String, Object> 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) {

5
spring-beans/src/main/java/org/springframework/beans/factory/xml/PluggableSchemaResolver.java

@ -152,9 +152,8 @@ public class PluggableSchemaResolver implements EntityResolver { @@ -152,9 +152,8 @@ public class PluggableSchemaResolver implements EntityResolver {
if (logger.isDebugEnabled()) {
logger.debug("Loaded schema mappings: " + mappings);
}
Map<String, String> 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) {

12
spring-beans/src/main/java/org/springframework/beans/factory/xml/XmlBeanDefinitionReader.java

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
/*
* Copyright 2002-2017 the original author or authors.
* Copyright 2002-2018 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.
@ -431,11 +431,12 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { @@ -431,11 +431,12 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader {
}
/**
* Get 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.
* <p>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();
@ -539,7 +540,8 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { @@ -539,7 +540,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}.
* <p>The default implementation returns an instance of {@link DefaultNamespaceHandlerResolver}.
* @see DefaultNamespaceHandlerResolver#DefaultNamespaceHandlerResolver(ClassLoader)
*/
protected NamespaceHandlerResolver createDefaultNamespaceHandlerResolver() {
ClassLoader cl = (getResourceLoader() != null ? getResourceLoader().getClassLoader() : getBeanClassLoader());

Loading…
Cancel
Save