Skip to content

NestedPlaceholder are not recursively resolved if the fallback is a placeholder #34020

Closed
@vip-delete

Description

@vip-delete

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:

  1. Navigate to the parser test:

  2. add one more line to test:

Arguments.of("${p6:${p1}}", "v1:v2:def"),
  1. Expected value of ${p6:${p1}} is v1:v2:def, but actual is ${p1}:${p2}:${bogus:def} - the raw text value of p6.

How to fix:

  1. Modify this line of NestedPlaceholderPart to recursively resolve the value
    String value = resolutionContext.resolvePlaceholder(resolvedKey);
  2. The recursive resolution code is already there at the following line but it is used in SimplePlaceholderPart only:
    String resolvedValue = resolveToText(resolutionContext, this.key);

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)type: regressionA bug that is also a regression

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions