Commit Graph
35696 Commits
Author SHA1 Message Date
Sam Brannen 69a298b8ee Merge branch '7.0.x' 2026-10-03 18:37:11 +02:00
머랭 5e45b9be1b Fix connection leak in MySQLMaxValueIncrementer
Move connection cleanup into a finally block so the connection
is closed even if commit or auto-commit restoration fails.

Closes gh-37321

Signed-off-by: cookie-meringue <daehyeon3351@gmail.com>
2026-10-03 18:36:50 +02:00
Tran Ngoc Nhan e6b3007de5 Remove unnecessary @Nullable annotations
* `DefaultPersistenceUnitManager.java`
`dataSourceLookup` is initialized with a non-null `DataSourceLookup`, so `getDataSourceLookup()` does not return `null`.

* `TestContextTransactionUtils.java`
The transaction attribute name is stored as a non-null value, so `getName()` does not return `null`.

* `RequestContext.java`
The model is represented by a `Map` rather than a nullable value, so `getModel()` can return a non-null `Map`.

Closes gh-37379

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-10-03 18:03:33 +02:00
Sam Brannen 8f41c65fbc Suppress deprecation warnings
See gh-37345
2026-10-03 14:28:00 +02:00
Sam Brannen 649f4f494d Merge branch '7.0.x' 2026-10-03 14:14:28 +02:00
Hyunwoo Jung f03b76a53d Copy cookies in RenderingResponse.from()
Prior to this commit, RenderingResponse.from() did not copy the
cookies of the given response, unlike ServerResponse.from().

See gh-22481
Closes gh-37378

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
2026-10-03 14:14:09 +02:00
Sam Brannen 3c57b2421b Merge branch '7.0.x' 2026-10-03 14:03:39 +02:00
Sam Brannen d5a7fc9a9c Update exception message in HttpMessageNotReadableException
See gh-33809
2026-10-03 13:59:21 +02:00
Sébastien Deleuze 4302d02257 Merge branch '7.0.x' 2026-10-02 16:50:19 +02:00
Sébastien Deleuze c377da58d9 Make CONTRIBUTING.md self-contained and add AGENTS.md
Prior to this commit, CONTRIBUTING.md delegated build instructions
and code style to wiki pages, which are planned for removal.

This commit inlines the build, code style and testing guidelines
into CONTRIBUTING.md, aligns them with the current build and
Checkstyle rules, and documents the commit message conventions, the
security policy and the policy on AI-assisted contributions. It also
adds a concise AGENTS.md extract for coding agents, and updates the
README to link to the Build from Source section.

Closes gh-37372

Signed-off-by: Sébastien Deleuze <sdeleuze@users.noreply.github.com>
2026-10-02 16:48:13 +02:00
Sam Brannen c259185b52 Polish CompositeMap and CollectionUtils 2026-10-02 16:41:39 +02:00
Yanming Zhou f5a7123044 Honor Collection.remove() contract in CompositeCollection
Before this commit, `second.remove(o)` was called no matter whether
`first.remove(o)` returned `true` or `false`. If the element was present
in both collections, it was removed from both, which violates the
`Collection.remove(Object)` contract of removing a single instance.

Closes gh-37332

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-10-02 16:26:53 +02:00
Sam Brannen db4f57a54f Polish contribution
See gh-37356
2026-10-02 15:49:37 +02:00
Rene Schakmann 912b0bce9d Improve pre-bound JDBC Connection exception message
Prior to this commit, JpaTransactionManager and
HibernateTransactionManager stated that they do not support "running
within DataSourceTransactionManager" when encountering a pre-bound
JDBC Connection that is not synchronized with a transaction.

However, DataSourceTransactionManager marks its ConnectionHolder as
synchronized with the transaction and therefore does not trigger this
check. Instead, the exception is typically caused by another
JpaTransactionManager or HibernateTransactionManager for a different
persistence unit exposing a JDBC Connection for the same DataSource,
or by a JDBC Connection that has been left bound to the current
thread.

This commit revises the exception message accordingly so that it no
longer points to DataSourceTransactionManager.

See gh-14130
Closes gh-37356

