Commit Graph

4566 Commits

Author SHA1 Message Date
Sébastien Deleuze 8647c44364 Add dynamic ObjectToObjectConverter hints
This commit refines BindingReflectionHintsRegistrar with additional
dynamic hints for application-defined types, main core Java conversion
ones being already covered by ObjectToObjectConverterRuntimeHints.

Closes gh-35847
2025-11-26 16:17:41 +01:00
Tran Ngoc Nhan c599775a9e Refine nullability of Assert#noNullElements
Closes gh-35868
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-11-24 09:42:44 +01:00
Juergen Hoeller f456674529 Polishing 2025-11-19 16:19:14 +01:00
Patrick Strawderman 3b6be3d4d3 Fix single-check idiom in UnmodifiableMultiValueMap
Read the respective fields only once in the values(), entrySet(), and
keySet() methods.

Closes gh-35822

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-11-17 15:02:53 +01:00
Sam Brannen 09a8bbc0c7 Polish contribution
See gh-35817
2025-11-17 12:20:12 +01:00
Patrick Strawderman ed75906834 Fix Spliterator characteristics in ConcurrentReferenceHashMap
The Spliterators returned by values, entrySet, and keySet incorrectly
reported the SIZED characteristic, instead of CONCURRENT. This could
lead to bugs when the map is concurrently modified during a stream
operation.

For keySet and values, the incorrect characteristics are inherited from
AbstractMap, so to rectify that the respective methods are overridden,
and custom collections are provided that report the correct Spliterator
characteristics.

Closes gh-35817

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-11-17 11:55:38 +01:00
Juergen Hoeller eadc5b09ac Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
2025-11-11 19:46:12 +01:00
Juergen Hoeller 23354b0155 Fix doTask method visibility (referring to private Task type)
See gh-35794
2025-11-11 19:41:44 +01:00
Sam Brannen a3e8a173a8 Polishing 2025-11-11 16:52:07 +01:00
Juergen Hoeller 12dd758158 Provide compute method implementations in ConcurrentReferenceHashMap
Closes gh-35794
2025-11-11 15:39:21 +01:00
Juergen Hoeller 0552cdb7ed Revise ConcurrentReferenceHashMap for @ConcurrencyLimit race condition
Closes gh-35788
See gh-35794
2025-11-11 13:39:15 +01:00
Sébastien Deleuze a68d60768e Introduce KotlinDetector#hasSerializableAnnotation
This commit introduces a KotlinDetector#hasSerializableAnnotation
utility method designed to detect types annotated with
`@Serializable` at type or generics level.

See gh-35761
2025-11-10 11:34:49 +01:00
Sam Brannen 24590092ef Rename maxAttempts to maxRetries in @⁠Retryable and RetryPolicy
Prior to this commit, the maximum number of retry attempts was
configured via @⁠Retryable(maxAttempts = ...),
RetryPolicy.withMaxAttempts(), and RetryPolicy.Builder.maxAttempts().
However, this led to confusion for developers who were unsure if
"max attempts" referred to the "total attempts" (i.e., initial attempt
plus retry attempts) or only the "retry attempts".

To improve the programming model, this commit renames maxAttempts to
maxRetries in @⁠Retryable and RetryPolicy.Builder and renames
RetryPolicy.withMaxAttempts() to RetryPolicy.withMaxRetries(). In
addition, this commit updates the documentation to consistently point
out that total attempts = 1 initial attempt + maxRetries attempts.

Closes gh-35772
2025-11-10 11:15:25 +01:00
Juergen Hoeller 73dfd08526 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-core/src/main/java/org/springframework/core/BridgeMethodResolver.java
2025-11-08 10:03:18 +01:00
Juergen Hoeller 6f81cb625c Avoid unnecessary bridge method resolution around getMostSpecificMethod
Closes gh-35780
2025-11-08 09:16:31 +01:00
Juergen Hoeller 566078b4e4 Add explicit note on empty constructor
See gh-35773
2025-11-08 09:14:53 +01:00
Brian Clozel 06ae7fb2b5 Add jar validation and fix multi-release jar
See gh-35768

