From 9c183f9e77a71a5e5671b6678edadcdb185f684f Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 30 Apr 2025 17:55:18 +0200 Subject: [PATCH 1/2] Add explicit note on redeclaring in each application context Closes gh-34843 --- .../scheduling/annotation/EnableAsync.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java index 38f5c2f410c..cced791405e 100644 --- a/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java +++ b/spring-context/src/main/java/org/springframework/scheduling/annotation/EnableAsync.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2021 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -146,6 +146,12 @@ import org.springframework.core.Ordered; * compile-time weaving or load-time weaving applying the aspect to the affected classes. * There is no proxy involved in such a scenario; local calls will be intercepted as well. * + *

Note: {@code @EnableAsync} applies to its local application context only, + * allowing for selective activation at different levels. Please redeclare + * {@code @EnableAsync} in each individual context, for example, the common root web + * application context and any separate {@code DispatcherServlet} application contexts, + * if you need to apply its behavior at multiple levels. + * * @author Chris Beams * @author Juergen Hoeller * @author Stephane Nicoll From 4466548f53938d07e192133bc990169c7884439b Mon Sep 17 00:00:00 2001 From: Juergen Hoeller Date: Wed, 30 Apr 2025 17:55:39 +0200 Subject: [PATCH 2/2] Align parameter javadoc with nullable signature Closes gh-34845 --- .../web/context/ConfigurableWebEnvironment.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java b/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java index d077036403a..fb7ea08ec37 100644 --- a/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java +++ b/spring-web/src/main/java/org/springframework/web/context/ConfigurableWebEnvironment.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2012 the original author or authors. + * Copyright 2002-2025 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -39,7 +39,7 @@ public interface ConfigurableWebEnvironment extends ConfigurableEnvironment { * org.springframework.core.env.PropertySource.StubPropertySource stub property source} * instances acting as placeholders with real servlet context/config property sources * using the given parameters. - * @param servletContext the {@link ServletContext} (may not be {@code null}) + * @param servletContext the {@link ServletContext} ({@code null} if not available) * @param servletConfig the {@link ServletConfig} ({@code null} if not available) * @see org.springframework.web.context.support.WebApplicationContextUtils#initServletPropertySources( * org.springframework.core.env.MutablePropertySources, ServletContext, ServletConfig)