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

Improve toString() for Profiles.of() implementation #30374

Closed
sbrannen opened this issue Apr 25, 2023 · 0 comments
Closed

Improve toString() for Profiles.of() implementation #30374

sbrannen opened this issue Apr 25, 2023 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement
Milestone

Comments

@sbrannen
Copy link
Member

sbrannen commented Apr 25, 2023

The toString() implementation in ProfilesParser (which is the internal implementation of Profiles.of()) currently concatenates profile expressions with " or ".

For example, the current string representation of Profiles.of("spring & framework", "java | kotlin") is "spring & framework or java | kotlin".

Ideally, the string representation would be "(spring & framework) | (java | kotlin)".

This makes it easier to read (for example, when debugging) and aligns with the semantics of toStringAST() in SpelNode.

As an additional benefit, the result of invoking toString() could even be used as a logically equivalent composite profile expression, though that is not the primary goal of the proposed change.

@sbrannen sbrannen added in: core Issues in core modules (aop, beans, core, context, expression) type: enhancement A general enhancement labels Apr 25, 2023
@sbrannen sbrannen added this to the 6.1.0-M1 milestone Apr 25, 2023
@sbrannen sbrannen self-assigned this Apr 25, 2023
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: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

1 participant