Commit Graph

33190 Commits

Author SHA1 Message Date
NeatGuyCoding 42a11da031
Fix potentially loses precision and jitter is not well capped with unit tests 2025-07-01 12:53:28 +08:00
Sam Brannen 60b19278c0 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-06-30 17:39:17 +02:00
Sam Brannen 900dd0c3eb Polish contribution
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
See gh-35132
2025-06-30 17:35:43 +02:00
Jeroen Meijer 41cb6ae1a5 Add getter for OverflowStrategy in ConcurrentWebSocketSessionDecorator
This commit also includes a test for all configured properties.

Closes gh-35132

Signed-off-by: Jeroen Meijer <jjgmeijer@gmail.com>
2025-06-30 17:30:29 +02:00
rstoyanchev 1a9f19f87f Update use of preset content-type for streaming
For 7.0 we can favor more explicitly a preset Content-type.

Closes gh-35130
2025-06-30 15:40:33 +01:00
rstoyanchev 817136a0e9 Merge branch '6.2.x' 2025-06-30 15:35:29 +01:00
rstoyanchev 55634f972c Use preset content-type for streaming response
Closes gh-35130
2025-06-30 15:34:14 +01:00
Stéphane Nicoll 6a3311ba8e Merge branch '6.2.x' 2025-06-30 12:54:07 +02:00
Stéphane Nicoll e88b70e6ad Slice bean registrations in separate file if necessary
The compiler has a constants pool limit of 65536 entries per source file
which can be hit with a very large amount of beans to register in the
bean factory.

This commit makes sure to create separate source files if the number
of beans to register is very large. The main generated source file
delegate to those.

Closes gh-35044
2025-06-30 12:53:38 +02:00
Sébastien Deleuze 0e11dbfcca Use Java 24 instead of Java 23 in the CI Github action
To fix the broken build, and to focus on testing the Java
LTS versions and the latest one.
2025-06-30 12:01:34 +02:00
Sam Brannen 769ba9e23b 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-06-29 17:42:35 +02:00
Sam Brannen 1ad05db877 Simplify dependency management for JUnit artifacts
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
This commit simplifies our dependency management for JUnit artifacts by
making use of the junit-jupiter and junit-platform-suite aggregator
artifacts.

Closes gh-35127
2025-06-29 17:42:22 +02:00
Sam Brannen 5513139ef5 Clean up warnings and revise for consistency 2025-06-29 16:47:53 +02:00
Sam Brannen bb7c497bdd Remove obsolete code from internal HibernateTransactionObject
See gh-35111
2025-06-29 16:33:01 +02:00
Sam Brannen b211ac1f4a Resolve warning in CachingMetadataReaderFactoryTests 2025-06-29 16:28:09 +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
Sam Brannen ad278cd52e Fix ExponentialBackOffTests 2025-06-28 19:29:49 +02:00
Sam Brannen 4cdfd90882 Polish backoff and retry support
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
This revises commit 15dd320b95.

See gh-34529
See gh-35110
2025-06-28 19:14:45 +02:00
Juergen Hoeller 96f0399072 Reintroduce FixedBackOff(long) constructor
Effectively removing FixedBackOff(Duration) only.

See gh-35028
See gh-35110
2025-06-28 12:11:02 +02:00
Juergen Hoeller 15dd320b95 Consistent maxAttempts (long) and delay/maxDelay (Duration) declarations
Includes timeUnit attribute in @Retryable (aligned with @Scheduled).

See gh-34529
See gh-35110
2025-06-28 11:40:00 +02:00
Sam Brannen bcdf26d492 Redesign RetryPolicy to directly incorporate BackOff
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
After experimenting with our newly introduced core retry support
(RetryPolicy, RetryTemplate, etc.) and @⁠Retryable support, it
became apparent that there are overlapping concerns between the current
RetryPolicy and BackOff contracts.

- RetryPolicy and BackOff both have stateful executions: RetryExecution
  and BackOffExecution. However, only one stateful execution is
  necessary.

- FixedBackOff and ExponentialBackOff already incorporate "retry" logic
  in terms of max attempts, max elapsed time, etc. Thus, there is no
  need to duplicate such behavior in a RetryPolicy and its
  RetryExecution.

- RetryTemplate currently accepts both a RetryPolicy and a BackOff in
  order to instrument the retry algorithm. However, users would
  probably rather focus on configuring all "retry" logic via a single
  mechanism.

In light of the above, this commit directly incorporates BackOff
in RetryPolicy as follows.

- Remove the RetryExecution interface and move its shouldRetry() method
  to RetryPolicy, replacing the current RetryExecution start() method.

- Introduce a default getBackOff() method in the RetryPolicy interface.

- Introduce RetryPolicy.withDefaults() factory method.

- Completely overhaul the RetryPolicy.Builder to provide support for
  configuring a BackOff strategy.

- Remove BackOff configuration from RetryTemplate.

- Revise the method signatures of callbacks in RetryListener.

The collective result of these changes can be witnessed in the
reworked implementation of AbstractRetryInterceptor.

RetryPolicy retryPolicy = RetryPolicy.builder()
		.includes(spec.includes())
		.excludes(spec.excludes())
		.predicate(spec.predicate().forMethod(method))
		.maxAttempts(spec.maxAttempts())
		.delay(Duration.ofMillis(spec.delay()))
		.maxDelay(Duration.ofMillis(spec.maxDelay()))
		.jitter(Duration.ofMillis(spec.jitter()))
		.multiplier(spec.multiplier())
		.build();

RetryTemplate retryTemplate = new RetryTemplate(retryPolicy);

See gh-34716
See gh-34529
See gh-35058
Closes gh-35110
2025-06-27 17:28:10 +02:00
rstoyanchev 5a6c019413 Support for functional routing by API version
See gh-35113
2025-06-27 16:22:44 +01:00
rstoyanchev 224f1af08e Prepare to support API versioning for fn
Add default method to resolve, parse, and validate version
Simplify tests
2025-06-27 16:22:44 +01:00
rstoyanchev d045f44693 Polishing in RequestMappingHandlerMapping 2025-06-27 16:22:44 +01:00
Sam Brannen 7cc29d2019 Revise naming and docs for "jitter" and "multiplier" in AOP retry support
See gh-34529
2025-06-27 16:17:40 +02:00
Sam Brannen 98b29b5e37 Consistently implement toString() in BackOff strategies
Closes gh-35120
2025-06-27 16:10:55 +02:00
Sam Brannen d97288a74e Improve Javadoc and tests for BackOff strategies 2025-06-27 16:04:32 +02:00
Brian Clozel 28f9adf88e Simplify media files detection in WebMvcConfigurationSupport
Prior to this commit, `WebMvcConfigurationSupport` would configure file
extensions/media types registrations based on classpath detection.
Since gh-33894, the detection of message converters is located in a
single place, `HttpMessageConverters`.

This commit updates the `WebMvcConfigurationSupport` to use the actual
message converters configured to decide which file extensions should be
set up for content negotiation.

See gh-33894
2025-06-27 15:06:32 +02:00
Juergen Hoeller 02ff681c73 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/StaticListableBeanFactory.java
#	spring-beans/src/test/java/org/springframework/beans/factory/BeanFactoryUtilsTests.java
2025-06-27 12:31:46 +02:00
Juergen Hoeller bd72f1fefc Fix inconsistencies in StaticListableBeanFactory
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-35119
2025-06-27 12:28:52 +02:00
Juergen Hoeller 15209dd2a7 Upgrade to Hibernate ORM 7.0.3 and EclipseLink 5.0.0-B08
See gh-33750
2025-06-27 11:26:34 +02:00
Brian Clozel da124a9e89 Make HttpMessageConverters classpath detection static
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
Prior to this commit, the classpath detection of various
`HttpMessageConverter` types was using an instance `ClassLoader`. The
main goal here was to provide the feature and being able to test it with
filtered classloaders.

It seems this approach fails with GraalVM and we need to ensure that
classpath detection is performed at class loading time for our GraalVM
feature (inlining such static booleans at build time).
As a result, we need to remove the tests for classpath detection.