Signed-off-by: Clayton Walker <clayton.m.walker@gmail.com>
2025-11-07 15:20:27 +01:00
Brian Clozel 21d3b2d179 Merge branch '6.2.x' 2025-11-07 14:03:40 +01:00
Brian Clozel f0cf7f19f6 Fix multi-release JAR issue with VirtualThreadDelegate
This commit ensures that both `VirtualThreadDelegate` implementations
expose the same public API. If not, JAR verification fails with the
following message:

```
jar --validate --file spring-core-6.2.13-SNAPSHOT.jar
entry: META-INF/versions/21/org/springframework/core/task/VirtualThreadDelegate.class, contains a class with different api from earlier version
```

Fixes gh-35773
2025-11-07 14:01:51 +01:00
Juergen Hoeller f6a3346e3f Polishing 2025-11-06 10:50:53 +01:00
Juergen Hoeller 247d2e3e36 Merge branch '6.2.x' 2025-11-06 10:43:55 +01:00
Juergen Hoeller b5008d33ee Upgrade to ASM 9.9 plus lenient version check patch
Closes gh-35763
2025-11-06 10:41:34 +01:00
Juergen Hoeller 0912497e70 Merge branch '6.2.x' 2025-11-01 12:53:27 +01:00
Juergen Hoeller 15563ee54e Polishing 2025-11-01 12:43:51 +01:00
Artur Signell 97586b525f fix: Fix PathMatchingResourcePatternResolver to handle absolute paths in JAR manifests
When JAR manifest Class-Path entries contain absolute paths (as Gradle
creates on Windows for long classpaths), PathMatchingResourcePatternResolver
incorrectly rejected them.

Fixes #35730

Signed-off-by: Artur Signell <artur@vaadin.com>
2025-11-01 12:25:20 +01:00
Juergen Hoeller d63f1a8bea Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-10-30 17:32:16 +01:00
Park Juhyeong 14579b7848 Fix concurrency permit leak causing permanent deadlock in SimpleAsyncTaskExecutor
When concurrency limiting is enabled via setConcurrencyLimit() and
thread creation fails in doExecute() (e.g., OutOfMemoryError from
Thread.start()), the concurrency permit acquired by beforeAccess()
is never released because TaskTrackingRunnable.run() never executes.

This causes the concurrency count to permanently remain at the limit,
causing all subsequent task submissions to block forever in
ConcurrencyThrottleSupport.onLimitReached().

Root cause:
- beforeAccess() increments concurrencyCount
- doExecute() throws Error before thread starts
- TaskTrackingRunnable.run() never executes
- afterAccess() in finally block never called
- Concurrency permit permanently leaked

Solution:
Wrap doExecute() in try-catch block in the concurrency throttle path
and call afterAccess() in catch block to ensure permit is always
released, even when thread creation fails.

The fix only applies to the concurrency throttle path. The
activeThreads-only path does not need fixing because it never calls
beforeAccess(), so there is no permit to leak.

