Skip to content

Commit 109552d

Browse files
committed
Polishing
1 parent 1c40e36 commit 109552d

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -165,9 +165,8 @@ private Map<String, Object> getHandlerMappings() {
165165
if (logger.isTraceEnabled()) {
166166
logger.trace("Loaded NamespaceHandler mappings: " + mappings);
167167
}
168-
Map<String, Object> mappingsToUse = new ConcurrentHashMap<>(mappings.size());
169-
CollectionUtils.mergePropertiesIntoMap(mappings, mappingsToUse);
170-
handlerMappings = mappingsToUse;
168+
handlerMappings = new ConcurrentHashMap<>(mappings.size());
169+
CollectionUtils.mergePropertiesIntoMap(mappings, handlerMappings);
171170
this.handlerMappings = handlerMappings;
172171
}
173172
catch (IOException ex) {

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

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ private Map<String, String> getSchemaMappings() {
152152
if (logger.isTraceEnabled()) {
153153
logger.trace("Loaded schema mappings: " + mappings);
154154
}
155-
Map<String, String> mappingsToUse = new ConcurrentHashMap<>(mappings.size());
156-
CollectionUtils.mergePropertiesIntoMap(mappings, mappingsToUse);
157-
schemaMappings = mappingsToUse;
155+
schemaMappings = new ConcurrentHashMap<>(mappings.size());
156+
CollectionUtils.mergePropertiesIntoMap(mappings, schemaMappings);
158157
this.schemaMappings = schemaMappings;
159158
}
160159
catch (IOException ex) {

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

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -436,11 +436,12 @@ protected Document doLoadDocument(InputSource inputSource, Resource resource) th
436436
}
437437

438438
/**
439-
* Gets the validation mode for the specified {@link Resource}. If no explicit
440-
* validation mode has been configured then the validation mode is
441-
* {@link #detectValidationMode detected}.
439+
* Determine the validation mode for the specified {@link Resource}.
440+
* If no explicit validation mode has been configured, then the validation
441+
* mode gets {@link #detectValidationMode detected} from the given resource.
442442
* <p>Override this method if you would like full control over the validation
443443
* mode, even when something other than {@link #VALIDATION_AUTO} was set.
444+
* @see #detectValidationMode
444445
*/
445446
protected int getValidationModeForResource(Resource resource) {
446447
int validationModeToUse = getValidationMode();
@@ -458,7 +459,7 @@ protected int getValidationModeForResource(Resource resource) {
458459
}
459460

460461
/**
461-
* Detects which kind of validation to perform on the XML file identified
462+
* Detect which kind of validation to perform on the XML file identified
462463
* by the supplied {@link Resource}. If the file has a {@code DOCTYPE}
463464
* definition then DTD validation is used otherwise XSD validation is assumed.
464465
* <p>Override this method if you would like to customize resolution
@@ -544,7 +545,8 @@ public NamespaceHandlerResolver getNamespaceHandlerResolver() {
544545

545546
/**
546547
* Create the default implementation of {@link NamespaceHandlerResolver} used if none is specified.
547-
* Default implementation returns an instance of {@link DefaultNamespaceHandlerResolver}.
548+
* <p>The default implementation returns an instance of {@link DefaultNamespaceHandlerResolver}.
549+
* @see DefaultNamespaceHandlerResolver#DefaultNamespaceHandlerResolver(ClassLoader)
548550
*/
549551
protected NamespaceHandlerResolver createDefaultNamespaceHandlerResolver() {
550552
ClassLoader cl = (getResourceLoader() != null ? getResourceLoader().getClassLoader() : getBeanClassLoader());

0 commit comments

Comments
 (0)