Signed-off-by: rene.schakmann <rene.schakmann@reetgroup.com>
2026-10-02 15:33:49 +02:00
Sam Brannen 0ff69cfdb6 Merge branch '7.0.x' 2026-10-02 15:13:53 +02:00
Rene Schakmann 23cdf8465c Clarify ConcurrentReferenceHashMap reference semantics
Prior to this commit, the Javadoc for ConcurrentReferenceHashMap
stated that soft or weak references are used for both keys and values.

However, the references are applied to the internal map entries, each
of which holds strong references to its key and value. Consequently,
an entry may be discarded even if its key and value are still strongly
reachable from elsewhere, which differs from the semantics of
WeakHashMap.

This commit revises the class-level Javadoc as well as the Javadoc for
the ReferenceType constants to document this behavior.

See gh-24253
Closes gh-37357

Signed-off-by: rene.schakmann <rene.schakmann@reetgroup.com>
2026-10-02 15:13:24 +02:00
Sam Brannen e23e90e815 Merge branch '7.0.x' 2026-10-02 13:42:22 +02:00
Sam Brannen 105c39bab7 Document type support in JSP <form:input> and point to <form:password>
Prior to this commit, the reference manual mentioned that the JSP
<form:input> tag supports HTML5-specific types, but the Javadoc and
spring-form.tld did not document the `type` attribute at all, and none
of the documentation explained which types are supported or that
<form:password> must be used for password fields.

This commit updates the documentation as follows.

- Document in InputTag, spring-form.tld, and the reference manual that
  a `type` can be supplied as a dynamic attribute, that `checkbox` and
  `radio` are not supported, and that the bound value is rendered as-is.
- Add notes to InputTag, the reference manual, and spring-form.tld
  stating that <form:input type="password"> must not be used and that
  <form:password> should be used instead.
- Document in PasswordInputTag, spring-form.tld, and the reference
  manual that <form:password> does not render the bound value by default.

Closes gh-37376
2026-10-02 13:41:27 +02:00
Sam Brannen f447f3c310 Merge branch '7.0.x' 2026-10-01 12:16:06 +02:00
Sam Brannen 846521d8c5 Work around Eclipse compiler type inference errors
Eclipse fails to infer the generic types in XmlEventDecoder and
DefaultWebClient, even though javac and IntelliJ IDEA compile the code
without issues.

This commit introduces explicit type arguments for the calls to
flatMapIterable() and exceptionWrappingFunction() to work around those
bugs.
2026-10-01 12:09:57 +02:00
Juergen Hoeller 141a84724a Deprecate multi-batch batchUpdate variant in JdbcTemplate
Closes gh-37345
2026-09-30 22:29:57 +02:00
Chengang Guan 5e7630469c Fix container detection in RepeatableContainers.standardRepeatables()
StandardRepeatableContainers.computeRepeatedAnnotationsMethod()
previously treated any annotation as a container annotation if it
merely declared a `value` attribute returning an array of a
@⁠Repeatable annotated type, without verifying that the repeatable
annotation actually references the candidate container via
@⁠Repeatable.value().

Consequently, an unrelated annotation that happened to have the same
shape as the official container (e.g. a "fake" container with a `value`
attribute returning the same repeatable type) was incorrectly
recognized as a container.

This commit aligns the detection logic with the Java language semantics
by additionally asserting that the container type declared in
@⁠Repeatable.value() is identical to the candidate annotation type.

Closes gh-37326

Signed-off-by: Chengang Guan <guanchengang@qq.com>
2026-09-30 17:41:07 +02:00
Sam Brannen 9289f71ad7 Merge branch '7.0.x' 2026-09-30 17:14:52 +02:00
Sam Brannen 3a600481d2 Polish code base
- Remove redundant super() calls from constructors
- Add missing @⁠Override annotations
- Use switch rules in JdkClientHttpRequest and RfcUriParser
- Use instanceof pattern matching
- Use method references instead of trivial lambda expressions
- Use lambda expressions instead of anonymous inner classes
- Remove unused code and redundant semicolons
- Use braces with if-blocks
2026-09-30 17:08:47 +02:00
Brian Clozel 9a87fa6d12 Add DataBuffers utility class
Prior to this commit, `DataBufferUtils` would implement many utility
static methods for managing and processing `DataBuffer` instances.
`DataBuffer` is tightly linked to the reactive space, but its usage
shoudn't be limited to applications that use `Publisher` extensively.

