Skip to content

Commit c12bb77

Browse files
committed
Merge pull request spring-projects#15885 from Christoph Dreis
* spring-projectsgh-15885: Clean up SpringPropertyAction.getValue() Closes spring-projectsgh-15885
2 parents 648cbaa + 3fb87a4 commit c12bb77

File tree

1 file changed

+2
-12
lines changed

1 file changed

+2
-12
lines changed

spring-boot-project/spring-boot/src/main/java/org/springframework/boot/logging/logback/SpringPropertyAction.java

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2012-2018 the original author or authors.
2+
* Copyright 2012-2019 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.
@@ -65,17 +65,7 @@ private String getValue(String source, String defaultValue) {
6565
addWarn("No Spring Environment available to resolve " + source);
6666
return defaultValue;
6767
}
68-
String value = this.environment.getProperty(source);
69-
if (value != null) {
70-
return value;
71-
}
72-
int lastDot = source.lastIndexOf('.');
73-
if (lastDot > 0) {
74-
String prefix = source.substring(0, lastDot + 1);
75-
return this.environment.getProperty(prefix + source.substring(lastDot + 1),
76-
defaultValue);
77-
}
78-
return defaultValue;
68+
return this.environment.getProperty(source, defaultValue);
7969
}
8070

8171
@Override

0 commit comments

Comments
 (0)