Commit Graph

3659 Commits

Author SHA1 Message Date
Sébastien Deleuze ed2cad3af0 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
2025-07-23 16:30:12 +02:00
Sébastien Deleuze 5e338ef1b8 Make MessageSource locale parameter nullable
Backport Bot / build (push) Has been cancelled Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
Closes gh-35230
2025-07-23 16:02:38 +02:00
Sébastien Deleuze 20a1261574 Make rootObject parameter consistently nullable
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
MethodBasedEvaluationContext and CacheEvaluationContext should allow a
nullable rootObject constructor parameter like
StandardEvaluationContext does.

Closes gh-35206
2025-07-15 17:49:30 +02:00
Sam Brannen 5c6622fd77 Introduce ApplicationContextEvent.getSource() with covariant return type
Prior to this commit, ApplicationContextEvent inherited getSource()
from java.util.EventObject.getSource() which has an Object return type.

This commit introduces a local getSource() implementation in
ApplicationContextEvent with an ApplicationContext covariant return
type, analogous to TestContextEvent in spring-test.

Closes gh-35197
2025-07-14 14:13:13 +02:00
Juergen Hoeller 096670f31d Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-context/src/main/java/org/springframework/context/annotation/ConfigurationClassBeanDefinitionReader.java
2025-07-13 16:36:02 +02:00
Juergen Hoeller 2434bb1540 Polishing 2025-07-13 16:33:37 +02:00
Juergen Hoeller 1145054971 Introduce ConfigurationBeanNameGenerator for @Bean-annotated methods
Includes FullyQualifiedConfigurationBeanNameGenerator implementation.

Closes gh-33448
2025-07-13 16:08:05 +02:00
Sam Brannen ff1e5a87b3 Introduce ContextRestartedEvent as a subtype of ContextStartedEvent
Prior to this commit, there was no way to differentiate between an
ApplicationContext "start" and "restart" in terms of events. This was
due to the fact that a ContextStartedEvent was fired for both
AbstractApplicationContext.start() and
AbstractApplicationContext.restart().

To assist developers who may wish to differentiate between "start" and
"restart" events, this commit introduces a new ContextRestartedEvent as
a subtype of ContextStartedEvent. In addition,
AbstractApplicationContext.restart() now publishes a
ContextRestartedEvent instead of a ContextStartedEvent.

By making ContextRestartedEvent a subtype of ContextStartedEvent,
applications can still expect ContextStoppedEvent/ContextStartedEvent
event pairs for consistent lifecycle semantics, and they can optionally
check if the ContextStartedEvent is a ContextRestartedEvent.
Alternatively, applications can explicitly react to a
ContextRestartedEvent.

See gh-35168
See gh-35171
Closes gh-35194
2025-07-12 18:14:05 +02:00
Juergen Hoeller 64de254b58 Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-07-11 22:50:47 +02:00
Juergen Hoeller 4277682a5c Catch InaccessibleObjectException next to IllegalAccessException
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35190
2025-07-11 22:44:11 +02:00
Juergen Hoeller 4ca8a8abbe Merge branch '6.2.x'
# Conflicts:
#	framework-docs/modules/ROOT/pages/core/null-safety.adoc
#	framework-docs/modules/ROOT/pages/core/validation/error-code-resolution.adoc
#	framework-docs/modules/ROOT/pages/integration/cds.adoc
#	framework-docs/modules/ROOT/pages/integration/jms/sending.adoc
#	framework-docs/modules/ROOT/pages/integration/rest-clients.adoc
#	framework-docs/modules/ROOT/pages/languages/kotlin/bean-definition-dsl.adoc
#	framework-docs/modules/ROOT/pages/languages/kotlin/null-safety.adoc
#	framework-docs/modules/ROOT/pages/languages/kotlin/web.adoc
#	framework-docs/modules/ROOT/pages/web/webflux/config.adoc
#	framework-docs/modules/ROOT/pages/web/webflux/controller/ann-requestmapping.adoc
#	framework-docs/modules/ROOT/pages/web/webmvc/mvc-http2.adoc
2025-07-10 19:42:14 +02:00
Juergen Hoeller 25b4e29f5e Polishing
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-07-10 19:33:51 +02:00
Juergen Hoeller 523552ac2e Introduce ConfigurableApplicationContext.restart() method
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35171
2025-07-08 18:50:05 +02:00
Juergen Hoeller a2d495de9f Merge branch '6.2.x'
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AbstractAspectJAdvice.java
2025-07-07 14:40:50 +02:00
Juergen Hoeller 3bd96f72a6 Leniently tolerate null bean as aspect instance
Closes gh-35074
2025-07-07 14:26:19 +02:00
Yanming Zhou 410a9ce108 Mark applicable Scope's methods as default
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-07-07 13:37:47 +02:00
Sam Brannen 14767d64b5 Merge branch '6.2.x' 2025-07-07 12:36:14 +02:00
Sam Brannen ad00aebaa3 Improve Javadoc for caching annotations 2025-07-07 12:19:49 +02:00
Sam Brannen d07ed31fed Support @⁠CacheConfig("myCache") declarations for simplified config
The @⁠CacheConfig section of the reference manual provides an example
that declares @⁠CacheConfig("books").

