diff --git a/spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java b/spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java index 0baba6a8c196243303a343f3871a2015018a1e09..3c4d061739beee847853b971ae03c4bd9d9a5a16 100644 --- a/spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java +++ b/spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java @@ -51,8 +51,8 @@ import org.springframework.util.Assert; *
Enable debug- or trace-level logging for this class (or package) for messages * explaining when these 'property name resolutions' occur. * - *
This property source is included by default in {@link StandardEnvironment} and all - * its subclasses. + *
This property source is included by default in {@link StandardEnvironment} + * and all its subclasses. * * @author Chris Beams * @since 3.1 @@ -76,7 +76,7 @@ public class SystemEnvironmentPropertySource extends MapPropertySource { */ @Override public boolean containsProperty(String name) { - return getProperty(name) != null; + return (getProperty(name) != null); } /** @@ -89,9 +89,8 @@ public class SystemEnvironmentPropertySource extends MapPropertySource { Assert.notNull(name, "property name must not be null"); String actualName = resolvePropertyName(name); if (logger.isDebugEnabled() && !name.equals(actualName)) { - logger.debug(String.format( - "PropertySource [%s] does not contain '%s', but found equivalent '%s'", - this.getName(), name, actualName)); + logger.debug(String.format("PropertySource [%s] does not contain '%s', but found equivalent '%s'", + getName(), name, actualName)); } return super.getProperty(actualName); } @@ -115,7 +114,8 @@ public class SystemEnvironmentPropertySource extends MapPropertySource { if (!name.equals(ucName)) { if (super.containsProperty(ucName)) { return ucName; - } else { + } + else { String usUcName = ucName.replace('.', '_'); if (!ucName.equals(usUcName) && super.containsProperty(usUcName)) { return usUcName; diff --git a/spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java b/spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java index 5a0837a556d83d4dcf6b681bec8b7f2673ddaea6..c4c1ec3d34c17f40abbba5f839a2e74d4bab8b0c 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/AnnotationConfigWebApplicationContext.java @@ -186,18 +186,17 @@ public class AnnotationConfigWebApplicationContext extends AbstractRefreshableWe @Override protected void loadBeanDefinitions(DefaultListableBeanFactory beanFactory) { AnnotatedBeanDefinitionReader reader = new AnnotatedBeanDefinitionReader(beanFactory); - reader.setEnvironment(this.getEnvironment()); + reader.setEnvironment(getEnvironment()); ClassPathBeanDefinitionScanner scanner = new ClassPathBeanDefinitionScanner(beanFactory); - scanner.setEnvironment(this.getEnvironment()); + scanner.setEnvironment(getEnvironment()); BeanNameGenerator beanNameGenerator = getBeanNameGenerator(); ScopeMetadataResolver scopeMetadataResolver = getScopeMetadataResolver(); if (beanNameGenerator != null) { reader.setBeanNameGenerator(beanNameGenerator); scanner.setBeanNameGenerator(beanNameGenerator); - beanFactory.registerSingleton( - AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator); + beanFactory.registerSingleton(AnnotationConfigUtils.CONFIGURATION_BEAN_NAME_GENERATOR, beanNameGenerator); } if (scopeMetadataResolver != null) { reader.setScopeMetadataResolver(scopeMetadataResolver); diff --git a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java index 21a1ce9cf1153a9580f476ab66f63ff037d150ee..e83b373bfe94c9a0b4f430163752de7aad8ad0ee 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/StandardServletEnvironment.java @@ -67,10 +67,10 @@ public class StandardServletEnvironment extends StandardEnvironment implements C * {@value #JNDI_PROPERTY_SOURCE_NAME}. *
Properties in any of the above will take precedence over system properties and * environment variables contributed by the {@link StandardEnvironment} superclass. - *
The {@code Servlet}-related property sources are added as {@link - * StubPropertySource stubs} at this stage, and will be {@linkplain - * #initPropertySources(ServletContext, ServletConfig) fully initialized} once the actual - * {@link ServletContext} object becomes available. + *
The {@code Servlet}-related property sources are added as + * {@link StubPropertySource stubs} at this stage, and will be + * {@linkplain #initPropertySources(ServletContext, ServletConfig) fully initialized} + * once the actual {@link ServletContext} object becomes available. * @see StandardEnvironment#customizePropertySources * @see org.springframework.core.env.AbstractEnvironment#customizePropertySources * @see ServletConfigPropertySource diff --git a/spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java b/spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java index 84d4b38f3cce51024cd556df1cfa2747b7fe3a34..faa9475676e1b0b38b7504aa316dc64002d1e8ab 100644 --- a/spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java +++ b/spring-web/src/main/java/org/springframework/web/context/support/XmlWebApplicationContext.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2009 the original author or authors. + * Copyright 2002-2013 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. @@ -84,7 +84,7 @@ public class XmlWebApplicationContext extends AbstractRefreshableWebApplicationC // Configure the bean definition reader with this context's // resource loading environment. - beanDefinitionReader.setEnvironment(this.getEnvironment()); + beanDefinitionReader.setEnvironment(getEnvironment()); beanDefinitionReader.setResourceLoader(this); beanDefinitionReader.setEntityResolver(new ResourceEntityResolver(this));