Skip to content

Test escape character support in PropertySourcesPropertyResolver #34720

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

iifawzi
Copy link
Contributor

@iifawzi iifawzi commented Apr 5, 2025

Hello, this PR aims to resolve #34326.

Added a new utility method resolveNestedPlaceholdersWithEscapePreservation, to preserve escaped placeholders using a regex pattern \\(\$\{[^}]+\}), which then masks it and then restores the placeholder after the call to resolveNestedPlaceholders

This is my first contribution to the project, so I might be missing something, let me know if you think I can help in doing it in any different way.

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Apr 5, 2025
@sbrannen sbrannen self-assigned this May 7, 2025
@sbrannen sbrannen added the in: core Issues in core modules (aop, beans, core, context, expression) label May 7, 2025
@sbrannen sbrannen changed the title Fix: preserve nested escaped placeholders during resolution Test escape character support in PropertySourcesPropertyResolver May 9, 2025
@sbrannen sbrannen added type: task A general task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels May 9, 2025
@sbrannen sbrannen added this to the 6.2.7 milestone May 9, 2025
sbrannen pushed a commit that referenced this pull request May 9, 2025
sbrannen added a commit that referenced this pull request May 9, 2025
@sbrannen
Copy link
Member

sbrannen commented May 9, 2025

Hi @iifawzi,

Congratulations on submitting your first PR for the Spring Framework! 👍

Please note that your tests pass without any changes to PropertySourcesPropertyResolver.

As I have outlined in #34861, the core of the problem lies in the implementation of PropertySourcesPlaceholderConfigurer.

However, your proposed tests are still good to have in place. Thus, I merged them in 9b52cfd without the changes to PropertySourcesPropertyResolver and revised them in 348b4cd.

Thanks for the contribution

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: task A general task
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Escaped placeholders are evaluated if the PropertySource has placeholder support
3 participants