Skip to content
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

Introduce Environment.matchesProfiles() for profile expressions #30226

Closed
github-actions bot opened this issue Mar 29, 2023 · 1 comment
Closed

Introduce Environment.matchesProfiles() for profile expressions #30226

github-actions bot opened this issue Mar 29, 2023 · 1 comment
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Milestone

Comments

@github-actions
Copy link
Contributor

Backport of gh-30206

@github-actions github-actions bot added in: core Issues in core modules (aop, beans, core, context, expression) type: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement labels Mar 29, 2023
@github-actions github-actions bot added this to the 5.3.27 milestone Mar 29, 2023
@sbrannen sbrannen self-assigned this Mar 29, 2023
@sbrannen sbrannen modified the milestones: 5.3.27, 5.3.28 Apr 11, 2023
@sbrannen sbrannen changed the title Introduce Environment.acceptsProfiles() variant for profile expressions Introduce Environment.matchesProfiles() for profile expressions Apr 25, 2023
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Apr 25, 2023
sbrannen added a commit to sbrannen/spring-framework that referenced this issue Apr 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
Environment.acceptsProfiles(String...) was deprecated in 5.1 in
conjunction with spring-projectsgh-17063 which introduced a new
acceptsProfiles(Profiles) method to replace it. The deprecated method
only supports OR semantics; whereas, the new method supports profile
expressions. Thus, the goal was to encourage people to use the more
powerful profile expressions instead of the limited OR support with
profile names.

However, there are use cases where it is difficult (if not impossible)
to provide a Profiles instance, and there are use cases where it is
simply preferable to provide profile expressions directly as strings.

To address these issues, this commit introduces a new matchesProfiles()
method in Environment that accepts a var-args list of profile
expressions.

See spring-projectsgh-30206
Closes spring-projectsgh-30226
@sbrannen
Copy link
Member

Closed via 08fe123

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: backport An issue that is a backport of another issue to a maintenance branch type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant