Skip to content

Commit fc36184

Browse files
committed
Polishing
Issue: SPR-11297
1 parent 52d050d commit fc36184

File tree

4 files changed

+16
-17
lines changed

4 files changed

+16
-17
lines changed

spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,8 @@
5151
* <p>Enable debug- or trace-level logging for this class (or package) for messages
5252
* explaining when these 'property name resolutions' occur.
5353
*
54-
* <p>This property source is included by default in {@link StandardEnvironment} and all
55-
* its subclasses.
54+
* <p>This property source is included by default in {@link StandardEnvironment}
55+
* and all its subclasses.
5656
*
5757
* @author Chris Beams
5858
* @since 3.1
@@ -76,7 +76,7 @@ public SystemEnvironmentPropertySource(String name, Map<String, Object> source)
7676
*/
7777
@Override
7878
public boolean containsProperty(String name) {
79-
return getProperty(name) != null;
79+
return (getProperty(name) != null);
8080
}
8181

8282
/**
@@ -89,9 +89,8 @@ public Object getProperty(String name) {
8989
Assert.notNull(name, "property name must not be null");
9090
String actualName = resolvePropertyName(name);
9191
if (logger.isDebugEnabled() && !name.equals(actualName)) {
92-
logger.debug(String.format(
93-
"PropertySource [%s] does not contain '%s', but found equivalent '%s'",
94-
this.getName(), name, actualName));
92+
logger.debug(String.format("PropertySource [%s] does not contain '%s', but found equivalent '%s'",
93+
getName(), name, actualName));
9594
}
9695
return super.getProperty(actualName);
9796
}
@@ -115,7 +114,8 @@ private String resolvePropertyName(String name) {
115114
if (!name.equals(ucName)) {
116115
if (super.containsProperty(ucName)) {
117116
return ucName;
118-
} else {
117+
}
118+
else {
119119
String usUcName = ucName.replace('.', '_');
120120
if (!ucName.equals(usUcName) && super.containsProperty(usUcName)) {
121121
return usUcName;

spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -186,18 +186,17 @@ public void scan(String... basePackages) {
186186
@Override
187187
protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) {
188188
AnnotatedBeanDefinitionReader reader = new AnnotatedBeanDefinitionReader(beanFactory);
189-
reader.setEnvironment(this.getEnvironment());
189+
reader.setEnvironment(getEnvironment());
190190

191191
ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(beanFactory);
192-
scanner.setEnvironment(this.getEnvironment());
192+
scanner.setEnvironment(getEnvironment());
193193

194194
BeanNameGenerator beanNameGenerator = getBeanNameGenerator();
195195
ScopeMetadataResolver scopeMetadataResolver = getScopeMetadataResolver();
196196
if (beanNameGenerator != null) {
197197
reader.setBeanNameGenerator(beanNameGenerator);
198198
scanner.setBeanNameGenerator(beanNameGenerator);
199-
beanFactory.registerSingleton(
200-
AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator);
199+
beanFactory.registerSingleton(AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator);
201200
}
202201
if (scopeMetadataResolver != null) {
203202
reader.setScopeMetadataResolver(scopeMetadataResolver);

spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,10 +67,10 @@ public class StandardServletEnvironment extends StandardEnvironment implements C
6767
* {@value #JNDI_PROPERTY_SOURCE_NAME}.
6868
* <p>Properties in any of the above will take precedence over system properties and
6969
* environment variables contributed by the {@link StandardEnvironment} superclass.
70-
* <p>The {@code Servlet}-related property sources are added as {@link
71-
* StubPropertySource stubs} at this stage, and will be {@linkplain
72-
* #initPropertySources(ServletContext, ServletConfig) fully initialized} once the actual
73-
* {@link ServletContext} object becomes available.
70+
* <p>The {@code Servlet}-related property sources are added as
71+
* {@link StubPropertySource stubs} at this stage, and will be
72+
* {@linkplain #initPropertySources(ServletContext, ServletConfig) fully initialized}
73+
* once the actual {@link ServletContext} object becomes available.
7474
* @see StandardEnvironment#customizePropertySources
7575
* @see org.springframework.core.env.AbstractEnvironment#customizePropertySources
7676
* @see ServletConfigPropertySource

spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2002-2009 the original author or authors.
2+
* Copyright 2002-2013 the original author or authors.
33
*
44
* Licensed under the Apache License, Version 2.0 (the "License");
55
* you may not use this file except in compliance with the License.
@@ -84,7 +84,7 @@ protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) throw
8484

8585
// Configure the bean definition reader with this context's
8686
// resource loading environment.
87-
beanDefinitionReader.setEnvironment(this.getEnvironment());
87+
beanDefinitionReader.setEnvironment(getEnvironment());
8888
beanDefinitionReader.setResourceLoader(this);
8989
beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this));
9090

0 commit comments

Comments
 (0)