mirror of
https://github.com/spring-projects/spring-framework.git
synced 2026-09-18 00:49:02 +00:00
ProfilesParser.parseTokens() silently accepts unbalanced parentheses in profile expressions such as "dev)" or "(dev", treating them as valid. This can lead to unexpected behavior where malformed @Profile annotations are silently interpreted instead of being rejected. This commit tightens the validation in parseTokens() to reject: - Unmatched closing parenthesis at the top level - Unmatched opening parenthesis when tokens are exhausted Also fixes an existing test that inadvertently relied on this lenient behavior by using "spring&framework)" instead of "(spring&framework)". Closes gh-36550 Signed-off-by: daguimu <daguimu.geek@gmail.com>