Skip to content

Commit 79b5ee7

Browse files
committed
Polish "Extend nested placeholders resolution to any CharSequence"
See gh-32876
1 parent 5a7bfa9 commit 79b5ee7

File tree

2 files changed

+1
-27
lines changed

2 files changed

+1
-27
lines changed

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

-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@
2424
*
2525
* @author Chris Beams
2626
* @author Juergen Hoeller
27-
* @author Yanming Zhou
2827
* @since 3.1
2928
* @see PropertySource
3029
* @see PropertySources

spring-core/src/test/java/org/springframework/core/env/PropertySourcesPropertyResolverTests.java

+1-26
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@
3434

3535
/**
3636
* @author Chris Beams
37-
* @author Yanming Zhou
3837
* @since 3.1
3938
*/
4039
class PropertySourcesPropertyResolverTests {
@@ -307,31 +306,7 @@ void resolveNestedPlaceholdersIfValueIsCharSequence() {
307306
ps.addFirst(new MockPropertySource()
308307
.withProperty("p1", "v1")
309308
.withProperty("p2", "v2")
310-
.withProperty("p3", new CharSequence() {
311-
312-
static final String underlying = "${p1}:${p2}";
313-
314-
@Override
315-
public int length() {
316-
return underlying.length();
317-
}
318-
319-
@Override
320-
public char charAt(int index) {
321-
return underlying.charAt(index);
322-
}
323-
324-
@Override
325-
public CharSequence subSequence(int start, int end) {
326-
return underlying.subSequence(start, end);
327-
}
328-
329-
@Override
330-
public String toString() {
331-
return underlying;
332-
}
333-
})
334-
);
309+
.withProperty("p3", new StringBuilder("${p1}:${p2}")));
335310
ConfigurablePropertyResolver pr = new PropertySourcesPropertyResolver(ps);
336311
assertThat(pr.getProperty("p1")).isEqualTo("v1");
337312
assertThat(pr.getProperty("p2")).isEqualTo("v2");

0 commit comments

Comments
 (0)