See gh-33894
2025-06-27 10:10:40 +02:00
Brian Clozel 7e919d2c96 Reorder multipart converter for server converters
Closes gh-33894
2025-06-27 09:30:34 +02:00
Brian Clozel beedf0a76b Use HttpMessageConverters in client and server config
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
This commit uses the new `HttpMessageConverters` class for the HTTP
client (`RestTemplate` and `RestClient`) and HTTP server support.

This effectively removes the duplication of classpath detection for
message converters in multiple places: clients, server and the multipart
converter itself.
Instead of creating multiple instances of the same converters, this
allows applications to share converter instances as much as possible for
better memory efficiency.

As a result, this change also deprecates configuration methods in the
MVC support that are superseded by the new methods introduced for
`HttpMessageConverters` support.

Closes gh-33894
2025-06-26 17:19:33 +02:00
Brian Clozel 1af25e9cb1 Add HttpMessageConverters
Prior to this commit, Spring Web would configure
`HttpMessageConverter<?>` collections on clients like `RestTemplate` and
on the server infrastructure, in `WebMvcConfigurationSupport`.

This commit introduces a high-level construct for building and
configuring ordered collections of converters.

This includes:
* configuration of well-known converters with classpath detection
* configuration of shared converters, or client/server specific
* configuration of custom converters

See gh-33894
2025-06-26 17:19:33 +02:00
Juergen Hoeller 4b44a34692 Complete treatment of RuntimeBeanReference in BeanDefinitionValueResolver
See gh-35101
2025-06-26 17:15:31 +02:00
Stefano Cordio f7fef93842 Refine nullability of MethodInvoker#setArguments
Closes gh-35089
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2025-06-26 15:04: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 c5da405314 Consistent type-based bean lookup for RuntimeBeanReference
See gh-35101
2025-06-26 14:47:54 +02:00
Juergen Hoeller 06ef82e9a5 Consistent type-based bean lookup for internal resolution paths
Includes additional tests for List/ObjectProvider dependencies.

See gh-35101
2025-06-26 12:51:55 +02:00
Juergen Hoeller 2e9e45ee55 Restore translation of IllegalArgumentException for JPA
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
See gh-35111
2025-06-25 22:39:18 +02:00
Juergen Hoeller b3dc75265d Merge branch '6.2.x' 2025-06-25 22:36:44 +02:00
Juergen Hoeller 511739e3de Add missing test for IllegalArgumentException
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
See gh-35111
2025-06-25 22:35:26 +02:00
Brian Clozel 6e6280a42c Disallow @org.jetbrains.annotations.Nullable imports
This commit adds a checkstyle rule that rejects
`@org.jetbrains.annotations.Nullable` imports in the source code.

See gh-35114
2025-06-25 20:43:48 +02:00
Tran Ngoc Nhan 1a046f9cec Fix Nullable import in ClassFileAnnotationMetadata
Closes gh-35114

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-06-25 20:43:09 +02:00
Brian Clozel 2fa25b50d9 Fix caching operations in CachingMetadataReaderFactory
gh-33616 refactored `CachingMetadataReaderFactory` and broke the
behavior as it bypassed the cache for `getMetadataReader(String
className)` operations.

This commit restores the original behavior.

Fixes gh-35112
2025-06-25 20:32:38 +02:00
Juergen Hoeller b3a5473bc7 Merge branch '6.2.x'
# Conflicts:
#	framework-docs/modules/ROOT/pages/data-access/orm/hibernate.adoc
#	spring-orm/src/main/java/org/springframework/orm/hibernate5/package-info.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaDialect.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/vendor/HibernateJpaVendorAdapter.java
2025-06-25 19:08:30 +02:00
Juergen Hoeller 61474cc34c Upgrade to Checkstyle 10.26 2025-06-25 19:00:45 +02:00
Juergen Hoeller 0bee65482f Document actual status of orm.hibernate5 and Hibernate JPA support
See gh-35111
2025-06-25 18:59:06 +02:00