Browse Source

Remove unnecessary null check in SysEnvPropSource

Remove unnecessary null check and dead code from
SystemEnvironmentPropertySource.

Issue: SPR-10318
pull/219/merge
Phillip Webb 12 years ago
parent
commit
009d2a5efd
  1. 4
      spring-core/src/main/java/org/springframework/core/env/SystemEnvironmentPropertySource.java

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

@ -88,10 +88,6 @@ public class SystemEnvironmentPropertySource extends MapPropertySource {
public Object getProperty(String name) { public Object getProperty(String name) {
Assert.notNull(name, "property name must not be null"); Assert.notNull(name, "property name must not be null");
String actualName = resolvePropertyName(name); String actualName = resolvePropertyName(name);
if (actualName == null) {
// at this point we know the property does not exist
return null;
}
if (logger.isDebugEnabled() && !name.equals(actualName)) { if (logger.isDebugEnabled() && !name.equals(actualName)) {
logger.debug(String.format( logger.debug(String.format(
"PropertySource [%s] does not contain '%s', but found equivalent '%s'", "PropertySource [%s] does not contain '%s', but found equivalent '%s'",

Loading…
Cancel
Save