Commit Graph
35662 Commits
Author SHA1 Message Date
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
Brian Clozel f9299ac471 Merge branch '7.0.x' 2026-09-25 17:08:06 +02:00
Brian Clozel a2e3c0d81d Skip invalid links in CssLinkResourceTransformer
Prior to this commit, both `CssLinkResourceTransformer` implementations
could fail at runtime in case of invalid CSS links (for example, with
out of bounds exceptions).

This commit skips invalid links and writes them out to the resulting CSS
without any transformation.

Fixes gh-37336
2026-09-25 17:06:28 +02:00
Sam Brannen 6f6c9d5778 Merge branch '7.0.x' 2026-09-25 16:14:52 +02:00
Sam Brannen 24645069f9 Upgrade to Gradle 9.8
Closes gh-37160
2026-09-25 16:14:12 +02:00
Brian Clozel f935b8da24 Merge commit 'v7.1.0-M2~1' 2026-09-24 14:05:28 +02:00
Brian Clozel bc45a6a511 Merge branch '7.0.x' 2026-09-22 22:18:36 +02:00
Brian Clozel 1cfc7f8ebc Do not perform expansion on license file 2026-09-22 22:17:57 +02:00
Brian Clozel eb75a5cca9 Merge branch '7.0.x' 2026-09-22 16:59:09 +02:00
Brian Clozel 7be3a61a14 ResponseStatusException should not override custom reason
Prior to this commit, `ResponseStatusException` would resolve the
"detail" part of a problem detail response from message codes only
(default or custom ones). If the `reason` given as an argument to the
exception was a custom message, it would be overwritten in the process.

This commit ensures that we use custom reason messages when they don't
resolve as message codes.

Fixes gh-36984
2026-09-22 16:56:40 +02:00
Sam Brannen 804e491eda Merge branch '7.0.x' 2026-09-21 17:25:43 +02:00
Sam Brannen edd497c20f Polish Javadoc and reference documentation for caching annotations
This commit documents the semantics for the `#result` SpEL expression
variable for a method that returns a Flux for @⁠Cacheable and
@⁠CachePut, both of which have always collected such a Flux's values
into a List. For such a method, `#result` refers to that List rather
than the Flux itself.

This commit addresses a number of unrelated inconsistencies in the
documentation as well.

See gh-37309
2026-09-21 17:16:43 +02:00
Sam Brannen 26de340102 Stop truncating Flux results to first element with @⁠CacheEvict
Prior to this commit, ReactiveCachingHandler.processCacheEvicts()
adapted every reactive return value via Mono.from(), which subscribes
for only the first element and cancels the upstream Publisher. For a
@⁠CacheEvict method that returns a Flux, this silently truncated the
returned sequence to its first element. In addition, the `#result`
variable in `condition` SpEL expressions was bound to only that first
emitted element.

To address that, this commit mirrors the existing multi-value handling
in processPutRequest(). When the adapter reports isMultiValue(), a side
Subscriber is subscribed via publish().refCount(2) that exhausts the
Flux and collects its values into a List for eviction, while the
original, unmodified Flux is returned to the caller. Consequently, the
`#result` variable in `condition` SpEL expressions for a Flux-returning
@⁠CacheEvict method is now the full List of emitted elements rather
than just the first element, making it consistent with @⁠Cacheable and
@⁠CachePut.

This commit also improves spr14235AdaptsToReactorFlux() in
CacheReproTests. Previously it exercised @⁠CacheEvict only with a
single-element Flux and never asserted on the returned sequence. Now it
uses a multi-element Flux and verifies that all elements are both
returned to the caller and visible to the `condition` expression.

Last but not least, this commit documents the aforementioned
`#result`/Flux semantics in @⁠CacheEvict's Javadoc and in the reference
manual, since both were previously invalid or incomplete for this
scenario.

Closes gh-37309
2026-09-21 17:16:34 +02:00
Yanming Zhou 6e5efdc89b Set first batch args once while executing batch with generated keys
`batchArgs[0]` in `NamedParameterJdbcTemplate` and `indexedBatch[0]` in
`DefaultJdbcClient` are already set by
`pscf::newPreparedStatementCreator`, so it is unnecessary to set them
again via `BatchPreparedStatementSetter::setValues`.

Closes gh-37308

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-09-21 14:58:52 +02:00
Sam Brannen 5772133ba7 Polishing 2026-09-21 14:45:27 +02:00
Yanming Zhou f12a47acc9 Add tests for querying SqlRowSet using JdbcClient
And polish JdbcClientQueryTests a bit.

