-
Notifications
You must be signed in to change notification settings - Fork 38.6k
Closed
Closed
Copy link
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regressionA bug that is also a regression
Milestone
Description
Nested placeholder is not recursively resolved in case it has a default value of another placeholder.
It used to work in Spring 6.1.9
How to reproduce:
-
Navigate to the parser test:
spring-framework/spring-core/src/test/java/org/springframework/util/PlaceholderParserTests.java
Line 212 in 078d683
Arguments.of("${p6}", "v1:v2:def"), -
add one more line to test:
Arguments.of("${p6:${p1}}", "v1:v2:def"),
- Expected value of
${p6:${p1}}
isv1:v2:def
, but actual is${p1}:${p2}:${bogus:def}
- the raw text value ofp6
.
How to fix:
- Modify this line of NestedPlaceholderPart to recursively resolve the value
spring-framework/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java
Line 498 in 078d683
String value = resolutionContext.resolvePlaceholder(resolvedKey); - The recursive resolution code is already there at the following line but it is used in SimplePlaceholderPart only:
spring-framework/spring-core/src/main/java/org/springframework/util/PlaceholderParser.java
Line 446 in 078d683
String resolvedValue = resolveToText(resolutionContext, this.key);
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regressionA bug that is also a regression