Skip to content

Update Javadoc for @ActiveProfiles ordering#36950

Open
alexisgra wants to merge 1 commit into
spring-projects:mainfrom
alexisgra:fix-spring-test-active-profiles-javadoc
Open

Update Javadoc for @ActiveProfiles ordering#36950
alexisgra wants to merge 1 commit into
spring-projects:mainfrom
alexisgra:fix-spring-test-active-profiles-javadoc

Conversation

@alexisgra

@alexisgra alexisgra commented Jun 19, 2026

Copy link
Copy Markdown

Overview

In gh-26004, TreeSet was replaced by LinkedHashSet so that the registration order of active profiles in @ActiveProfiles is preserved.

However, the Javadoc in MergedContextConfiguration and WebMergedContextConfiguration still described the old sorting behavior. This PR aligns it with the actual behavior.

Active profiles are part of MergedContextConfiguration equals()and hashCode(), so their order participates in the test context cache key. The previous Javadoc could mislead readers reasoning about why two configurations do or do not share a cached ApplicationContext.

I did not find any other occurrences of the outdated doc elsewhere, including in the reference documentation.

Related Issues

Following spring-projectsgh-26004, the registration order of active profiles in
@activeprofiles is preserved. The Javadoc in MergedContextConfiguration
and WebMergedContextConfiguration still described the old sorting
behavior, which is misleading since profile order is part of the context
cache key (equals/hashCode).

Signed-off-by: Alexis SEGURA <alex.segura06@gmail.com>
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged or decided on label Jun 19, 2026
@sbrannen sbrannen self-assigned this Jun 19, 2026
@sbrannen sbrannen added in: test Issues in the test module type: documentation A documentation task and removed status: waiting-for-triage An issue we've not yet triaged or decided on labels Jun 19, 2026
@sbrannen sbrannen added this to the 7.0.9 milestone Jun 19, 2026
@sbrannen sbrannen changed the title Update Javadoc for active profile ordering Update Javadoc for @ActiveProfiles ordering Jun 19, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

in: test Issues in the test module type: documentation A documentation task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants