From e255ccca7deeb19ca5d2e63dadc4e8e1589151be Mon Sep 17 00:00:00 2001 From: Alexis SEGURA Date: Fri, 19 Jun 2026 11:20:09 +0200 Subject: [PATCH] Update Javadoc for active profile ordering MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Following gh-26004, the registration order of active profiles in @⁠ActiveProfiles is preserved; however, 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). This commit updates the Javadoc to document the status quo. Closes gh-36950 Signed-off-by: Alexis SEGURA --- .../test/context/MergedContextConfiguration.java | 12 ++++++------ .../context/web/WebMergedContextConfiguration.java | 12 ++++++------ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java index 2eed29617c8..d54188b076b 100644 --- a/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/MergedContextConfiguration.java @@ -190,8 +190,8 @@ public class MergedContextConfiguration implements Serializable { * or {@code propertySourceProperties} an empty array will be stored instead. * If a {@code null} value is supplied for the * {@code contextInitializerClasses} an empty set will be stored instead. - * Furthermore, active profiles will be sorted, and duplicate profiles - * will be removed. + * Furthermore, duplicate active profiles will be removed while preserving + * registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged context resource locations * @param classes the merged annotated classes @@ -229,8 +229,8 @@ public class MergedContextConfiguration implements Serializable { * or {@code propertySourceProperties} an empty array will be stored instead. * If a {@code null} value is supplied for {@code contextInitializerClasses} * or {@code contextCustomizers}, an empty set will be stored instead. - * Furthermore, active profiles will be sorted, and duplicate profiles - * will be removed. + * Furthermore, duplicate active profiles will be removed while preserving + * registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged context resource locations * @param classes the merged annotated classes @@ -268,8 +268,8 @@ public class MergedContextConfiguration implements Serializable { * {@code activeProfiles}, or {@code propertySourceProperties} an empty array * will be stored instead. If a {@code null} value is supplied for * {@code contextInitializerClasses} or {@code contextCustomizers}, an empty - * set will be stored instead. Furthermore, active profiles will be sorted, - * and duplicate profiles will be removed. + * set will be stored instead. Furthermore, duplicate active profiles + * will be removed while preserving registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged context resource locations * @param classes the merged annotated classes diff --git a/spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java b/spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java index cd8df132e89..187acb78211 100644 --- a/spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java +++ b/spring-test/src/main/java/org/springframework/test/context/web/WebMergedContextConfiguration.java @@ -87,8 +87,8 @@ public class WebMergedContextConfiguration extends MergedContextConfiguration { * If a {@code null} value is supplied for the * {@code contextInitializerClasses} an empty set will be stored instead. * If an empty value is supplied for the {@code resourceBasePath} - * an empty string will be used. Furthermore, active profiles will be sorted, - * and duplicate profiles will be removed. + * an empty string will be used. Furthermore, duplicate active profiles + * will be removed while preserving registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged resource locations * @param classes the merged annotated classes @@ -125,8 +125,8 @@ public class WebMergedContextConfiguration extends MergedContextConfiguration { * If a {@code null} value is supplied for {@code contextInitializerClasses} * or {@code contextCustomizers}, an empty set will be stored instead. * If an empty value is supplied for the {@code resourceBasePath} - * an empty string will be used. Furthermore, active profiles will be sorted, - * and duplicate profiles will be removed. + * an empty string will be used. Furthermore, duplicate active profiles + * will be removed while preserving registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged context resource locations * @param classes the merged annotated classes @@ -164,8 +164,8 @@ public class WebMergedContextConfiguration extends MergedContextConfiguration { * {@code activeProfiles}, or {@code propertySourceProperties} an empty array * will be stored instead. If a {@code null} value is supplied for * {@code contextInitializerClasses} or {@code contextCustomizers}, an empty - * set will be stored instead. Furthermore, active profiles will be sorted, - * and duplicate profiles will be removed. + * set will be stored instead. Furthermore, duplicate active profiles + * will be removed while preserving registration order. * @param testClass the test class for which the configuration was merged * @param locations the merged context resource locations * @param classes the merged annotated classes