This commit gathers methods that do not depend on `Publisher` into a new
`DataBuffers` type that `DataBufferUtils` now extend. This allows to use
`DataBuffer` instances in a non-reactive case.

Fixes gh-37353
2026-09-30 15:58:46 +02:00
Sam Brannen 634d187130 Merge branch '7.0.x' 2026-09-30 13:43:28 +02:00
Sam Brannen 043442a2a1 Test single-value to primitive array adaptation via @⁠AliasFor
This commit adds a test to MergedAnnotationsTests that verifies a
single primitive attribute in a composed annotation can be aliased via
@⁠AliasFor to a primitive array attribute in a meta-annotation.

See gh-37349
2026-09-30 13:42:35 +02:00
Chengang Guan 6afb65b225 Fix single-value adaptation for primitive array types in TypeMappedAnnotation
Prior to this commit, `adaptForAttribute(Method, Object)` created
the wrapping array from `value.getClass()` when a single non-array
value was provided for an array attribute. This worked for object
array types but failed for primitive array types: wrapping a boxed
value produced a boxed array, which then failed the compatibility
check and threw an `IllegalStateException`.

This commit derives the component type from the declared attribute
type when it is assignable from the value type, falling back to
`value.getClass()` otherwise. The existing adaptation path for
object array types is therefore preserved, and all primitive array
types now accept a single value.

The accompanying test covers single-value wrapping for every array
type declared by ArrayTypes.

Closes gh-37349

Signed-off-by: Chengang Guan <guanchengang@qq.com>
2026-09-30 13:37:25 +02:00
Sam Brannen 9f97b5c61e Merge branch '7.0.x' 2026-09-30 12:57:17 +02:00
Sam Brannen 4d3beb5c3b Stop using Tomcat's deprecated addServletMappingDecoded() method
(cherry picked from commit 4f51801320)
2026-09-30 12:50:37 +02:00
Sam Brannen 9b8850694d Merge branch '7.0.x' 2026-09-30 12:47:51 +02:00
김준형 1b4955e49f Avoid phantom keys in LinkedCaseInsensitiveMap.computeIfAbsent
computeIfAbsent registered the case-insensitive key before invoking the
mapping function. If the function returned null or threw an exception,
no mapping was recorded in the target map, but the key registration was
left behind. The map then reported containsKey(key) as true while size()
was 0, keySet() was empty, and get(key) returned null. A later insertion
with a different casing also reused the stale casing of the failed call,
since the existing-key branch resolved to the registered key.

The case-insensitive key is now only looked up up front. For a new key,
it is registered from within the mapping function once a non-null value
has been computed, which is still before the entry is inserted. A null
result or an exception therefore leaves both maps untouched, while a
removeEldestEntry override that evicts the new entry right away still
removes the registration, as it does for put. The existing-key path
keeps computing under the stored casing.

Closes gh-37351

Signed-off-by: junhyeong9812 <pickjog@gmail.com>
2026-09-30 12:47:30 +02:00
Sébastien Deleuze 7cfbace755 Merge branch '7.0.x' 2026-09-30 10:47:10 +02:00
Sébastien Deleuze 06c597ed6f Use equality check for value class KClass comparison
KClass instances representing the same class are not guaranteed to be
identical, so the overridden function return type check introduced in
c39edeff15 could wrongly skip unboxing, for example when a class
implements an interface declaring the same suspending function.

See gh-37191
2026-09-30 10:23:53 +02:00
Brian Clozel ebef12d92c Rewrite CssLinkResourceTransformer for efficient parsing
Prior to this commit, both variants of `CssLinkResourceTransformer`
would use a simple CSS parser for detecting CSS links and delegating to
the transformer for links rewrite.

This commit rewrites the internal parser for a single pass, byte by
byte, memory efficient parsing. This implementation is also more
resistant to edge cases.

Closes gh-37348
2026-09-29 19:11:51 +02:00
Sébastien Deleuze 66910734e2 Merge branch '7.0.x' 2026-09-29 17:02:07 +02:00
Sébastien Deleuze c39edeff15 Refine Kotlin value class contribution
Only unbox value class results when the caller expects their unboxed
representation (non-primitive underlying type, non-nullable underlying
type for nullable return types, and no overridden function with a
different return type), and add related tests.