Test approach:
The test simulates thread creation failure and verifies that a
subsequent execution does not deadlock. The first execution should
fail with some exception (type doesn't matter), and the second
execution should complete within timeout if the permit was properly
released.

Signed-off-by: Park Juhyeong <wngud5957@naver.com>
2025-10-30 17:29:39 +01:00
Sam Brannen 2d3c2e3feb Revise contribution
See gh-35380
2025-10-30 16:13:38 +01:00
Dmytro Nosan a41af448ec Ensure SingletonSupplier is singleton even if singletonInstance is null
Previously, SingletonSupplier stored "null" in singletonInstance when
the supplied instance was "null". On subsequent get() calls, this was
treated as "uninitialized" and triggered another attempt to obtain an
instance from the Supplier.

This commit ensures that a "null" returned from the instanceSupplier or
defaultSupplier is handled correctly, so that subsequent calls to get()
return "null" consistently instead of repeatedly invoking the Supplier.

Closes gh-35380

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-10-30 16:13:13 +01:00
Sébastien Deleuze 7509e257d1 Remove outdated Portlet mentions
Closes gh-35726
2025-10-30 16:02:15 +01:00
Sébastien Deleuze 694224f1a6 Remove outdated Spring version mentions
Close gh-35696
2025-10-28 13:58:09 +01:00
Sam Brannen 11587d51b2 Merge branch '6.2.x' 2025-10-26 15:23:39 +01:00
Sam Brannen b1f5b61bcd Abort search for static methods in getPubliclyAccessibleMethodIfPossible()
Prior to this commit, getPubliclyAccessibleMethodIfPossible() in
ClassUtils incorrectly returned a hidden static method as an
"equivalent" method for a static method with the same signature;
however, a static method cannot be overridden and therefore has no
"equivalent" method in a super type.

To fix that bug, this commit immediately aborts the search for an
"equivalent" publicly accessible method when the original method is a
static method.

See gh-33216
See gh-35189
See gh-35556
Closes gh-35667
2025-10-26 15:21:17 +01:00
rstoyanchev a982c9b481 ObjectUtils uses HexFormat to format byte[]
Also remove equivalent, applied temporarily in FieldError in 6.2.x.

Closes gh-35675
2025-10-24 13:02:57 +01:00
Sébastien Deleuze baaddae38e Convert PropagationContextElement to a Java class
In order to avoid having Java types depending on Kotlin types
which breaks the compilation in Eclipse IDE.

Closes gh-35661
2025-10-20 16:40:31 +02:00
Sam Brannen 0fbebd856f Revise contribution
See gh-35660
2025-10-18 13:50:22 +02:00
Kamil Krzywanski 948367092c Use empty array constants instead of repeatedly creating new ones
Closes gh-35660

Signed-off-by: Kamil Krzywański <kamilkrzywanski01@gmail.com>
Signed-off-by: Kamil Krzywanski <kamilkrzywanski01@gmail.com>
2025-10-18 13:36:06 +02:00
Sébastien Deleuze 16851b5128 Merge branch '6.2.x' 2025-10-17 15:46:36 +02:00
HJC96 d7fc07e73c Fix typos
Closes gh-35656
Signed-off-by: HJC96 <gkswlcjs2@naver.com>
2025-10-17 15:46:27 +02:00
Juergen Hoeller 527643f142 Merge branch '6.2.x' 2025-10-15 19:41:20 +02:00
Juergen Hoeller c53132ecdf Polishing 2025-10-15 19:40:09 +02:00
rstoyanchev a78554eea6 Merge branch '6.2.x' 2025-10-14 16:50:53 +01:00
rstoyanchev 05814f7a42 Polishing contribution
Closes gh-35625
2025-10-14 16:49:10 +01:00
Marius Lichtblau ba2bb08589 Release DataBuffer in AbstractCharSequenceDecoder
if String creation fails

See gh-35625

Signed-off-by: Marius Lichtblau <marius@lichtblau.io>
2025-10-14 16:49:10 +01:00
Juergen Hoeller fad2068bcb Merge branch '6.2.x' 2025-10-14 11:30:37 +02:00
Juergen Hoeller 3a61460f91 Use JarFile#entries() instead of #stream() for consistent entry paths
Closes gh-35617
2025-10-14 11:23:34 +02:00
Brian Clozel 2f8d52fd47 Merge branch '6.2.x' 2025-10-13 18:46:47 +02:00
Brian Clozel ee284f2ee6 Add "forEachByte" variant to DataBuffer
As reported in gh-34651, `DataBuffer#getByte` can be inefficient for
some implementations, as bound checks are performed for each call.

This commit introduces a new `forEachByte` method that helps with
traversing operations without paying the bound check cost for each byte.

Closes gh-35623
2025-10-13 18:28:34 +02:00
Sébastien Deleuze ec77bb0032 Introduce automatic context propagation in Coroutines
Closes gh-35485
2025-10-13 16:14:25 +02:00
Dariusz Jędrzejczyk b2c84ac038 Adapt to Reactor 3.8 JSpecify annotations
Closes gh-35501
Signed-off-by: Dariusz Jędrzejczyk <dariusz.jedrzejczyk@broadcom.com>
2025-10-13 09:01:47 +02:00