Closes gh-37313

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-09-21 14:42:45 +02:00
Brian Clozel 0a80de753d Switch to released versions 2026-09-21 12:55:03 +02:00
Brian Clozel b3951be094 Switch to INTERNAL-SNAPSHOT versions 2026-09-21 09:17:37 +02:00
Brian Clozel 81c662ebd0 Switch to 7.1.0-INTERNAL-SNAPSHOT 2026-09-21 09:17:37 +02:00
Sam Brannen 8a742e4b48 Merge branch '7.0.x' 2026-09-20 16:34:37 +02:00
이태경 9637d12785 Fix target-class counter assertions in AOP tests
Both target-class tests asserted the target-interface counter,
leaving the intended pointcut unchecked. Assert the target-class
counter in both the XML and @⁠AspectJ variants.

Closes gh-37310

Signed-off-by: itaekyung <taeyun1411@gmail.com>
2026-09-20 16:34:09 +02:00
Sam Brannen 82dd9480f2 Merge branch '7.0.x' 2026-09-20 14:58:32 +02:00
Tran Ngoc Nhan a8608e681b Remove redundant whitespace in exception messages
Closes gh-37277

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-09-20 14:58:09 +02:00
Sam Brannen c116f3bb26 Merge branch '7.0.x' 2026-09-19 19:42:02 +02:00
Sam Brannen 48b59dfaec Polish contribution
See gh-37305
2026-09-19 19:39:48 +02:00
Sam Brannen f8cdd80a71 Merge branch '7.0.x' 2026-09-19 19:37:25 +02:00
Tran Ngoc Nhan b5454b1a69 Add closing braces to examples
Closes gh-37305

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-09-19 19:36:24 +02:00
Sam Brannen 495f8b3f6c Polishing 2026-09-19 19:32:08 +02:00
Brian Clozel b6d7f1d586 Avoid duplicate date-related converters registration
Prior to this commit, `DefaultFormattingConversionService` would
register converters with both `DateTimeFormatterRegistrar` and
`DateFormatterRegistrar`, the former also registering the legace date
converters that the latter contributes.

While we cannot change the behavior for `DateTimeFormatterRegistrar` or
`DateFormatterRegistrar` because of their public contract, we can update
the `DefaultFormattingConversionService` to not use
`DateFormatterRegistrar` and register manually the annotation support
that it contributes.

Closes gh-36951
2026-09-19 12:12:10 +02:00
Juergen Hoeller b9fa062918 Merge branch '7.0.x' 2026-09-18 21:00:53 +02:00
Juergen Hoeller 83ecf67455 Match manifest-specified jar names with pre-encoded escape sequence
Closes gh-37280
2026-09-18 20:58:46 +02:00
Juergen Hoeller 2a15cd498a Invert findColumn fallback to try common underscore naming first
Closes gh-37297
2026-09-18 20:58:37 +02:00
Yanming Zhou 94e6e0ce68 Add batch update support to JdbcClient
Introduce a fluent batch() operation on JdbcClient.StatementSpec that
accumulates several sets of parameters - bound as positional or named
parameters in the same fashion as a single update, separated by add() -
and executes them as a single JDBC batch through update(). Batch updates
previously required dropping down to (NamedParameter)JdbcTemplate.

Closes gh-37216
Co-authored-by: Jiří Krokviak <j.krokviak@gmail.com>
Signed-off-by: Jiří Krokviak <j.krokviak@gmail.com>
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-09-18 20:27:24 +02:00
Brian Clozel 2e6e620ee1 Merge branch '7.0.x' 2026-09-18 17:30:55 +02:00
Sagar Chanchal cb9ce4d9e2 Fix out-of-bounds read for truncated percent-escape in opaque host
The opaque-host percent-escape validation guard reads
input.codePointAt(i + 2) after only checking 'input.length() - i < 2',
so an input such as 'foo://%4' throws StringIndexOutOfBoundsException
instead of reporting a validation error.

Fix the bounds guard to require two code points after '%' and check
ASCII hex digits rather than ASCII digits, matching the URL spec, where
invalid percent-escapes in opaque hosts are validation errors, not
failures.

Signed-off-by: Sagar Chanchal <Sagarr2112@gmail.com>
2026-09-18 17:26:03 +02:00