However, unlike the @⁠Cacheable, @⁠CachePut, and @⁠CacheEvict
annotations, @⁠CacheConfig currently does not have a `value` alias for
the `cacheNames` attribute. Thus, the example in the reference manual
does not compile, and @⁠CacheConfig(cacheNames = "books") would be the
supported way to declare that.

The driving factor for this commit is therefore to provide a simplified
and consistent programming model for users that only need to define
default cache names at the type level (like in the existing example in
the reference manual).

To address that, this commit introduces a `value` alias for
`cacheNames` in @⁠CacheConfig.

See gh-35096
Closes gh-35152

(cherry picked from commit 6091453feb)
2025-07-07 12:17:47 +02:00
Sam Brannen 17df4b4c38 Support direct matching against exceptions in ExceptionTypeFilter
Prior to this commit, ExceptionTypeFilter only supported matching
against an exception type. However, most use cases involve matching
against an exception instance. Moreover, every use case within the core
Spring Framework uses ExceptionTypeFilter to match against concrete
exception instances.

This commit therefore introduces an overloaded match(Throwable) method
in ExceptionTypeFilter in order to provide support for the most common
use cases.

See gh-35109
Closes gh-35160
2025-07-05 13:13:47 +02:00
Sam Brannen d510b738f4 Match if empty by default in InstanceFilter and ExceptionTypeFilter
Prior to this commit, the constructors for InstanceFilter and
ExceptionTypeFilter required one to supply the matchIfEmpty flag.
However, users will typically want that to be true. Moreover, we always
supply true for the matchIfEmpty flag within the Spring Framework.

This commit therefore makes the matchIfEmpty flag optional by
introducing overloaded constructors for InstanceFilter and
ExceptionTypeFilter that only accept the includes and excludes
collections.

In addition, this commit overhauls the Javadoc for InstanceFilter and
ExceptionTypeFilter, fixing several issues in the documentation.

Furthermore, this commit applies consistent @⁠Nullable declarations
in ExceptionTypeFilter.

Closes gh-35158
2025-07-04 18:16:52 +02:00
Sam Brannen 6091453feb Introduce value alias for cacheNames in @⁠CacheConfig
Prior to this commit @⁠CacheConfig did not have a `value` attribute
alias for `cacheNames`, even though the rest of the cache-related
annotations (such as @⁠Cacheable, @⁠CachePut, etc.) do have a `value` /
`cacheNames` alias pair.

To address that inconsistency, this commit introduces a `value` alias
for `cacheNames` in @⁠CacheConfig as well.

See gh-35096
Closes gh-35152
2025-07-03 17:16:29 +02:00
Sam Brannen c6a8df4a9d Use Duration.ZERO whenever possible 2025-07-03 16:55:09 +02:00
Sam Brannen 58061ae295 Polish contribution
See gh-35109
2025-07-03 16:49:40 +02:00
Mengqi Xu 489ebd2438 Use ExceptionTypeFilter to filter includes & excludes for retry policies
This commit reduces code duplication by reusing the logic already
available in ExceptionTypeFilter.