Cache the unbox method resolution per method and make it accessible
to support non-public value classes.

Closes gh-37191
2026-09-29 16:49:17 +02:00
Dmitry Sulman c08fd24de3 Fix value class return handling for suspending AOP methods
Unbox Kotlin value class results returned from proxied suspending
methods before returning them to the caller.

Spring AOP interceptor chains expose return values as Object, which
causes Kotlin value class results to be boxed. For suspending functions,
the direct return path expects the unboxed value class representation.

Update both CglibAopProxy and JdkDynamicAopProxy to detect value class
return types and unbox boxed results after coroutine adaptation.

Add tests for suspending methods returning value classes.

See gh-37191
See gh-37155

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2026-09-29 15:01:39 +02:00
Sam Brannen 4f51801320 Stop using Tomcat's deprecated addServletMappingDecoded() method 2026-09-29 13:00:21 +02:00
Yanming Zhou 67fe0f4a22 Polish DefaultJdbcClient
Closes gh-37343

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-09-29 10:49:00 +02:00
Sam Brannen ae2caf89de Merge branch '7.0.x' 2026-09-28 18:41:34 +02:00
Sam Brannen c70c434486 Recognize relocated Mockito MockAccess interface
Since Mockito 5.16.1, MockAccess moved from
org.mockito.internal.creation.bytebuddy.MockAccess to
org.mockito.internal.creation.bytebuddy.access.MockAccess.

Consequently, ProxyProcessorSupport.isInternalLanguageInterface() no
longer recognized it, causing an auto-proxied mock created with the
subclass mock maker and proxyTargetClass=false to receive a JDK proxy
that only implements MockAccess instead of a CGLIB proxy of its own
class.

This commit adds a check for the new package name alongside the
existing one, since older Mockito versions may still be on the
classpath.

Closes gh-37342
2026-09-28 18:38:07 +02:00
Sam Brannen 833ab4d48f Introduce entry-based DSL for JdbcClient batch updates
Prior to this commit, JdbcClient's BatchSpec bound parameters to a
"current" batch entry and separated consecutive entries via add(). That
style was error-prone, since a missing add() still compiled but
silently merged parameters into a single entry. It also did not lend
itself to providing batch parameters dynamically — for example, from an
existing collection of domain objects.

To address that, this commit replaces the chaining style with
self-contained batch entries. BatchSpec now provides entry(...) methods
that define a single entry — via a Consumer<BatchEntry> callback, a
List of positional parameters, or a Map of named parameters — as well
as entries(...) methods that define one entry per parameter object.
Such calls can be freely combined within the same batch.

The new BatchEntry type exposes only the singular param(...) and
paramSource(...) methods. The add() method as well as the param(...),
params(...), and paramSource(...) methods have been removed from
BatchSpec.

Closes gh-37341
2026-09-28 16:39:16 +02:00
Sam Brannen 223a5562be Polish Javadoc and tests for JdbcClient 2026-09-28 12:07:25 +02:00
Yanming Zhou 1d21c6a578 Improve JdbcClient to align BatchSpec with StatementSpec
This commit introduces the following methods in BatchSpec:

1. `param(int jdbcIndex, @Nullable Object value)`
2. `param(int jdbcIndex, @Nullable Object value, int sqlType)`
3. `param(String name, @Nullable Object value, int sqlType)`

Closes gh-37307

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-09-28 11:51:46 +02:00
Chengang Guan 30d025e57e Fix internal Javadoc link in AttributeMethods
Closes gh-37337

Signed-off-by: Chengang Guan <guanchengang@qq.com>
2026-09-28 10:45:38 +02:00
Sam Brannen b096db843b Merge branch '7.0.x' 2026-09-28 10:44:15 +02:00
Tran Ngoc Nhan e19e17eca5 Add missing enclosing single quotes in Javadoc
Closes gh-37338

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-09-28 10:43:38 +02:00
Sam Brannen 93ff61fb1f Merge branch '7.0.x' 2026-09-25 17:39:46 +02:00
Hyunwoo Jung fd23ae2393 Fix MockMvc async requests example in documentation
See gh-24103
Closes gh-37318

Signed-off-by: Hyunwoo Jung <hyunwoojung@kakao.com>
2026-09-25 17:39:02 +02:00