Browse Source

Polishing

pull/1905/merge
Juergen Hoeller 6 years ago
parent
commit
109552d868
  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.isTraceEnabled()) {
logger.trace("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.isTraceEnabled()) {
logger.trace("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

@ -436,11 +436,12 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { @@ -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.
* <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();
@ -458,7 +459,7 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { @@ -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.
* <p>Override this method if you would like to customize resolution
@ -544,7 +545,8 @@ public class XmlBeanDefinitionReader extends AbstractBeanDefinitionReader { @@ -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}.
* <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