Closes gh-35109

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-07-03 16:49:40 +02:00
Sam Brannen 132836f6ca Add missing "includes mismatch" test in ReactiveRetryInterceptorTests
This commit also overhauls ReactiveRetryInterceptorTests to make the
tests more robust and simultaneously easier to comprehend.
2025-07-03 16:37:57 +02:00
Sam Brannen b58c1c0d63 Assert actual Reactive exception types thrown in ReactiveRetryInterceptorTests 2025-07-02 11:27:50 +02:00
Sam Brannen 191d092952 Polishing 2025-07-02 11:26:34 +02:00
Juergen Hoeller 46654a03fe Replace lenient fallback with assertion for actual annotation present
See gh-35133
2025-07-02 11:09:53 +02:00
Sam Brannen b794abd8cb Polishing 2025-07-02 10:58:50 +02:00
Juergen Hoeller 95c35e9655 Fix javadoc links to @Retryable
See gh-34529
See gh-35133
2025-07-01 18:00:59 +02:00
Juergen Hoeller 95a6a0ceaf Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/format/datetime/standard/DurationFormatterUtils.java
2025-07-01 17:57:49 +02:00
Juergen Hoeller 15364cf59f Polishing
Backport Bot / build (push) Has been cancelled Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Has been cancelled Details
Deploy Docs / Dispatch docs deployment (push) Has been cancelled Details
Build and Deploy Snapshot / Verify (push) Has been cancelled Details
2025-07-01 17:51:23 +02:00
Sam Brannen cc31bf3c33 Accept zero for RetryPolicy.Builder.delay()
This aligns the programmatic RetryPolicy configuration option with the
delay support in @⁠Retryable.

See gh-35110
2025-07-01 17:40:15 +02:00
Juergen Hoeller c9078bfe14 Introduce @ConcurrencyLimit annotation based on ConcurrencyThrottleInterceptor
Moves @Retryable infrastructure to resilience package in spring-context module.
Includes duration parsing and placeholder resolution for @Retryable attributes.
Provides convenient @EnableResilientMethods for @Retryable + @ConcurrencyLimit.

Closes gh-35133
See gh-34529
2025-07-01 17:27:50 +02:00
Sam Brannen ec16b03949 Support navigation to failed tests in @⁠Inject TCK tests
See gh-35126
2025-06-29 15:55:07 +02:00
Sam Brannen ed86daa080 Convert Spring @⁠Inject TCK tests from JUnit 3 to JUnit Jupiter
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Closes gh-35126
2025-06-28 19:29:49 +02:00
Juergen Hoeller 841d9fb73b Add public method to get bean order on DefaultListableBeanFactory
Closes gh-34712
2025-06-26 14:48:07 +02:00
Juergen Hoeller 543314fcbb Polishing 2025-06-25 18:07:24 +02:00
Juergen Hoeller 90c875144a Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/context/aot/BeanFactoryInitializationAotContributions.java
#	spring-context/src/test/java/org/springframework/context/aot/ApplicationContextAotGeneratorTests.java
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/HibernateQueryException.java
2025-06-24 22:01:58 +02:00
Juergen Hoeller b6aa6899a8 Polishing
Backport Bot / build (push) Waiting to run Details
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:false version:17], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:21], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
CI / ${{ matrix.os.name}} | Java ${{ matrix.java.version}} (map[toolchain:true version:23], map[id:ubuntu-latest name:Linux]) (push) Waiting to run Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
2025-06-24 21:58:39 +02:00
Juergen Hoeller 4190209ead Add missing AOT support for method overrides (including @Lookup)
Closes gh-34642
2025-06-24 21:58:31 +02:00
Sébastien Deleuze 294406dae9 Remove `@Suppress("EXTENSION_SHADOWED_BY_MEMBER")`
Build and Deploy Snapshot / Build and Deploy Snapshot (push) Waiting to run Details
Build and Deploy Snapshot / Verify (push) Blocked by required conditions Details
Deploy Docs / Dispatch docs deployment (push) Waiting to run Details
Fixed in Kotlin 2.2.0 and IntelliJ IDEA IDEA 2024.2 EAP, see
https://youtrack.jetbrains.com/issue/KT-75169 related issue.

See gh-34453
2025-06-24 11:40:23 +02:00
Juergen Hoeller a265a135d5 Align package namespace in TaskManagementConfigUtils constants 2025-06-18 12:24:02 +02:00
Juergen Hoeller 6927e39e6b Merge branch '6.2.x' 2025-06-18 12:23:07 +02:00
Juergen Hoeller 00399dc1b3 Reject null for returned CompletableFuture (avoiding subsequent NPE)
See gh-34708
2025-06-18 12:20:19 +02:00
Sam Brannen 74ee1b991a Apply consistent copyright headers in Kotlin source code
See gh-35070
2025-06-17 16:24:15 +02:00
Spring Builds 16edf9867a Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 16:23:50 +02:00
Sam Brannen 103a7e58bb Apply consistent copyright headers in Kotlin source code
See gh-35070
2025-06-17 15:54:58 +02:00
Spring Builds aee29b7f30 Update copyright headers in source files
This commit updates Java, Kotlin, and Groovy source files to use the
"<year>-present" pattern in copyright headers.

Closes gh-35070
2025-06-17 15:54:58 +02:00