Compare commits

...

3046 Commits

Author SHA1 Message Date
Sam Brannen 2b08e6e1d3 Merge branch '7.0.x' 2026-06-08 18:29:20 +02:00
Sam Brannen 2c18c33ce0 Track operations during SpEL expression evaluation
This commit introduces support for tracking operations during SpEL
expression evaluation. If the maximum number of operations is exceeded,
a SpelEvaluationException is thrown.

The limit can be configured either on a per-use-case basis via
SpelParserConfiguration supplied to the SpelExpressionParser or
globally as a JVM system property or Spring property named
`spring.expression.maxOperations`.

Closes gh-36801
2026-06-08 15:13:44 +02:00
Sam Brannen 83667f808c Ensure getters have non-void return types in SpEL
Closes gh-36800
2026-06-08 15:13:44 +02:00
Sam Brannen 7a8917b137 Improve additional error messages in SpEL
This commit picks up where 987d6cca6d left off.

See gh-36756
2026-06-08 15:13:44 +02:00
Sam Brannen 7baa86536f Further improve pattern caching in SpEL
See gh-36755
2026-06-08 15:13:44 +02:00
Sam Brannen 12b44f2545 Avoid too many character access attempts in AntPathMatcher
Closes gh-36799
2026-06-08 15:13:44 +02:00
Sébastien Deleuze e8f10244e3 Ensure consistent JSP tag attribute processing
Closes gh-36797
2026-06-08 15:13:44 +02:00
Sébastien Deleuze a1826b725c Refine JavaScriptUtils#javaScriptEscape
Closes gh-36795
2026-06-08 15:13:43 +02:00
Sébastien Deleuze 7add5243b9 Prevent special prefixes in default view name resolution
This commit updates the default view name generation logic in
both Spring WebMVC and Spring WebFlux to prevent "redirect:"
and "forward:" (for MVC) prefixes from the incoming request path.

Closes gh-36793
2026-06-08 15:13:43 +02:00
Sébastien Deleuze 9bec52b1ec Add trusted packages to MappingJackson2MessageConverter
This commit introduces trusted packages, specified via the related
setter for untrusted use cases. It allows explicit configuration
of which Java packages are allowed to be deserialized.

Closes gh-36791
2026-06-08 15:13:43 +02:00
Sébastien Deleuze fe68e337b2 Add trusted packages to JacksonJsonMessageConverter
This commit introduces trusted packages, specified via the related
setter for untrusted use cases. It allows explicit configuration
of which Java packages are allowed to be deserialized.

See gh-36791
2026-06-08 15:13:43 +02:00
rstoyanchev 322eef2942 RfcParser rejects invalid IPv6 host
Fix gh-36787
2026-06-08 15:13:43 +02:00
Brian Clozel 4e39c28b92 Merge branch '7.0.x' 2026-06-08 14:49:45 +02:00
Brian Clozel ba0a9b8923 Upgrade to Reactor 2025.0.6
Closes gh-36884
2026-06-08 14:49:19 +02:00
Brian Clozel 381fa10477 Merge branch '7.0.x' 2026-06-08 10:41:12 +02:00
Brian Clozel 8a192eab1f Upgrade to Micrometer 1.16.6
Closes gh-36883
2026-06-08 10:40:01 +02:00
rstoyanchev 14f4deef3a Merge branch '7.0.x' 2026-06-05 14:36:23 +01:00
rstoyanchev 45812cb9d0 Prefer Jackson XML codecs when present
Closes gh-36776
2026-06-05 14:36:05 +01:00
rstoyanchev 95bd3f7c67 Exclude Jackson XML from String encoding/decoding
Closes gh-36775
2026-06-05 14:36:05 +01:00
Sam Brannen e23971efb9 Merge branch '7.0.x' 2026-06-05 15:15:19 +02:00
Sam Brannen 6ca66afc7b Polish contribution
See gh-36871
2026-06-05 15:13:25 +02:00
zhaomeng 1b32d8d41d Include zone ID in CronTrigger's equals() and hashCode() implementations
CronTrigger carries an optional ZoneId since 5.3 that affects
nextExecution; however, prior to this commit, equals() and hashCode()
only considered the cron expression.

This commit ensures that CronTrigger instances with the same cron
expression but different time zones are no longer considered equal.

Closes gh-36871

Signed-off-by: zhaomeng <zhaomeng1.vendor@sensetime.com>
2026-06-05 15:09:14 +02:00
Sam Brannen 2469aae672 Merge branch '7.0.x' 2026-06-05 14:57:29 +02:00
Sam Brannen b4a378186f Fix additional links to Selenium documentation
See gh-36875
2026-06-05 14:56:51 +02:00
leestana01 220fcaa1e3 Fix broken links to Selenium documentation
The links to docs.seleniumhq.org no longer resolve, since the host was
retired.

This commit changes those links to use the current Selenium
documentation at selenium.dev.

Closes gh-36875

Signed-off-by: leestana01 <leestana01@naver.com>
2026-06-05 14:52:15 +02:00
cookie-meringue 83e29382b3 Optimize ClassNameReader.getClassName via direct ASM API
getClassName now calls ClassReader.getClassName() directly instead
of routing through the visitor-based getClassInfo. Previously, it
allocated a List and a ClassVisitor and decoded super_class and
every interface name only to discard all but the first element.

The method is on the hot path of every CGLIB proxy class definition,
so this change significantly lowers its per-call processing cost.

Closes gh-36814

Signed-off-by: cookie-meringue <daehyeon3351@gmail.com>
2026-06-04 14:20:49 +02:00
Brian Clozel ee5c82a2f8 Merge branch '7.0.x' 2026-06-04 12:27:18 +02:00
Brian Clozel 80534f9df6 Polishing contribution
This commit adds further fixes in the same area, since there were
similar bugs in the WriteCompletionHandler:
* databuffers were not always emitted when fully read in the onNext hook
* on completion, the iterator was closed too early, before it was fully
  read
* on completion, writing the next bytebuffers from the iterator would
  always reuse the first one and not update the attachment

Closes gh-36714
2026-06-04 12:18:01 +02:00
KimDaehyeon d8bc54d2e7 Fix data loss in DataBufferUtils synchronous write
Prior to this commit, WritableByteChannelSubscriber.hookOnNext() called
iterator.next() exactly once. If a DataBuffer consisted of multiple NIO
ByteBuffers (e.g., NettyDataBuffer wrapping a CompositeByteBuf), only
the first buffer was written to the channel, and the remaining buffers
were silently ignored and lost.

This commit adds the missing while (iterator.hasNext()) outer loop to
ensure all fragmented buffers exposed by the iterator are completely
and safely written to the synchronous channel.

See gh-36714

Signed-off-by: KimDaehyeon <daehyeon3351@gmail.com>
2026-06-04 12:17:57 +02:00
rstoyanchev ae7891e797 Revise disconnected client error handling in WebFlux
A disconnected client error does not necessarily prevent us from setting
the status of the WebFlux ServerHttpResponse, which is only gated by a
committed flag and does not necessarily reflect the connection state.

This is why we need to check if we have a disconnected client error
first and handle it accordingly. We still set the response to 500
in case the disconnect client error is to a remote host in which
case it will propagate to the client.

Closes gh-36811
2026-06-04 11:10:58 +01:00
rstoyanchev 98ed1dfcf8 Revise disconnected client error handling in Spring MVC
DisconnectedClientHelper identifies lost connection issues, but it's
not always easy to know if it is the connection to the client or to
another remote host. DisconnectedClientHelper does recognize and
filter out common client exceptions, but there is a possibility for
other similar custom exceptions.

DefaultHandlerExceptionResolver now attempts to set the status to
500, which won't impact a client that has gone away, but it will
set the status correct on the off chance that the exception is
actually a server side issue.

Closes gh-34481
2026-06-04 11:10:58 +01:00
Brian Clozel 9b8a851969 Merge branch '7.0.x' 2026-06-04 10:49:36 +02:00
Brian Clozel 6467fca05b Polishing contribution
This fixes a potential regression introduced by the previous commit.
Because the current value was not updated after the temporal was rolled
forward, there were new cases where entire days would be skipped.

Closes gh-36865
2026-06-04 10:22:23 +02:00
arno cddc671a8c Fix CronExpression day skip on midnight DST gap
After rollForward, BitsCronField always searched for the next
matching bit from zero. When daylight saving creates a gap at
the start of a period (e.g. Africa/Cairo), the temporal lands on
a non-zero field value and matching from zero could advance an
entire period too far, skipping the calendar day.

Search from the actual field value in the new period instead,
falling back to zero only when no bit matches in that period.

See gh-36865

Signed-off-by: arno <me@zmovo.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-06-04 10:22:17 +02:00
seungchan 4c6194a2ad Simplify BUFFER_COUNT in ConcurrentLruCache to a constant
The detectNumberOfBuffers() method attempted to scale the read
buffer count based on the number of available processors, but used
Math.min(4, nextPowerOfTwo) which effectively caps the result at 4
regardless of CPU count. For systems with fewer than 3 processors,
the buffer count would be reduced below 4, but this edge case adds
complexity without measurable benefit.

Simplify BUFFER_COUNT to a constant value of 4, removing the
unnecessary CPU-detection logic.

Closes gh-36872

Signed-off-by: seungchan <s24041@gsm.hs.kr>
2026-06-04 09:30:36 +02:00
Juergen Hoeller 2fc99eb12f Merge branch '7.0.x' 2026-06-03 23:04:51 +02:00
Juergen Hoeller 2e653246b5 Fix concurrency issue against shared cookie field in setLocaleContext
Closes gh-36869
2026-06-03 23:03:39 +02:00
Brian Clozel 783388e9f8 Merge branch '7.0.x' 2026-06-03 11:23:03 +02:00
Brian Clozel 86a68a77c4 Support multi-line comments in Server Sent Events
Prior to this commit, comments sent with Server Sent Events could break
the wire format when sent over the network when comments contained line
breaks.
While comments are mainly used for sending keepalive messages, they can
also be used for sending debug data. This commit ensures that line
breaks are properly handled in comments.

Fixes gh-36866
2026-06-03 11:13:32 +02:00
Juergen Hoeller de4de02a1d Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-context/src/main/java/org/springframework/validation/DataBinder.java
2026-06-02 17:33:07 +02:00
Juergen Hoeller fe27ad24d5 Upgrade to Netty 4.2.15 and Hibernate ORM 7.2.17 2026-06-02 17:30:17 +02:00
Juergen Hoeller ecc847c493 Fix applicability note on setAutoGrowCollectionLimit
Closes gh-36863
2026-06-02 17:28:33 +02:00
Juergen Hoeller e6ce2a3c36 Expose autoGrowCollectionLimit in ConfigurablePropertyAccessor interface
See gh-36862
2026-06-02 17:20:52 +02:00
Matthias Kurz 481a5743b3 Apply auto-grow limit to direct field binding
DataBinder applies its auto-grow collection limit to bean
property access, but direct field access left DirectFieldAccessor
at its default limit.

Pass DataBinder's configured limit into DirectFieldBindingResult
and apply it to the DirectFieldAccessor.

Closes gh-36861

Signed-off-by: Matthias Kurz <m.kurz@irregular.at>
2026-06-02 16:58:47 +02:00
wushiyuanmaimob 85a8868bae Preserve generic type info in awaitEntity()
awaitEntity() used T::class.java which erases generic type
information (e.g. List<Foo> becomes just List). Use the
reified toEntity<T>() extension instead, which preserves
full generic type via ParameterizedTypeReference.

Closes gh-36834
Signed-off-by: wushiyuanmaimob <wushiyuanwork@outlook.com>
2026-06-02 12:26:41 +02:00
rstoyanchev dd72b9eb4b Merge branch '7.0.x' 2026-06-01 10:53:55 +01:00
daguimu c2191e3ce2 Fix fragment parsing for relative URI in RfcUriParser
When parsing a relative URI such as `path2#foo`, RfcUriParser's
SCHEME_OR_PATH state advanced to FRAGMENT without moving the component
index past the `#` character, so the captured fragment included the
entire input (`path2#foo`) instead of just `foo`. As a result,
`toUriString()` produced `path2#path2#foo`.

Update the SCHEME_OR_PATH `#` transition to advance the component
index to `i + 1`, matching the sibling `?` -> QUERY transition in the
same state and every other `-> FRAGMENT` transition in the parser.
URIs with a `/` in the path are unaffected because they leave
SCHEME_OR_PATH for PATH on the first slash; the WhatWG parser already
handled this case correctly.

Closes gh-36762

Signed-off-by: daguimu <daguimu.geek@gmail.com>
2026-06-01 10:52:37 +01:00
Juergen Hoeller 2e65c1dfe6 Merge branch '7.0.x' 2026-05-29 13:31:01 +02:00
Juergen Hoeller 175c1f9437 Runtime compatibility with JPA 4.0 M4
Closes gh-36784
2026-05-29 13:28:46 +02:00
Juergen Hoeller 0b77c3df45 Detect back-off exhaustion at invoker level as well
See gh-36809
2026-05-29 13:23:30 +02:00
Sam Brannen ca72cd66e3 Merge branch '7.0.x' 2026-05-28 10:59:38 +02:00
Sam Brannen 6985d00fce Update antora-extensions to 1.14.12
Closes gh-36851
2026-05-28 10:57:11 +02:00
Juergen Hoeller a3f3ba5685 Merge branch '7.0.x' 2026-05-27 18:59:32 +02:00
Juergen Hoeller 1e45ad8fa6 Restore back-off on listener setup failure
Supports exponential back-off as well now.

Closes gh-36809
2026-05-27 18:58:37 +02:00
rstoyanchev 79f4f76bd2 Merge branch '7.0.x' 2026-05-27 17:19:22 +01:00
rstoyanchev 6fd45c118d Polishing contribution
Closes gh-36650
2026-05-27 17:19:00 +01:00
Max Guiking f9b75b02da Fix last flag check in JettyWebSocketSession
See gh-36650

Signed-off-by: Max Guiking <mguiking@een.com>
2026-05-27 17:19:00 +01:00
Patrick Strawderman 84efa46e09 DefaultPathContainer uses immutable map for SEPARATORS
Closes gh-36821

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2026-05-27 17:18:59 +01:00
shenjianeng b3dfba8719 Refactor map initialization using CollectionUtils
Closes gh-36763

Signed-off-by: shenjianeng <ishenjianeng@qq.com>
2026-05-27 17:17:02 +01:00
Juergen Hoeller 744d136cf7 Upgrade to Hibernate ORM 7.4
Closes gh-36519
2026-05-27 16:44:26 +02:00
Juergen Hoeller 00ca23859e Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-05-27 16:35:51 +02:00
Juergen Hoeller 2782a2701c Upgrade to Netty 4.2.14 and Hibernate ORM 7.2.16 2026-05-27 16:33:15 +02:00
Juergen Hoeller af2b96192d Force initialization of configuration class in mainline thread
Closes gh-36844
2026-05-27 16:32:37 +02:00
Juergen Hoeller 121c0ac285 Remove scanned class only when conflicting with imported class
Closes gh-36835
2026-05-27 16:31:13 +02:00
Juergen Hoeller 3e585830d7 Fix MethodParameter nestingLevel documentation
Closes gh-36826
2026-05-27 16:29:51 +02:00
Sam Brannen facc7c5371 Merge branch '7.0.x' 2026-05-27 12:16:46 +02:00
Sam Brannen b95caa8331 Upgrade Antora dependencies 2026-05-27 12:15:25 +02:00
Sam Brannen bd1e7e16a9 Merge branch '7.0.x' 2026-05-27 12:05:04 +02:00
Sam Brannen c17939ed5c Polish contribution
See gh-36831
2026-05-27 12:02:50 +02:00
Dennis-Mircea Ciupitu f3bfe27445 Document @⁠Conditional gating of nested @⁠Configuration classes
Closes gh-36831

Signed-off-by: Dennis-Mircea Ciupitu <dennis.mircea.ciupitu@gmail.com>
2026-05-27 12:02:50 +02:00
Sam Brannen 7651d5841f Pin Node.js version to 24.15.0
Prior to this commit, the `antora` Gradle task silently failed to build
the reference documentation, since Antora uses the latest LTS release
for Node.js by default, and the latest LTS apparently does not work for
us.
2026-05-27 12:01:09 +02:00
Brian Clozel 25e8395df8 Reject duplicate MIME type parameters
Prior to this commit, MIME type parsing in Spring would allow duplicate
parameters like "text/plain; dupe=1; dupe=2", effectively retaining the
latest value and ignoring the first.

RFC 6838 4.3 states that this should be treated as an error and this
commit ensures that this is the case.

Closes gh-36841
2026-05-26 17:53:28 +02:00
Sam Brannen 148b7fd8f3 Merge branch '7.0.x' 2026-05-26 16:40:06 +02:00
Sam Brannen 6e122d3aaa Polish contribution
See gh-36833
2026-05-26 16:39:30 +02:00
seonwoo_jung f7be796c1c Expose ClassLoader from DefaultDeserializer
Add a public accessor for the ClassLoader configured on a
DefaultDeserializer instance so that callers no longer need to read the
private field via reflection in order to forward it to a
ConfigurableObjectInputStream subclass.

See gh-36827
Closes gh-36833

Signed-off-by: seonwoo_jung <laborlawseon@kap.kr>
2026-05-26 16:35:37 +02:00
Brian Clozel 68338aa818 Use ASCII chars in Content-Disposition filename parameter
Prior to this commit, gh-36328 avoided using RFC 2047 encoding for the
"filename" parameter and use ISO-8859-1 only. This change unfortunately
caused issues because some implementations might try and detect the
encoding automatically.

This commit restricts the filename parameter to ASCII encoding only by:
* transliterating characters to the closes ASCII character
("é"->"e", "ä"->"ae"...)
* falling back to "_" for other chacacters with non latin alphabet or
  emojis

Fixes gh-36805
2026-05-22 21:33:40 +02:00
Sam Brannen fbbc0f487c Use Constants API introduced in JUnit 6.1
See gh-36815
2026-05-21 12:48:37 +02:00
Sam Brannen 611c390417 Use EngineTestKit in ParallelExecutionSpringExtensionTests 2026-05-21 12:27:33 +02:00
Sam Brannen cf3196e8de Merge branch '7.0.x' 2026-05-20 17:49:42 +02:00
Sam Brannen 1e843fd3ec Polish contribution
See gh-36777
2026-05-20 17:45:24 +02:00
Kai Zander 4bb20ea8db Allow specifying charset to use in ExchangeFilterFunctions#basicAuthentication
Prior to this commit, it was not possible to specify the character set
to use with ExchangeFilterFunctions#basicAuthentication.

To address that, this commit introduces a new

Closes gh-36777

Signed-off-by: Kai Zander <61500114+kzander91@users.noreply.github.com>
2026-05-20 17:45:24 +02:00
Sam Brannen 80e9e4f6f2 Make ParallelExecutionSpringExtensionTests more robust
... due to changes in JUnit 6.1.0.

See gh-36815
2026-05-20 17:32:01 +02:00
Sam Brannen 91655be0db Merge branch '7.0.x' 2026-05-20 16:53:56 +02:00
dependabot[bot] ac24766510 Upgrade fast-xml-parser to 5.7.0
Closes gh-36691
2026-05-20 16:51:05 +02:00
Sam Brannen 3b030e0431 Upgrade to JUnit 6.1
Closes gh-36815
2026-05-20 16:34:26 +02:00
Sam Brannen 9870ce1844 Only update ObservationThreadLocalAccessor when test has an active ApplicationContext
Prior to this commit,
MicrometerObservationRegistryTestExecutionListener always attempted to
load the test's ApplicationContext in order to update the
ObservationThreadLocalAccessor in its beforeTestMethod() callback, even
if there was no active ApplicationContext.

To avoid unnecessarily loading an ApplicationContext or attempting to
load an ApplicationContext that cannot be loaded (for example, due to a
context-load failure), this commit applies a hasApplicationContext()
check in beforeTestMethod().

Since the MicrometerObservationRegistryTestExecutionListener is
registered after the DependencyInjectionTestExecutionListener (at least
by default), an active ApplicationContext should be present unless
dependency injection from the context failed or the context failed to
load.

Closes gh-36817
2026-05-20 14:52:20 +02:00
Sam Brannen d87c03a6be Reset mocks only when a test has an ApplicationContext
Prior to this commit and the previous commit,
MockitoResetTestExecutionListener always attempted to load the
ApplicationContext to reset mocks in its beforeTestMethod() and
afterTestMethod() callbacks, even if there was no active
ApplicationContext.

The reason this was noticed is that the @BeforeMethod(alwaysRun = true)
and @AfterMethod(alwaysRun = true) lifecycle methods in
AbstractTestNGSpringContextTests are always invoked, even if a previous
lifecycle configuration method failed (for example, due to a
context-load failure).

However, with JUnit Jupiter and the SpringExtension the
beforeTestMethod() and afterTestMethod() callbacks in the
TestExecutionListener API are not invoked if there was a previous
lifecycle failure.

Consequently, the reported drawbacks only exist when using Spring's
TestNG base support classes

This commit picks up where the previous commit left off by applying the
same hasApplicationContext() check in beforeTestMethod().

This commit also introduces unit and integration tests for both Jupiter
and TestNG support.

Closes gh-36782
2026-05-20 14:04:09 +02:00
seregamorph 1d91982f83 Reset mocks after test only when the test has an ApplicationContext
See gh-36782

Signed-off-by: seregamorph <serega.morph@gmail.com>
2026-05-20 14:03:55 +02:00
Sam Brannen 0c25d817bd Merge branch '7.0.x' 2026-05-17 15:33:24 +02:00
Sam Brannen d5e85bd95e Remove obsolete code 2026-05-17 15:30:04 +02:00
Sam Brannen 17ed3e8370 Merge branch '7.0.x' 2026-05-17 13:56:47 +02:00
Sam Brannen c3c96b9f32 Upgrade to Gradle 9.5.1
Closes gh-36744
2026-05-17 13:47:00 +02:00
rstoyanchev 2f458f9093 Merge branch '7.0.x' 2026-05-15 13:51:31 +01:00
rstoyanchev 4d98ff5dcf Polishing in data binding docs 2026-05-15 13:50:57 +01:00
rstoyanchev 16e0ed0463 Merge branch '7.0.x' 2026-05-14 16:56:21 +01:00
rstoyanchev 48262b8efe Further polishing in docs on web binding
See gh-36803
2026-05-14 16:55:53 +01:00
rstoyanchev e24448118c Merge branch '7.0.x' 2026-05-14 16:42:29 +01:00
rstoyanchev ca32ac5e7f Polishing in docs
See gh-36803
2026-05-14 16:41:59 +01:00
rstoyanchev 63ccc9d9cc Restructure web binding documentation and refine guidance
Closes gh-36803
2026-05-14 16:36:27 +01:00
Juergen Hoeller a0ec6656b4 Merge branch '7.0.x' 2026-05-13 19:46:39 +02:00
Juergen Hoeller 8fe1de4595 Polishing 2026-05-13 19:46:07 +02:00
Juergen Hoeller 5ab4c5c5d9 Add support for JPA 4.0 @PersistenceAgent injection
Closes gh-36264
2026-05-13 19:41:21 +02:00
Juergen Hoeller c3baa01535 Merge branch '7.0.x' 2026-05-12 16:21:43 +02:00
Juergen Hoeller c048074436 Restrict SpringVersion.getVersion() to "major.minor.patch" format
Closes gh-36785
2026-05-12 16:20:47 +02:00
Juergen Hoeller c0b749479a Merge branch '7.0.x' 2026-05-12 13:10:34 +02:00
Juergen Hoeller b7882d703c Expose package-info classes through PersistenceUnitInfo#getAllClassNames()
Closes gh-36784
2026-05-12 13:09:51 +02:00
Juergen Hoeller 5bf58cfe05 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-05-11 13:09:38 +02:00
Juergen Hoeller ca8a1ea375 Upgrade to Log4J 2.26, Groovy 5.0.6, Tomcat 11.0.22, Jetty 12.1.9, Hibernate ORM 7.2.14, Checkstyle 13.4.2 2026-05-11 13:08:34 +02:00
Vinod Kumar 238a24cb6d Polish collection usage in HttpHeadersTests
Signed-off-by: Vinod Kumar <codingkiddo@gmail.com>
2026-05-11 09:34:28 +02:00
Sam Brannen 9a54f75d6d Merge branch '7.0.x' 2026-05-09 16:40:53 +02:00
Yanming Zhou cfb8dc6cc8 Fix typos for validateExistingTransaction
Closes gh-36767

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-05-09 16:39:50 +02:00
Juergen Hoeller 9db16e4c15 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-05-08 16:02:00 +02:00
Juergen Hoeller 665c9ad7df Upgrade to Netty 4.2.13 and Hibernate ORM 7.2.13 2026-05-08 16:00:14 +02:00
Juergen Hoeller d3152c11c7 Consistently expose map key quotes
Closes gh-36765
2026-05-08 15:59:57 +02:00
Juergen Hoeller 856e1d5dc8 Avoid ResolvableType#forType contention for implicit cache cleanup
Closes gh-36745
2026-05-08 15:59:46 +02:00
Sam Brannen ec8f0ca6b2 Merge branch '7.0.x' 2026-05-06 13:54:03 +02:00
Sam Brannen 987d6cca6d Fix error message for invalid regex in SpEL
Closes gh-36756
2026-05-06 13:53:37 +02:00
Sam Brannen 1a0bd12c34 Merge branch '7.0.x' 2026-05-06 13:26:10 +02:00
shenjianeng ec21dc0f91 Refactor regex pattern caching using computeIfAbsent
Closes gh-36755

Signed-off-by: shenjianeng <ishenjianeng@qq.com>
2026-05-06 13:25:07 +02:00
Brian Clozel e6590aa1a8 Merge branch '7.0.x'
Closes gh-36753
2026-05-05 11:59:37 +02:00
Brian Clozel 628261d5bb Do not warn against Root Servlet context location
Closes gh-36692
2026-05-05 11:50:28 +02:00
Sam Brannen 051b09694e Merge branch '7.0.x' 2026-05-04 17:21:22 +02:00
Kai Zander 715d33f001 Remove control character from log message in TransportHandlingSockJsService
Closes gh-36731

Signed-off-by: Kai Zander <61500114+kzander91@users.noreply.github.com>
2026-05-04 17:20:20 +02:00
Sam Brannen 39ff8e46ab Use String#replace instead of String#replaceAll in tests
See gh-36678
2026-05-03 14:36:23 +02:00
shenjianeng 27bdf24482 Use String#replace instead of String#replaceAll where appropriate
Avoid using String#replaceAll when the pattern is not a regular
expression.

Using java.lang.String#replace(CharSequence, CharSequence) will
improve performance.

Closes gh-36678

Signed-off-by: shenjianeng <ishenjianeng@qq.com>
2026-05-03 14:34:01 +02:00
Sam Brannen d9ecf945cc Merge branch '7.0.x' 2026-05-02 18:39:59 +02:00
Sam Brannen bb5142164e Upgrade to Gradle 9.5
Closes gh-36744
2026-05-02 18:38:09 +02:00
Sam Brannen b35da5b140 Merge branch '7.0.x' 2026-05-02 18:35:24 +02:00
박건영(Parkgunyoung) 25b8d64cd0 Fix typo in HttpServiceProxyFactory example
Closes gh-36736

Signed-off-by: 박건영(Parkgunyoung) <parkky3563@gmail.com>
2026-05-02 18:34:00 +02:00
rstoyanchev 367a62018d Merge branch '7.0.x' 2026-05-01 21:48:29 +01:00
rstoyanchev d72da90d3a Avoid race in InMemoryWebSession
Closes gh-36742
2026-05-01 21:47:37 +01:00
rstoyanchev bff9899905 Switch to JdkIdGenerator in AbstractWebSocketSession
Closes gh-36740
2026-05-01 21:47:26 +01:00
Brian Clozel 41cd6879bd Fix parsing failure for MIME types with quoted pairs
Prior to this commit, MIME types with parameter values that contain a
quoted pair would sometimes fail and parse an incomplete parameter
value.

This commit ensures that the quoted section of the parameter value is
correctly handled.

Fixes gh-36730
2026-05-01 21:47:16 +01:00
Brian Clozel 3a91d90c28 Resolve URL path for versioned webjar directories
Prior to this commit, the `resolveUrlPath` implementation for the
`LiteWebJarsResourceResolver` would always delegate to the resource
chain once the versioned webjar folder has been resolved.

While this aligns with the `ResourceResolver` contract and the fact that
the resource chain does not resolve directories, here the WebJar locator
does support such use cases and we shouldn't get in the way here.

This commit falls back to the resolved versioned WebJar path if no
resource could be resolved and the path ends with "/".

Fixes gh-36726
2026-05-01 21:47:06 +01:00
Juergen Hoeller 1b26f5d1e6 Adapt bean overriding test for deferred BeanRegistrar processing in 7.1
See gh-36648
See gh-21497
2026-04-30 14:33:55 +02:00
Juergen Hoeller 6ff2d187cf Merge branch '7.0.x'
# Conflicts:
#	spring-context/src/test/java/org/springframework/context/support/GenericApplicationContextTests.java
2026-04-30 14:21:49 +02:00
Juergen Hoeller 08c5280843 Consistent wrapping of BeanCreationExceptions from instance suppliers
Includes tests for circular references and bean definition overrides.

Closes gh-36725
See gh-36648
2026-04-30 14:19:25 +02:00
Juergen Hoeller 72cf389754 Merge branch '7.0.x' 2026-04-29 21:53:07 +02:00
Juergen Hoeller cd5fee5347 Polishing 2026-04-29 21:52:10 +02:00
Juergen Hoeller 916cb64581 Detect custom deserialized NullValue instances
Closes gh-36727
2026-04-29 21:52:04 +02:00
rstoyanchev 3184eb3acc Merge branch '7.0.x' 2026-04-29 12:12:31 +01:00
rstoyanchev b3ef834ae6 Reliably detect broadcast messages
Closes gh-36662
2026-04-29 12:11:16 +01:00
rstoyanchev a9d344b3ed TransportHandlingSockJsService checks remoteAddress
Closes gh-36681
2026-04-29 12:11:16 +01:00
cuitianhao 39a746d30f Set host header consistently in STOMP relay CONNECT frames
StompBrokerRelayMessageHandler only set the host header in CONNECT
frames when virtualHost was explicitly configured. Per STOMP 1.2, the
host header is required on CONNECT frames.

Fall back to relayHost (the TCP connection target) when virtualHost is
not configured, ensuring the host header is always present in both
system session and client session CONNECT frames.

Closes gh-36673

Signed-off-by: cuitianhao <54015884+tianhaocui@users.noreply.github.com>
2026-04-29 12:11:16 +01:00
Brian Clozel 9e4c127eda Merge branch '7.0.x' 2026-04-28 23:36:56 +02:00
Brian Clozel 952198b2ee Fix PartGenerator token request while creating tmp file
Prior to this commit, the `PartGenerator` would allow requesting
additional part tokens while in the `CreateFileState`. This is invalid
as any new token emitted would be rejected and would fail the entire
process.
This would only happen if the tmp file creation is slow enough for a new
token to be parsed and emitted.

This commit ensures that no new part token is requested while creating
the temporary file.
This change also fixes lifecycle issues and ensures that buffer
resources are cleaned in case of errors.

Fixes gh-36694
2026-04-28 23:21:05 +02:00
Sébastien Deleuze 1f642b973b Merge branch '7.0.x' 2026-04-28 11:16:42 +02:00
Dmitry Sulman 8d93670430 Support Micrometer context propagation in Kotlin Flow
See gh-36427
Closes gh-36667
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2026-04-28 11:10:55 +02:00
Sébastien Deleuze 29a7402adf Fix WebClient context propagation in Kotlin Coroutines
Prior to this commit, thread-local variables like Trace ID were not
automatically propagated into the Reactor Context when making requests
using Kotlin coroutine WebClient extensions like `awaitExchange`.

This commit updates `CoroutineContext.toReactorContext()` to capture
thread-local values via Micrometer Context Propagation when available,
ensuring observations and traces are properly reused.

Closes gh-36182
2026-04-28 11:10:55 +02:00
Sigurd Gerke 3dfd6838c0 Fix a regression on value class parameter handling
This commit fixes a regression introduced by gh-36449 for
nullable value class with an non-null value.

Closes gh-36665
Signed-off-by: Sigurd Gerke <sigurd.gerke@onedata.de>
2026-04-28 11:10:55 +02:00
Brian Clozel 80c9efd638 Merge branch '7.0.x' 2026-04-28 09:29:26 +02:00
Brian Clozel 32170e5847 Avoid cache collisions in CachingResourceResolver
Prior to this commit, there could be cache collisions in the
`CachingResourceResolver` because the cache key generation was
incomplete. This commit expands the cache key generation to avoid such
cases.

Fixes gh-36713
2026-04-28 09:28:00 +02:00
Sam Brannen 0e1a2b4f87 Merge branch '7.0.x' 2026-04-27 14:01:51 +03:00
Yanming Zhou bfb88cfc1c Remove unnecessary invocations of toString()
Closes gh-36709

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-04-27 11:27:29 +03:00
Yanming Zhou c4dfb24116 Update copyright headers in remaining source files
Closes gh-36703

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-04-27 11:26:35 +03:00
Brian Clozel 5e6e223686 Merge branch '7.0.x' 2026-04-23 16:24:27 +02:00
Brian Clozel 4fb0244b5a Enfoce single version removal in content versioning
Prior to this commit, content based version strategies would remove all
instances of the version string in the request path when trying to
resolve the original resource with the chain.
This can cause issues in rare cases where there is a collision between
the content version and some other version string in the request path.

Because this strategy is based on the contents of the file itself, we
should only remove the last instance of the version string and then
attempt to resolve the original file.

Fixes gh-36698
2026-04-23 15:04:02 +02:00
Brian Clozel 7a5844f1ce Reject unsafe resource handling locations
As of gh-36692, Spring logs a WARN message when an unsafe resource
handling location is configured. This change now rejects entirely such
setups by failing before the application starts up.

Closes gh-36695
2026-04-23 11:29:47 +02:00
Brian Clozel 0d14aa5856 Merge branch '7.0.x' 2026-04-23 10:55:18 +02:00
Brian Clozel 0725bf4941 Warn against unsafe static resource locations
Prior to this commit, `ResourceHandlerUtils` would perform resource
location checks to ensure that the configured location is valid. This
commit also ensures that we log a WARN message if the application
chooses a well-known unsafe location like "classpath:" or the root
Servlet context for serving static resources.

Closes gh-36692
2026-04-23 10:45:15 +02:00
Juergen Hoeller c6096ff6e5 Upgrade to Hibernate ORM 7.3.2 and Woodstox 7.1.1 2026-04-21 20:37:08 +02:00
Juergen Hoeller 6ff758391c Merge branch '7.0.x' 2026-04-21 20:36:27 +02:00
Juergen Hoeller 8965d9bccf Polishing 2026-04-21 20:35:25 +02:00
Juergen Hoeller af7a5716e8 Consistently ignore exceptions for Xerces-specific properties
Closes gh-36682
2026-04-21 20:34:29 +02:00
Brian Clozel ca9b26eb8f Merge branch '7.0.x' 2026-04-21 18:52:41 +02:00
Brian Clozel 83e7aa1131 Update HttpComponents Javadoc URI
Fixes gh-36685
2026-04-21 18:51:58 +02:00
Brian Clozel 279409acce Merge branch '7.0.x' 2026-04-21 17:47:25 +02:00
박동윤 (Park Dong-Yun) 865cf3c117 Avoid redundant URI object creation in WebClientUtils
Prior to this commit, WebClientUtils.getRequestDescription()
created a new URI object on every invocation. Since the URI
constructor includes validation and parsing, which is already
performed by the parameter URI object, this was unnecessarily
expensive for a logging utility.

This commit reuses the original URI's string representation
to avoid redundant parsing.
This commit also strips userInfo, query, and fragment from the
log description even if URIs contain only userInfo or
fragment (without a query).

Closes gh-36641

Signed-off-by: 박동윤 (Park Dong-Yun) <ehddbs7458@gmail.com>
2026-04-21 16:52:33 +02:00
Sam Brannen 4f1b4b36bf Merge branch '7.0.x' 2026-04-17 17:25:53 +02:00
Stéphane Nicoll be70e1c5a7 Next development version (v7.0.8-SNAPSHOT) 2026-04-17 08:33:14 +02:00
Juergen Hoeller 680f4ee482 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-04-16 23:30:21 +02:00
Juergen Hoeller 91852546d9 Upgrade to Reactor 2025.0.5 and Micrometer 1.16.5
Includes Hibernate ORM 7.2.11

Closes gh-36658
Closes gh-36659
2026-04-16 23:28:46 +02:00
Juergen Hoeller 802fa4d65e Refine RetryListener example
See gh-36452
2026-04-16 23:27:59 +02:00
rstoyanchev 59cd577fd1 Merge branch '7.0.x' 2026-04-16 21:15:42 +01:00
rstoyanchev 7052da4532 Add doOnDiscard in MultipartHttpMessageReader
Closes gh-36563
2026-04-16 21:15:09 +01:00
Sébastien Deleuze 9f92183710 Upgrade to Kotlin Serialization 1.11.0
Closes gh-36657
2026-04-16 16:36:56 +02:00
Sam Brannen 680854d1f3 Merge branch '7.0.x' 2026-04-16 16:35:25 +02:00
Sam Brannen 63817ce202 Add missing tests for WebRequestDataBinder
See gh-36625
2026-04-16 16:33:43 +02:00
Sam Brannen 61bd79017f Polish WebRequestDataBinderTests 2026-04-16 16:31:57 +02:00
Sam Brannen 1a7161c85e Merge branch '7.0.x' 2026-04-16 15:12:44 +02:00
Sam Brannen ab6637c670 Completely extract ServletRequestParameterPropertyValuesTests
This aligns with changes to ServletRequestParameterPropertyValuesTests
on 6.2.x.
2026-04-16 15:11:39 +02:00
Sam Brannen 8bce51267a Merge branch '7.0.x' 2026-04-16 14:42:00 +02:00
Sam Brannen c9b88b4ebd Extract ServletRequestParameterPropertyValuesTests 2026-04-16 14:38:17 +02:00
Sam Brannen 68c575ab14 Revise "Skip binding entirely when field is not allowed"
This commit reverts the changes made to WebDataBinder's doBind()
implementation in e4d03f6625 and instead implements the skipping logic
directly in checkFieldDefaults(), checkFieldMarkers(), and
adaptEmptyArrayIndices() by preemptively checking if the corresponding
field is allowed.

This commit also improves the Javadoc and adds missing tests.

Fixes gh-36625
2026-04-16 14:33:50 +02:00
Sam Brannen d169eb547e Polishing 2026-04-15 14:30:03 +02:00
Sam Brannen 9c8535f5e4 Compile SpEL expressions that use Optional with null-safe & Elvis operators
In Spring Framework 7.0, we introduced support for using `Optional`
with the null-safe and Elvis operators in SpEL expressions; however,
such expressions were previously not compilable.

To address that, this commit introduces a new
insertOptionalUnwrapIfNecessary() method in CodeFlow which effectively
inserts byte code instructions for `myOptional.orElse(null)`, and the
Elvis, Indexer, MethodReference, and PropertyOrFieldReference
implementations have been modified to track the need to unwrap an
`Optional` in compiled mode and delegate to
insertOptionalUnwrapIfNecessary() accordingly.

See gh-20433
See gh-36331
Closes gh-36330
2026-04-15 14:09:57 +02:00
Sam Brannen 829add3aa9 Update Javadoc for HttpMethod.valueOf() on main
See gh-36642
See gh-36652
2026-04-14 16:30:56 +02:00
Sam Brannen 20e57608ba Merge branch '7.0.x' 2026-04-14 16:18:23 +02:00
Sam Brannen cb320468db Further clarify semantics of HttpMethod.valueOf()
See gh-36652
2026-04-14 16:17:20 +02:00
angry2.k df828458fa Clarify semantics of HttpMethod.valueOf()
HttpMethod.valueOf() performs a case-sensitive lookup of predefined
HttpMethod constants. For example, valueOf("GET") resolves to
HttpMethod.GET, whereas valueOf("get") results in a newly created
HttpMethod instance.
Update the Javadoc to explicitly document this behavior.

See gh-36642
Closes gh-36652

Signed-off-by: angry-2k <edkev@kakao.com>
2026-04-14 16:15:43 +02:00
Sam Brannen 6275f46a66 Merge branch '7.0.x' 2026-04-13 17:42:59 +02:00
Sam Brannen ff3f2937ab Restructure SpelCompilationCoverageTests using @⁠Nested test classes 2026-04-13 17:42:18 +02:00
Sam Brannen 9a17b5c453 Merge branch '7.0.x' 2026-04-13 12:59:04 +02:00
Sam Brannen d7450ce8e4 Polish SpelCompilationCoverageTests 2026-04-13 12:58:36 +02:00
Sam Brannen 1787d3e885 Merge branch '7.0.x' 2026-04-12 17:17:27 +02:00
Sam Brannen 28f78f435e Introduce missing tests for immediate SpEL compilation for Elvis operator 2026-04-12 17:11:07 +02:00
Sam Brannen a3705632c1 Polish SpEL Ternary and Elvis operators 2026-04-12 17:09:28 +02:00
Sam Brannen 1f5af8f364 Merge branch '7.0.x' 2026-04-12 16:46:39 +02:00
Sam Brannen 84221064c8 Polish SpEl Ternary operator and compilation tests 2026-04-12 16:41:49 +02:00
Sam Brannen a4b33b98df Merge branch '7.0.x' 2026-04-12 14:29:42 +02:00
Sam Brannen 21f3b964fe Improve SpEL tests for Elvis and Ternary operators 2026-04-12 14:28:33 +02:00
Sam Brannen 59f9cf8645 Polish SpEL internals 2026-04-12 14:20:50 +02:00
Sébastien Deleuze fb34264169 Merge branch '7.0.x' 2026-04-10 16:10:45 +02:00
Sébastien Deleuze efb85d68ef Apply nullable value class fix to InvocableHandlerMethod
See gh-36449
2026-04-10 16:03:06 +02:00
T45K b3f01a7f92 Fix nullable value class handling in CoroutinesUtils
Closes gh-36449
Signed-off-by: T45K <tasktas9@gmail.com>
2026-04-10 16:03:06 +02:00
Sébastien Deleuze 22bcac1eb5 Refine Kotlin serialization contribution
This commit moves the JSON specific code to
KotlinSerializationJsonDecoder, uses switchOnFirst operator to keep the
existing behavior and derives the list serializer from the element one.

Closes gh-36597
2026-04-10 16:02:51 +02:00
Dmitry Sulman 546ae15a44 Support JSON list deserialization in KotlinSerializationStringDecoder
See gh-36597
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2026-04-10 16:02:51 +02:00
Sam Brannen c2cf5e065d Perform case-insensitive lookup in HttpMethod.valueOf()
Prior to this commit, the implementation of HttpMethod.valueOf()
aligned with the semantics of Enum#valueOf() which requires an exact
match for the enum constant name.

However, since HttpMethod is no longer an enum, that restriction is no
longer necessary. Consequently, this commit revises the implementation
of valueOf() to perform a case-insensitive lookup for predefined
constants.

In other words, HttpMethod.valueOf("GET") and HttpMethod.valueOf("get")
now both resolve to HttpMethod.GET.

Closes gh-36518
2026-04-10 15:04:42 +02:00
Sam Brannen e0e78257d6 Merge branch '7.0.x' 2026-04-09 13:07:19 +02:00
xxxxxxjun 78c32aa7d2 Fix typo in FormTag Javadoc and TLD
Closes gh-36610

Signed-off-by: xxxxxxjun <ryuu.public@gmail.com>
2026-04-09 13:06:31 +02:00
Sam Brannen 227ddf817d Merge branch '7.0.x' 2026-04-09 12:57:01 +02:00
Sam Brannen 99b78adce3 Revise documentation for @⁠ActiveProfiles and ActiveProfilesResolver
See gh-36269
See gh-36600
2026-04-09 12:52:18 +02:00
Sam Brannen 07aa952bed Merge branch '7.0.x' 2026-04-09 12:16:02 +02:00
Mohak-Nagaraju 644731c9f6 Document that spring.profiles.active is ignored by @⁠ActiveProfiles
The Spring TestContext Framework does not honor the
`spring.profiles.active` system property when determining
active profiles for a test class if @⁠ActiveProfiles is
used.

This commit documents that behavior in the @⁠ActiveProfiles
and DefaultActiveProfilesResolver Javadoc, as well as in
the reference manual. A SystemPropertyActiveProfilesResolver
example is also added showing how to allow
`spring.profiles.active` to override @⁠ActiveProfiles.

See gh-36269
Closes gh-36600

Signed-off-by: Mohak Nagaraju <98132980+Mohak-Nagaraju@users.noreply.github.com>
2026-04-09 12:15:33 +02:00
Brian Clozel 598f0b64f0 Merge branch '7.0.x' 2026-04-09 11:02:07 +02:00
Brian Clozel e4d03f6625 Skip binding entirely when field is not allowed
Prior to this commit, fields that are not allowed for binding were
always skipped and would not be bound. But the field and default marker
support (with the "_" and "!" prefixes) would be still considered and
could trigger collection instantiation/autogrow.

While this does not cause unwanted binding, this allocates memory for no
reason. This commit revisits the binding algorithm to only consider
default and field marker support if the regular field is allowed.

Fixes gh-36625
2026-04-09 10:58:57 +02:00
Sam Brannen d4e3d6be58 Merge branch '7.0.x' 2026-04-09 10:36:15 +02:00
Sam Brannen 6251b2c0c9 Support @⁠Sql with DataSource wrapped in a TransactionAwareDataSourceProxy
Prior to this commit, SqlScriptsTestExecutionListener unwrapped data
sources wrapped in an InfrastructureProxy or a scoped proxy, but it did
not unwrap a data source wrapped in a TransactionAwareDataSourceProxy.
Consequently, the sameDataSource() check failed in the latter case,
preventing execution of @⁠Sql scripts.

To address that, this commit revises sameDataSource() to unwrap a
TransactionAwareDataSourceProxy as well, analogous to the
implementations of setDataSource() in DataSourceTransactionManager,
JpaTransactionManager, and HibernateTransactionManager.

Closes gh-36611
2026-04-09 10:35:22 +02:00
Juergen Hoeller 8fe0eec5bf Merge branch '7.0.x' 2026-04-08 16:11:34 +02:00
Sam Brannen f78264d158 Polish contribution
See gh-36626
2026-04-08 16:08:09 +02:00
Junseo Bae 4b0101a9dc Defensively copy sentDate in SimpleMailMessage
Use defensive Date copies for sentDate to avoid shared mutable state.

Apply consistent handling in setSentDate, getSentDate, the copy constructor, and copyTo.

Add regression tests for mutation safety and copy isolation.

Closes gh-36626

Signed-off-by: Junseo Bae <ferrater1013@gmail.com>
2026-04-08 16:07:33 +02:00
Juergen Hoeller 3d211b71b1 Revise target bean exception with consistent message formatting 2026-04-08 15:28:29 +02:00
Sam Brannen e940a38014 Merge branch '7.0.x' 2026-04-08 14:19:16 +02:00
Sam Brannen 18b8f871aa Prevent mockk from transitively pulling in JUnit 4 2026-04-08 14:13:59 +02:00
Juergen Hoeller 623bdfb677 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-04-08 13:43:25 +02:00
Juergen Hoeller d7ddfe8d2e Upgrade to Log4J 2.25.4, Groovy 5.0.5, Hibernate ORM 7.2.10, Mockito 5.23, Checkstyle 13.4 2026-04-08 13:41:57 +02:00
Juergen Hoeller 1687d90a8c Polishing 2026-04-08 13:41:32 +02:00
Juergen Hoeller b8f1005897 Improve SpringValidatorAdapter and MethodValidationAdapter performance
Closes gh-36621
2026-04-08 13:39:20 +02:00
Juergen Hoeller 0150c4ba06 Avoid MessageFormat rendering for exception messages in binding errors
Closes gh-36609
2026-04-08 13:39:10 +02:00
Sam Brannen 8566e7bf55 Favor Class#getTypeName over ClassUtils#getQualifiedName where feasible 2026-04-08 13:27:52 +02:00
Sam Brannen c17f25f939 Fall back to type name in ClassUtils.getCanonicalName()
See gh-36607
2026-04-08 12:39:40 +02:00
Sam Brannen 9da22ecb46 Merge branch '7.0.x' 2026-04-08 12:35:54 +02:00
Sam Brannen b560c7b85d Improve Javadoc for MergedAnnotations 2026-04-08 12:35:24 +02:00
Sam Brannen f602967dbc Consistently supply List to MergedAnnotations.of() 2026-04-08 11:59:24 +02:00
Yanming Zhou f7d3556b8c Polish DisconnectedClientHelper
Use `CollectionUtils::newLinkedHashSet` instead of `LinkedHashSet::new` to avoid resizing.

Closes gh-36618

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-04-08 11:58:36 +02:00
Sam Brannen 813e113ea9 Merge branch '7.0.x' 2026-04-08 11:40:52 +02:00
Sam Brannen 0f05a2e153 Polish ClassFileMethodMetadata 2026-04-08 11:38:07 +02:00
Sam Brannen 306a1f6c99 Merge branch '7.0.x' 2026-04-08 11:14:48 +02:00
Sam Brannen d4cc273c31 Avoid recursion in ClassFileAnnotationMetadata.resolveTypeName()
See gh-36577
2026-04-08 11:13:51 +02:00
Sam Brannen 62c6d67615 Align StandardMethodMetadata with ASM/ClassFile support for getReturnTypeName()
We currently have three implementations of MethodMetadata:

- StandardMethodMetadata (Java reflection)
- SimpleMethodMetadata (ASM)
- ClassFileMethodMetadata (ClassFile API)

The ASM and ClassFile variants return a string equivalent to
Class#getTypeName(); whereas, StandardMethodMetadata currently returns a
binary name using Class#getName() (for example, `[I` instead of `int[]`).

In order to align with the ASM and ClassFile variants and provide
consistent results for all MethodMetadata implementations, this commit
revises StandardMethodMetadata.getReturnTypeName() to use
Class#getTypeName().

Closes gh-36619
2026-04-08 10:27:39 +02:00
Sam Brannen c4c0aca69b Polishing 2026-04-08 10:11:23 +02:00
Sam Brannen 6f08c0b473 Merge branch '7.0.x' 2026-04-07 18:17:00 +02:00
Sam Brannen f3b6c222f9 Use ClassLoader for method or field in MergedAnnotation
Prior to this commit, the `return` keyword was missing in
TypeMappedAnnotation's getClassLoader() implementation, which prevented
the ClassLoader of the Member (Method or Field) from being used.

This commit fixes that by adding the missing `return` keyword and adds
a test using a custom ClassLoader to verify the correct behavior.

Closes gh-36606
2026-04-07 18:16:09 +02:00
Sam Brannen 8d390f4e5a Polish SpEL documentation 2026-04-07 17:54:43 +02:00
daguimu d37d7abb17 Reject unbalanced parentheses in profile expressions
ProfilesParser.parseTokens() silently accepts unbalanced parentheses
in profile expressions such as "dev)" or "(dev", treating them as
valid. This can lead to unexpected behavior where malformed @Profile
annotations are silently interpreted instead of being rejected.

This commit tightens the validation in parseTokens() to reject:
- Unmatched closing parenthesis at the top level
- Unmatched opening parenthesis when tokens are exhausted

Also fixes an existing test that inadvertently relied on this lenient
behavior by using "spring&framework)" instead of "(spring&framework)".

Closes gh-36550

Signed-off-by: daguimu <daguimu.geek@gmail.com>
2026-04-07 15:38:50 +02:00
Sébastien Deleuze 2a1678f246 Merge branch '7.0.x' 2026-04-07 15:11:54 +02:00
Manu Sridharan f5a8c321c0 Address nullness warning from future version of NullAway
Closes gh-36548
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2026-04-07 15:10:35 +02:00
Brian Clozel 3806315e31 Merge branch '7.0.x' 2026-04-07 11:53:44 +02:00
Brian Clozel 14466eef4c Document valid SpEL separators for tokenizer 2026-04-07 11:52:47 +02:00
Sam Brannen 6062363738 Use canonical names in error messages in annotation processing
Prior to this commit, we invoked `Class.getName()` when building error
messages during annotation processing, resulting in exceptions like the
following which use binary names for nested types and arrays.

  Attribute 'chars' in annotation
  org.springframework.core.annotation.AnnotationUtilsTests$CharsContainer
  should be compatible with [C but a [I value was returned

This commit switches to canonical names in error messages in annotation
processing, resulting in improved such errors messages such as the
following.

  Attribute 'chars' in annotation
  org.springframework.core.annotation.AnnotationUtilsTests.CharsContainer
  should be compatible with char[] but a int[] value was returned

In addition, this commit introduces a new getCanonicalName(Class) method
in ClassUtils, which has effectively been extracted from the following
classes where this functionality was previously duplicated.

- AttributeMethods
- SynthesizedMergedAnnotationInvocationHandler
- TypeDescriptor
- DefaultRetryPolicy
- ReflectiveIndexAccessor

Closes gh-36607
2026-04-06 17:34:54 +02:00
Sam Brannen 31d9fe5f41 Merge branch '7.0.x' 2026-04-06 16:56:26 +02:00
Sam Brannen 9d365906b5 Fix typo 2026-04-06 16:55:32 +02:00
Sam Brannen 97e10a5948 Fix flaky SpEL tests
This commit fixes SpEL related tests that failed if the test methods
were executed in a different order than in the Gradle build.
2026-04-06 16:55:32 +02:00
Sam Brannen bfbfe4a572 Fix BridgeMethodResolverTests.findBridgedMethodInHierarchy() in Eclipse 2026-04-06 16:54:34 +02:00
Sébastien Deleuze 2ee4c3a363 Provide bean conditional registration capabilities in BeanRegistrarDsl
Closes gh-36601
2026-04-05 18:49:07 +02:00
Sam Brannen 82b179f238 Merge branch '7.0.x' 2026-04-04 17:21:16 +02:00
Sam Brannen 38464a15dc Retain source declaration order in AnnotatedTypeMetadata on Java 24+
Prior to this commit, ClassFileAnnotationDelegate created
MergedAnnotations from a HashSet, which resulted in a non-deterministic
iteration order and lost the original source declaration order of the
annotations.

To address that, this commit revises ClassFileAnnotationDelegate to
create MergedAnnotations from a List.

In addition, this commit updates all related tests to use the
containsExactly() assertion instead of containsExactlyInAnyOrder() to
ensure we consistently adhere to the "source declaration order"
requirement.

Closes gh-36598
2026-04-04 17:19:25 +02:00
Sam Brannen c04b502866 Polishing 2026-04-04 17:17:38 +02:00
Sam Brannen f993e9710d Align with JDK by throwing TypeNotPresentException in MergedAnnotations
Prior to this commit, we used ClassUtils.resolveClassName() in
TypeMappedAnnotation.adapt(...) which throws an IllegalStateException
or IllegalArgumentException if a type referenced by an annotation
attribute cannot be loaded. However, if such an error occurs while
using the JDK's reflection APIs, a TypeNotPresentException is thrown
instead.

In order to align with the standard behavior of the JDK, this commit
modifies TypeMappedAnnotation.adapt(...) to use ClassUtils.forName()
and throw a TypeNotPresentException in such scenarios.

This commit also makes similar changes in
MergedAnnotationReadingVisitor and ClassFileAnnotationDelegate.

Closes gh-36593
2026-04-03 16:44:28 +02:00
Sam Brannen 822001c6a4 Merge branch '7.0.x' 2026-04-03 15:42:28 +02:00
xxxxxxjun f2c0ad484e Fix typo in HttpRange error message
Closes gh-36590

Signed-off-by: xxxxxxjun <ryuu.public@gmail.com>
2026-04-03 15:41:14 +02:00
Sam Brannen f2d4d59f5a Merge branch '7.0.x' 2026-04-03 15:39:58 +02:00
Sam Brannen d10460d775 Track class loading exceptions in MergedAnnotation.asMap()
Spring Framework 5.2 introduced a regression in our annotation
processing support when the MergedAnnotations API was introduced.
Consequently, prior to this commit, our "annotation attributes as a Map
or AnnotationAttributes instance" support no longer stored exceptions
thrown while attempting to load a type referenced by an annotation
attribute. Instead, the exception was thrown immediately.

To address that, this commit revises our MergedAnnotation.asMap()
support so that it now tracks such exceptions in the map instead of
immediately throwing them. This allows map functionality such as
contains(attributeName), keySet(), etc. to continue to function
properly. In addition, the internal getRequiredAttribute() method in
AnnotationAttributes once again properly throws the original exception
wrapped in an IllegalArgumentException whenever a caller invokes one of
the convenience methods such as getClass() and getClassArray().

Note that this affects both asMap() variants as well as
asAnnotationAttributes().

In addition, this commit reverts the fix applied in 00fbd91cca since
it is no longer necessary.

See gh-36524
Closes gh-36586
2026-04-03 15:38:36 +02:00
Sam Brannen 4709f68446 Merge branch '7.0.x' 2026-04-02 18:40:08 +02:00
Sam Brannen 1ead8bf1ab Polishing 2026-04-02 18:39:37 +02:00
Sam Brannen afba74c516 Merge branch '7.0.x' 2026-04-02 17:21:10 +02:00
Sam Brannen 7b087d1a6c Disable flaky reactorNettyAttributes() test in WebClientIntegrationTests
See gh-36589
2026-04-02 17:20:38 +02:00
Sam Brannen fd50c0841c Merge branch '7.0.x' 2026-04-02 16:55:02 +02:00
Sam Brannen 00fbd91cca Skip annotations that cannot be processed in AnnotationBeanNameGenerator
Prior to this commit, AnnotationBeanNameGenerator failed when searching
for a convention-based bean name, if an annotation referenced a
non-existent class.

To address that, this commit introduces a try-catch block around each
invocation of MergedAnnotation.asAnnotationAttributes() and skips
processing of the current MergedAnnotation if an exception occurs,
which is likely due to a type referenced from an annotation attribute
not being present in the classpath.

See gh-31203
Closes gh-36524
2026-04-02 16:51:17 +02:00
Brian Clozel cbe8b148b1 Merge branch '7.0.x' 2026-04-02 14:48:56 +02:00
Brian Clozel d87ebbff78 Polishing
See gh-36584
2026-04-02 14:48:09 +02:00
Stéphane Nicoll 2086508924 Polish
See gh-36581
2026-04-02 14:41:26 +02:00
Juergen Hoeller 759b173b1a Merge branch '7.0.x' 2026-04-02 14:31:56 +02:00
Juergen Hoeller e977bd7bf0 Enforce strict implementation of Resource#isReadable() contract
Closes gh-36584
2026-04-02 14:30:51 +02:00
Sam Brannen 7590c4c92e Fix Javadoc link
See gh-36581
2026-04-02 13:32:32 +02:00
Sam Brannen 596c0df826 Merge branch '7.0.x' 2026-04-02 12:45:50 +02:00
Sam Brannen 24c7d31ba7 Polishing 2026-04-02 12:43:28 +02:00
Sam Brannen b6fc3a1b6f Enforce use of AssertJ assumptions via Checkstyle
Closes gh-36582
2026-04-02 12:43:12 +02:00
Sam Brannen d767806977 Ignore .cursor directory 2026-04-02 12:11:58 +02:00
Stéphane Nicoll d5b6f4a7ee Polish BeanRegistrar Javadoc and add tests for non-invocation semantics
Revise the BeanRegistrar Javadoc to document the two distinct usage
modes: @Configuration/@Import and programmatic GenericApplicationContext
setup.

Clarify that implementations are not Spring components (requiring a
no-arg constructor and no dependency injection), and detail the ordering
guarantees for each mode.

Add missing tests

Signed-off-by: Stéphane Nicoll <stephane.nicoll@broadcom.com>
2026-04-02 11:18:58 +02:00
Sam Brannen 5dc4a3a7a0 Merge branch '7.0.x' 2026-04-02 11:06:39 +02:00
Sam Brannen c5b9c3d604 Add 2D array tests, use AssertJ assumptions, and polish
See gh-36577
2026-04-02 11:05:59 +02:00
Brian Clozel 21f8b6d2f3 Merge branch '7.0.x' 2026-04-02 10:19:55 +02:00
Brian Clozel 40ef6f6872 Fix method and annotation metadata for ClassFile variant
Prior to this commit, the ClassFile variant for  annotation and method
metadata would report incorrect metadata for:
* the method return type names in case of primitives and array types
* `toString` values for methods
* `equals` and `hashcode` information for methods

This commit expands the test suite and ensures that the ASM and
ClassFile variants are aligned.

Fixes gh-36577

Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2026-04-02 10:18:13 +02:00
Junseo Bae b01fdb0140 Fix ClassFileMethodMetadata return type names for primitives and arrays
Return correct names for primitive and array types
Introduce resolveTypeName helper for ClassDesc handling
Add ClassFileMethodMetadataTests (java24Test)
Extend AbstractMethodMetadataTests with void return case

See gh-36577

Signed-off-by: Junseo Bae <ferrater1013@gmail.com>
2026-04-02 10:17:21 +02:00
Juergen Hoeller 6ebaeba1c2 Merge branch '7.0.x' 2026-04-01 21:17:00 +02:00
Juergen Hoeller 3f01e3fe11 Polishing 2026-04-01 21:15:58 +02:00
Juergen Hoeller e78af58af3 Fix Writer lifecycle for writeInternal(Object, Type, Writer)
Closes gh-36565
2026-04-01 21:15:50 +02:00
Juergen Hoeller 3bf31e45dd Replace DeferredBeanRegistrar with implicit ordering semantics
GenericApplicationContext-registered BeanRegistrars are invoked after other programmatic bean definitions. Configuration-imported BeanRegistrars participate in configuration class order and in particular in Boot's auto-configuration ordering.

Closes gh-21497
2026-04-01 20:59:45 +02:00
Brian Clozel 5e16e25109 Merge branch '7.0.x' 2026-04-01 11:06:24 +02:00
Brian Clozel aebf7c97f7 Register overrides in HttpMessageConverters when defaults are off
Prior to this commit, all `with**Converter` methods in
`HttpMessageConverters` builders would only apply if the
`registerDefaults()` option is on. While the original intent is to allow
overrides for auto-detected defaults, this creates an unnecessary
discrepancy with `addCustomConverter` which is always effective.

Allowing sich registrations when defaults are off should not introduce
invalid states and only reflects the intent of the developer. This
commit now allows such cases.

Fixes gh-36579
2026-04-01 10:49:55 +02:00
Sam Brannen 6b5f0e92b1 Merge branch '7.0.x' 2026-04-01 10:15:08 +02:00
Sam Brannen 7b8d8693dd Fix AnnotationMetadata tests in Eclipse IDE
Since commit 89391fd94c, the getClassAttributeWhenUnknownClass() methods
in SimpleAnnotationMetadataTests and DefaultAnnotationMetadataTests
have failed in Eclipse, since the JSR-305 JAR is always on the test
runtime classpath in Eclipse.

To address that, this commit introduces a FilteringClassLoader in both
test classes which mimics the test runtime behavior in the Gradle build.

See gh-36432
2026-04-01 10:13:06 +02:00
Brian Clozel 2c973d3034 Mention when RestTemplate will be removed
`RestTemplate` is deprecated, this commit amends the JavaDoc to mention
its scheduled removal for the next major version, Spring Framework 8.0.

See gh-36574
2026-03-31 22:03:36 +02:00
Brian Clozel 94e2f49e9f Read multipart requests from RestTestClient
Prior to this commit, the `RestTestClient` MockMvc integration would
support transforming client requests into MockMvc requests.
`RestTestClient` can serialize `MultiValueMap` request bodies as
multipart requests. In this case, the `MockMvcClientHttpRequestFactory`
would only read the body as byte stream and would not turn this into a
proper `MockMultipartHttpServletRequestBuilder`.

This commit uses the new `MultipartHttpMessageConverter` to parse the
request payload as `MockPart` instances to be added to the MockMvc
requests.

Closes gh-35569
2026-03-31 19:13:06 +02:00
Yanming Zhou 8b62ea13a1 Remove deprecated methodIdentification() method in CacheAspectSupport
The Javadoc said it's used for logging, but it's not used anywhere.

Closes gh-36560

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
Signed-off-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2026-03-31 17:56:47 +02:00
Sam Brannen 76ad7c9cc0 Merge branch '7.0.x' 2026-03-31 17:50:15 +02:00
Sam Brannen 22adccd190 Deprecate methodIdentification() in CacheAspectSupport for removal
CacheAspectSupport currently contains a protected methodIdentification()
method which is not used internally within the framework, and it appears
that it was accidentally copied from TransactionAspectSupport when the
caching support was first introduced.

In light of that, this commit deprecates it for removal in 7.1.

Closes gh-36576
2026-03-31 17:49:21 +02:00
rstoyanchev 8586095370 Merge branch '7.0.x' 2026-03-31 16:22:16 +01:00
rstoyanchev d4d49fd546 Make base classes for client requests public
AbstractBufferingClientHttpRequest and AbstractStreamingClientHttpRequest

Closes gh-36501
2026-03-31 14:11:17 +01:00
Sébastien Deleuze 32970fe10d Fix WebClient context propagation in Kotlin Coroutines
Prior to this commit, thread-local variables like Trace ID were not
automatically propagated into the Reactor Context when making requests
using Kotlin coroutine WebClient extensions like `awaitExchange`.

This commit updates `CoroutineContext.toReactorContext()` to capture
thread-local values via Micrometer Context Propagation when available,
ensuring observations and traces are properly reused.

Closes gh-36182
2026-03-31 14:45:55 +02:00
Brian Clozel 83c2afb643 Deprecate RestTemplate and related types
As announced in "the state of HTTP clients in Spring" blog post
(https://spring.io/blog/2025/09/30/the-state-of-http-clients-in-spring),
the deprecation timeline for `RestTemplate` was announced last November
and docs were updated accordingly.

This commit `@Deprecate` `RestTemplate` and related types for removal to
send a stronger signal to our community.
The actual removal is scheduled for Spring Framework 8.0 (not yet
scheduled).

Closes gh-36574
2026-03-31 12:28:44 +02:00
KimDaehyeon 730f824cad Fix Javadoc in HandlerMethodReturnValueHandlerComposite
Closes gh-36555

Signed-off-by: KimDaehyeon <daehyeon3351@gmail.com>
2026-03-31 11:19:52 +01:00
rstoyanchev 7473cd5fbc Merge branch '7.0.x' 2026-03-31 11:00:51 +01:00
rstoyanchev 2dcd56bbaf Polishing contribution
Closes gh-36514
2026-03-31 11:00:22 +01:00
Vishnutheep B 00be6d3afd Add null check when setting API version to preserve default value
See gh-36514

Signed-off-by: Vishnutheep B <vishnutheep@gmail.com>
2026-03-31 11:00:22 +01:00
rstoyanchev ebe3b45743 Consistently log request details in ExchangeFunctions
Closes gh-36502
2026-03-31 11:00:22 +01:00
Brian Clozel 8de3683ccb Merge branch '7.0.x' 2026-03-31 11:47:41 +02:00
Brian Clozel 9c4b246c8c Use RestClient in integration tests
Now that `RestClient` offers a better alternative, this commit revisits
our integration tests to use `RestClient` instead of `RestTemplate`.

Closes gh-36573
2026-03-31 11:37:43 +02:00
Brian Clozel f850b051b5 Add MockRestServiceServer#createServer variant for RestClient
Prior to this commit, `MockRestServiceServer` would provide
`createServer` shortcuts for `RestTemplate` and `RestGatewaySupport`.

Now that `RestClient` offers a modern client variant, we should provide
the same for `RestClient`.

Closes gh-36572
2026-03-31 11:20:44 +02:00
Brian Clozel 208f62ba07 Merge branch '7.0.x' 2026-03-31 11:02:57 +02:00
Brian Clozel c9c137ec51 Create and use RestClientXhrTransport
Prior to this commit, the `SockJsClient` would use the
`RestTemplateXhrTransport`. `RestClient` is a modern replacement for
RestTemplate and should be used instead.

This commit introduces the `RestClientXhrTransport` variant as an
immediate replacement.

Closes gh-36566
2026-03-31 11:02:33 +02:00
Sébastien Deleuze a0d51c8f7d Upgrade to Dokka 2.2.0
Closes gh-36570
2026-03-31 09:40:46 +02:00
Sébastien Deleuze f4cefb6ec5 Upgrade to Jackson 3.1 and 2.21
This commit raises the Jackson baseline and upgrades related
dependencies to Jackson 3.1 and 2.21 which are the new LTS.

Closes gh-36130
2026-03-31 09:21:48 +02:00
Sam Brannen e7fdbb8339 Merge branch '7.0.x' 2026-03-30 17:01:56 +02:00
Sam Brannen b7a1157e66 Correct Javadoc for MergedAnnotation.asAnnotationAttributes()
Closes gh-36567
2026-03-30 16:59:57 +02:00
Sam Brannen 27bc60e077 Polishing 2026-03-30 16:59:24 +02:00
Sam Brannen a64b001f6a Use AtomicBoolean as a "plain" holder in BeanOverrideUtils
Since the AtomicBoolean cannot be accessed by another thread, there is
no need to use compareAndSet().
2026-03-30 13:44:12 +02:00
Sam Brannen c68470d0fd Simplify Bean Override support in the SpringExtension
See gh-36096
2026-03-30 13:22:12 +02:00
Sam Brannen 182e6b744a Polishing 2026-03-30 13:22:12 +02:00
rstoyanchev d46e96f1ca Correct ApiVersionConfigurer method signature
Closes gh-36551
2026-03-30 12:07:06 +01:00
Sam Brannen 51a5489438 Polishing 2026-03-29 17:34:32 +02:00
Sam Brannen f9523a785b Support @⁠MockitoBean and @⁠MockitoSpyBean on test constructor parameters
Prior to this commit, @⁠MockitoBean and @⁠MockitoSpyBean could be
declared on fields or at the type level (on test classes and test
interfaces), but not on constructor parameters. Consequently, a test
class could not use constructor injection for bean overrides.

To address that, this commit introduces support for @⁠MockitoBean and
@⁠MockitoSpyBean on constructor parameters in JUnit Jupiter test
classes. Specifically, the Bean Override infrastructure has been
overhauled to support constructor parameters as declaration sites and
injection points alongside fields, and the SpringExtension now
recognizes composed @⁠BeanOverride annotations on constructor
parameters in supportsParameter() and resolves them properly in
resolveParameter(). Note, however, that this support has not been
introduced for @⁠TestBean.

For example, the following which uses field injection:

   @⁠SpringJUnitConfig(TestConfig.class)
   class BeanOverrideTests {

      @⁠MockitoBean
      CustomService customService;

      // tests...
   }

Can now be rewritten to use constructor injection:

   @⁠SpringJUnitConfig(TestConfig.class)
   class BeanOverrideTests {

      private final CustomService customService;

      BeanOverrideTests(@⁠MockitoBean CustomService customService) {
         this.customService = customService;
      }

      // tests...
   }

With Kotlin this can be achieved even more succinctly via a compact
constructor declaration:

   @⁠SpringJUnitConfig(TestConfig::class)
   class BeanOverrideTests(@⁠MockitoBean val customService: CustomService) {

      // tests...
   }

Of course, if one is a fan of so-called "test records", that can also
be achieved succinctly with a Java record:

   @⁠SpringJUnitConfig(TestConfig.class)
   record BeanOverrideTests(@⁠MockitoBean CustomService customService) {

      // tests...
   }

Closes gh-36096
2026-03-29 17:17:16 +02:00
Juergen Hoeller 955f9d3ea9 Merge branch '7.0.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/BeanRegistryAdapter.java
#	spring-context/src/main/java/org/springframework/context/annotation/Import.java
2026-03-28 20:41:57 +01:00
Juergen Hoeller 0abf97ff90 Polishing 2026-03-28 20:38:03 +01:00
Juergen Hoeller 7502b92392 Introduce DeferredBeanRegistrar and BeanRegistry#containsBean methods
Closes gh-21497
2026-03-28 20:27:23 +01:00
Juergen Hoeller 99e7543a7f Merge branch '7.0.x' 2026-03-28 11:13:56 +01:00
Juergen Hoeller f0f447a73d Upgrade to Netty 4.2.12 2026-03-28 11:13:04 +01:00
Juergen Hoeller b81a63fb5c Polishing 2026-03-28 11:12:28 +01:00
Juergen Hoeller 529a6fc932 Add documentation notes on error handling with sync=true
See gh-36531
2026-03-28 11:11:52 +01:00
Juergen Hoeller e964ced1ad Make ApplicationListenerMethodAdapter#getTargetMethod() public
Closes gh-36558
2026-03-28 11:11:46 +01:00
Sam Brannen 82a9d66079 Merge branch '7.0.x' 2026-03-27 11:26:11 +01:00
Junseo Bae ff30329861 Fix incorrect method name in TypeDescriptor.array() Javadoc
Closes gh-36549

Signed-off-by: Junseo Bae <ferrater1013@gmail.com>
2026-03-27 11:25:40 +01:00
Sam Brannen 5708b73ea9 Introduce ResolvableType.forParameter() factory method
Prior to this commit, one could invoke
ResolvableType.forMethodParameter(MethodParameter.forParameter(parameter))
to create a ResolvableType for a Parameter; however, that's slightly
cumbersome.

To address that, this commit introduces ResolvableType.forParameter(),
analogous to existing convenience factory methods in ResolvableType.

Closes gh-36545
2026-03-26 16:43:50 +01:00
Sam Brannen 5e975f51dd Remove redundant Assert.notNull() checks in ResolvableType
Since equivalent Assert.notNull() checks are already performed by
subsequent code (constructors and factory methods), there is no need
to perform the exact same assertion twice in such use cases.

Closes gh-36544
2026-03-26 16:40:17 +01:00
Sam Brannen ccf0cae18c Polishing 2026-03-26 15:22:04 +01:00
Brian Clozel de0dfe5d93 Fix Javadoc format error
See gh-33263
2026-03-26 15:19:20 +01:00
Brian Clozel aac521c116 Add integration tests and docs for multipart support
This commit adds integration tests and reference documentation
 for multipart support in `RestClient` and `RestTestClient`.

Closes gh-35569
Closes gh-33263
2026-03-26 15:10:01 +01:00
Brian Clozel ab8de8ec4b Support Map payloads in FormHttpMessageConverter
Prior to this commit, the `FormHttpMessageConverter` would only support
`MultiValueMap` payloads for reading and writing. While this can be
useful when web forms contain multiple values under the same key, this
prevent developers from using a common `Map` type and factory methods
like `Map.of(...)`.

This commit relaxes constraints in `FormHttpMessageConverter` and
ensures that `Map` types are supported for reading and writing URL
encoded forms.
Note that when reading forms to a `Map`, only the first value for each
key will be considered and other values will be dropped if they exist.

Closes gh-36408
2026-03-26 15:09:44 +01:00
Brian Clozel abc3cfc7be Move multipart support to dedicated converter
Prior to this commit, gh-36255 introduced the new
`MultipartHttpMessageConverter`, focusing on multipart message
conversion in a separate converter. The `FormHttpMessageConverter` did
conflate URL encoded forms and multipart messages in the same converter.

With the introduction of the new converter and related types in the same
package (with `Part`, `FormFieldPart` and `FilePart`), we can now
revisit this arrangement.

This commit restricts the `FormHttpMessageConverter` to URL encoded
forms only and as a result, changes its implementation to only consider
`MultiValueMap<String, String>` types for reading and writing HTTP
messages. Because type erasure, this converter is now a
`SmartHttpMessageConverter` to get better type information with
`ResolvableType`.

As a result, the `AllEncompassingFormHttpMessageConverter` is formally
deprecated and replaced by the `MultipartHttpMessageConverter`, by
setting part converters explicitly in its constructor.

Closes gh-36256
2026-03-26 15:08:58 +01:00
Brian Clozel 44302aca93 Add MultipartHttpMessageConverter
Prior to this commit, the `FormHttpMessageConverter` would write, but
not read, multipart HTTP messages. Reading multipart messages is
typicaly performed by Servlet containers with Spring's
`MultipartResolver` infrastructure.

This commit introduces a new `MultipartHttpMessageConverter` that copies
the existing feature for writing multipart messages, borrowed from
`FormHttpMessageConverter`. This also introduces a new `MultipartParser`
class that is an imperative port of the reactive variant, but keeping it
based on the `DataBuffer` abstraction. This will allow us to maintain
both side by side more easily.

This change also adds new `Part`, `FilePart` and `FormFieldPart` types
that will be used when converting multipart messages to
`MultiValueMap<String, Part>` maps.

Closes gh-36255
2026-03-26 15:08:22 +01:00
Brian Clozel ac86dc1264 Move multipart test files to a common location
This commit moves "*.multipart" test files to a common location
in order to share these resources with another test suite.

Closes gh-36253
2026-03-26 15:08:01 +01:00
Brian Clozel 051219c3c9 Introduce HttpMessageConverter#canWriteRepeatedly
The `AbstractHttpMessageConverter#supportsRepeatableWrites`
contract is a protected method that message converters can override.
This method tells whether the current converter can write several
times the payload given as a parameter. This is mainly useful on the
client side, where we need to know if we can send the same HTTP
message again, after receiving an HTTP redirect status.

Because this method is protected, this limits our ability to call
it from a different package; this is needed for gh-33263.

This commit promotes this method to the main `HttpMessageConverter`
interface and deprecates the former.

Closes gh-36252
2026-03-26 15:07:48 +01:00
Sam Brannen d8916a326a Merge branch '7.0.x' 2026-03-26 14:29:16 +01:00
Sam Brannen 6d3d3d11c4 Introduce Kotlin examples for Bean Overrides (@⁠MockitoBean, etc.)
This commit introduces Kotlin examples in the reference manual for
@⁠MockitoBean, @⁠MockitoSpyBean, and @⁠TestBean.

Closes gh-36541
2026-03-26 14:28:36 +01:00
Brian Clozel 3be51b1c77 Merge branch '7.0.x' 2026-03-25 21:53:09 +01:00
Brian Clozel 9140ed6fa9 Fix SSE flushing in SseServerResponse
Prior to this commit, `SseServerResponse.send()` would flush the
output stream returned by `getBody()`. Since gh-36385,
`ServletServerHttpResponse` wraps this stream with a non-flushing
decorator to avoid performance issues with `HttpMessageConverter`
implementations that flush excessively. As a result, SSE events were
no longer flushed to the client.

This commit changes `send()` to call `outputMessage.flush()` instead
of `body.flush()`, which properly delegates to the servlet response
`flushBuffer()` and is not affected by the non-flushing wrapper.

Fixes gh-36537
2026-03-25 21:45:24 +01:00
Sam Brannen a3118f276f Remove @⁠ContextConfiguration from MockitoBeanNestedTests
See gh-31456
2026-03-25 17:46:48 +01:00
Sam Brannen 3d70074089 Introduce support for custom parameter names in ParameterResolutionDelegate
The resolveDependency() utility method in ParameterResolutionDelegate
resolves a dependency using the name of the parameter as a fallback
qualifier. That suffices for most use cases; however, there are times
when a custom parameter name should be used instead.

For example, for our Bean Override support in the Spring TestContext
Framework, an annotation such as @⁠MockitoBean("myBean") specifies an
explicit name that should be used instead of name of the annotated
parameter.

Furthermore, introducing support for custom parameter names will
greatly simplify the logic in SpringExtension that will be required to
implement #36096.

To address those issues, this commit introduces an overloaded variant
of resolveDependency() which accepts a custom parameter name.
Internally, a custom DependencyDescriptor has been implemented to
transparently support this use case.

See gh-36096
Closes gh-36534
2026-03-25 13:15:15 +01:00
Sam Brannen bcc9e27dd0 Polishing 2026-03-25 12:41:05 +01:00
Sam Brannen 0f4ee906de Extract BeanOverrideUtils from BeanOverrideHandler
Prior to this commit, BeanOverrideHandler contained a large amount of
logic solely related to search algorithms for finding handlers.
Consequently, BeanOverrideHandler took on more responsibility than it
ideally should. In addition, we will soon increase the complexity of
those search algorithms, and we will need to make another utility
method public for use outside the bean.override package.

To address those issues, this commit extracts the search utilities from
BeanOverrideHandler into a new BeanOverrideUtils class.

Closes gh-36533
2026-03-25 11:58:49 +01:00
Juergen Hoeller 5f9dd9e135 Merge branch '7.0.x' 2026-03-24 23:50:32 +01:00
Juergen Hoeller 6cea397bd8 Consistent handling of early setCatalog/setSchema/setHoldability calls
Closes gh-36527
Closes gh-36528
2026-03-24 23:40:43 +01:00
Juergen Hoeller 5335dbf802 Merge branch '7.0.x' 2026-03-24 18:08:10 +01:00
Juergen Hoeller 484599ecbb Upgrade to EclipseLink 5.0.0 GA 2026-03-24 18:06:33 +01:00
Juergen Hoeller 1ff369d1ce Document RetryTemplate#invoke variants in reference manual
Closes gh-36452
2026-03-24 18:06:24 +01:00
Brian Clozel 4c1b4f33a8 Skip Jaxb auto-detection in HttpMessageConverters for servers
Prior to this commit, `HttpMessageConverters` would consider the JAXB
message converters when building `HttpMessageConverters` instances.
We noticed that, on the server side, the Jakarta JAXB dependency is very
common on the classpath and often brought transitively. At runtime, this
converter can use significant CPU resources when checking the
`canRead`/`canWrite` methods. This can happen when content types aren't
strictly called out on controller endpoints.

This commit changes the auto-detection mechanism in
`HttpMessageConverters` to not consider the JAXB message converter for
server use cases.
For client use cases, we keep considering this converter as the runtime
cost there is lower.

Closes gh-36302
2026-03-24 17:23:49 +01:00
Brian Clozel f1a60f1664 Merge branch '7.0.x' 2026-03-24 13:19:49 +01:00
Brian Clozel ede46647e8 Link observability section to Micrometer Observation Handler docs
This commit links the Spring Framework Observability section in the
reference documentation to the Micrometer docs describing how
Observations are handled as metrics.

Closes gh-34994
2026-03-24 13:18:52 +01:00
Sam Brannen d66e6571c1 Merge branch '7.0.x' 2026-03-24 11:07:55 +01:00
Sam Brannen 7f7f7c5f5b Invoke assertIsMock() before configuring mocks 2026-03-24 11:07:38 +01:00
Brian Clozel dc8b9fff57 Merge branch '7.0.x' 2026-03-24 10:26:04 +01:00
Brian Clozel d1950f598a Fix response stream handling in RestClient
Prior to this commit, the `DefaultRestClient` implementation would
look at the type of the returned value to decide whether the HTTP
response stream needs to be closed before returning.
As of gh-36380, this checks for `InputStream` and `InputStreamResource`
return types, effectively not considering `ResponseEntity<InputStream>`
and variants.

This commit ensures that `ResponseEntity` types are unwrapped before
checking for streaming types.

Fixes gh-36492
2026-03-24 10:18:32 +01:00
Yanming Zhou 0eba6f0da3 Add typesafe method to get generic bean by name with type reference
Fix GH-34687

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-03-24 08:02:58 +01:00
Juergen Hoeller a5579614d9 Merge branch '7.0.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2026-03-23 20:14:26 +01:00
Juergen Hoeller a01dd1cd79 Upgrade to Tomcat 11.0.20, Hibernate ORM 7.2.7, Protobuf 4.34.1 2026-03-23 20:13:03 +01:00
Juergen Hoeller 86924d067b Add registerManagedResource variant with bean key argument
Closes gh-36520
2026-03-23 20:12:40 +01:00
Juergen Hoeller f0472ea1c0 Polishing (includes nullable declaration for internal type array) 2026-03-23 20:11:54 +01:00
Juergen Hoeller eca6d91532 Refine nullable declaration of internal type array constant 2026-03-23 17:11:32 +01:00
Juergen Hoeller 354c315f55 Upgrade to Hibernate ORM 7.3
Closes gh-36519
2026-03-23 17:11:21 +01:00
Brian Clozel a302ad88f3 Merge branch '7.0.x' 2026-03-23 14:35:05 +01:00
elgun.shukurov 4b211643bb Handle blank Accept-Language header in AcceptHeaderLocaleResolver
When the Accept-Language header is present but blank, defaultLocale
was ignored and fell back to Locale.getDefault() (JVM system locale).
A blank header represents the same intent as an absent header.

Closes gh-36513

Signed-off-by: elgun.shukurov <elgun.sukurov@kapitalbank.az>
2026-03-23 14:28:27 +01:00
Sam Brannen 447e1ee0cd Merge branch '7.0.x' 2026-03-23 11:50:36 +01:00
Junseo Bae f92e810831 Fix incorrect cross reference in AbstractEnvironment Javadoc
Closes gh-36516

Signed-off-by: Junseo Bae <ferrater1013@gmail.com>
2026-03-23 11:49:39 +01:00
Sam Brannen bef2f4488f Merge branch '7.0.x' 2026-03-23 11:36:48 +01:00
Sam Brannen 9fba394b8a Sync changes to antora-playbook.yml from docs-build branch 2026-03-23 11:36:26 +01:00
Sam Brannen d5adfd7980 Merge branch '7.0.x' 2026-03-22 18:04:53 +01:00
Sam Brannen 0005ec09c2 Fix link to SpringProperties
See gh-36460
2026-03-22 18:04:33 +01:00
Sam Brannen 3777a9fcbd Merge branch '7.0.x' 2026-03-22 17:33:01 +01:00
Sam Brannen 0e800538c0 Fix warning in ConcurrentOperationExecutor.kt
Prior to this commit, the following warning was emitted in the build.

w: file:///<path>/spring-framework/framework-docs/src/main/kotlin/org/springframework/docs/core/aop/ataspectj/aopataspectjexample/ConcurrentOperationExecutor.kt:57:29 Unnecessary non-null assertion (!!) on a non-null receiver of type 'PessimisticLockingFailureException'.
2026-03-22 17:31:14 +01:00
Sam Brannen 7c834224a2 Merge branch '7.0.x' 2026-03-22 16:56:20 +01:00
Sam Brannen 43b01382ed Support global ExtensionContext scope configuration for SpringExtension
Prior to this commit, the extension context scope used by the
SpringExtension defaulted to test-method scoped and could only be
changed on a per-class basis via the @⁠SpringExtensionConfig
annotation. However, having to annotate each affected test class is
cumbersome for developers who wish to use test-class scoped extension
context semantics across their code base.

To address that, this commit introduces support for configuring the
global default extension context scope for the SpringExtension via
Spring properties or JUnit properties.

Specifically, this commit introduces a
`spring.test.extension.context.scope` property that can be set via the
SpringProperties mechanism or via a JUnit Platform configuration
parameter.

See gh-35697
Closes gh-36460
2026-03-22 16:48:41 +01:00
Paul Ngo (Do Not Bug) c1e90d51ca GenericTypeResolver.resolveType should resolve TypeVariable with nested ParameterizedType (#36480)
Signed-off-by: anaconda875 <hflbtmax@gmail.com>
2026-03-21 13:28:12 +01:00
Juergen Hoeller a0dba60fa6 Merge branch '7.0.x' 2026-03-21 12:45:25 +01:00
Juergen Hoeller 3a35c4dbd0 Consistent IOException spelling in class/method names 2026-03-21 12:13:39 +01:00
Juergen Hoeller 4c854d564c Avoid endless re-interruption loop on shutdown
Closes gh-36506
2026-03-21 12:04:29 +01:00
Juergen Hoeller de562deab0 Recognize error code 149 as deadlock loser (MySQL Galera)
Closes gh-36499
2026-03-21 12:04:00 +01:00
Brian Clozel 63e01cf6b3 Merge branch '7.0.x' 2026-03-20 15:56:10 +01:00
Brian Clozel 0b2e3900b9 Share codings resolution in resource resolvers
Prior to this commit, different resource resolvers would resolve
accepted codings from the HTTP request sent by the client. This would be
done with different implementations, which could lead to resolution
errors and desynchronizations.

This commit now introduced a new shared method in
`EncodedResourceResolver` (Servlet and Reactive) to perform a consisten
resolution.

Fixes gh-36507
2026-03-20 15:47:09 +01:00
Sam Brannen 5d45036c09 Merge branch '7.0.x' 2026-03-20 11:13:01 +01:00
Sam Brannen e1e4d52b61 Clean up AssertJ usage after migration
- Avoid the use of assertThat(Arrays.equals(...))
- Convert assertThat(Boolean.FALSE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.FALSE)
- Convert assertThat(Boolean.TRUE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.TRUE)
- Convert assertThat(x.equals(y)).isTrue() to assertThat(x).isEqualTo(y)
- Convert assertThat(x.equals(y)).isFalse() to assertThat(x).isNotEqualTo(y)
- Remove unnecessary parentheses in assertThat() arguments
- Convert assertThat(x instanceof X).isFalse() to assertThat(x).isNotInstanceOf()
- Convert assertThat(x instanceof X).isTrue() to assertThat(x).isInstanceOf()
- Convert assertThat(!x).isTrue() to assertThat(x).isFalse()
- Inline conditions in assertThat() statements

Closes gh-36504
2026-03-20 11:07:42 +01:00
Sam Brannen 8ca0262e2f Avoid the use of assertThat(Arrays.equals(...))
See gh-36504
2026-03-20 10:54:57 +01:00
Sam Brannen 29ea530525 Convert assertThat(Boolean.FALSE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.FALSE)
See gh-36504
2026-03-20 10:54:54 +01:00
Sam Brannen ac10d079df Convert assertThat(Boolean.TRUE).isEqualTo(x) to assertThat(x).isEqualTo(Boolean.TRUE)
See gh-36504
2026-03-20 10:54:46 +01:00
Sam Brannen 87c4acd7ac Convert assertThat(x.equals(y)).isTrue() to assertThat(x).isEqualTo(y)
Search:

  assertThat\((?!\s*Arrays\.)((?:[^()]+|\([^()]*\))+)\.equals\(\s*((?:[^()]+|\([^()]*\))+)\s*\)\)(.*)\.isTrue\(\)

Replace:

  assertThat($1)$3.isEqualTo($2)

See gh-36504
2026-03-20 10:54:42 +01:00
Sam Brannen 2ce21f7654 Convert assertThat(x.equals(y)).isFalse() to assertThat(x).isNotEqualTo(y)
Search:

  assertThat\((?!\s*Arrays\.)(.+?)\.equals\((.+?)\)\)(.*?)\.isFalse\(\)

Replace:

  assertThat($1)$3.isNotEqualTo($2)

See gh-36504
2026-03-20 10:54:37 +01:00
Sam Brannen 9e6504b05a Remove unnecessary parentheses in assertThat() arguments
Search:  assertThat\(\(\s*((?:[^()]+|\([^()]*\))+)\s*\)\)(\s*\..+)

Replace: assertThat($1)$2

See gh-36504
2026-03-20 10:54:31 +01:00
Sam Brannen 399f779c43 Convert assertThat(x instanceof X).isFalse() to assertThat(x).isNotInstanceOf()
Search:  assertThat\((.+?) instanceof (.+?)\)(.*?)\.isFalse\(\)

Replace: assertThat($1)$3.isNotInstanceOf($2.class)

See gh-36504
2026-03-20 10:54:27 +01:00
Sam Brannen a40ec44cb7 Convert assertThat(x instanceof X).isTrue() to assertThat(x).isInstanceOf()
Search:  assertThat\((.+?) instanceof (.+?)\)(.*?)\.isTrue\(\)

Replace: assertThat($1)$3.isInstanceOf($2.class)

See gh-36504
2026-03-20 10:54:23 +01:00
Sam Brannen 4357bbd31b Convert assertThat(!x).isTrue() to assertThat(x).isFalse()
Search:  assertThat\(\!(.+?)\)(.*?)\.isTrue\(\)

Replace: assertThat($1)$2.isFalse()

See gh-36504
2026-03-20 10:54:13 +01:00
Sam Brannen 4548f1ec66 Inline conditions in assertThat() statements
Search: assertThat\(conditions?[0-9]?\)

See gh-36504
2026-03-20 10:53:54 +01:00
Sam Brannen b31f78de50 Merge branch '7.0.x' 2026-03-19 14:16:58 +01:00
Sam Brannen 9e71dc6029 Upgrade to Gradle 9.4.1
Closes gh-36500
2026-03-19 14:05:14 +01:00
Sam Brannen 967fd099f9 Merge branch '7.0.x' 2026-03-19 14:02:36 +01:00
Sam Brannen 0daa5ce631 Polishing
(cherry-picked from b846a29b17)
2026-03-19 14:02:11 +01:00
rstoyanchev e655edafec Merge branch '7.0.x' 2026-03-19 09:12:49 +00:00
rstoyanchev 8817536e5a Lower log level of cache miss in HandlerMappingIntrospector
See gh-36309
2026-03-19 09:10:43 +00:00
rstoyanchev cdbaee11c1 Add PreFlightRequestFilter
Closes gh-36482
2026-03-19 09:10:04 +00:00
Sam Brannen 6ec2455e24 Merge branch '7.0.x' 2026-03-18 18:39:17 +01:00
Sam Brannen 1256307c83 Enable SpringJUnit5 Checkstyle rule
See gh-36496
Closes gh-36496
2026-03-18 18:38:43 +01:00
Sam Brannen 003d8b2f80 Merge branch '7.0.x' 2026-03-18 18:19:31 +01:00
Sam Brannen 4c14abf0cd Remove obsolete "test" prefix from test method names
Although this commit also changes the visibility of some test methods
to package-private, the remainder of that task will be addressed in
conjunction with gh-36496.

Closes gh-36495
2026-03-18 18:16:15 +01:00
Sam Brannen b846a29b17 Polishing 2026-03-18 17:42:18 +01:00
박준형 8b994be381 Remove unnecessary space in contributing guide title
Closes gh-36491

Signed-off-by: junhyung8795 <junhyung8795@naver.com>
2026-03-18 15:43:45 +01:00
Brian Clozel b246fc881b Merge branch '7.0.x' 2026-03-18 12:19:22 +01:00
Tobias Fasching a81367f686 Use ISO-8859-1 for fallback filename
Updates the Content-Disposition header creation logic to use only
ISO-8859-1 characters for the fallback 'filename' parameter instead of
RFC 2047 encoded strings. Non-compatible characters are replaced with '_'.

This does not remove the ability to parse RFC 2047 encoded filenames.

Closes gh-36328

Signed-off-by: Tobias Fasching <tobias.fasching@outlook.com>
2026-03-18 12:09:36 +01:00
rstoyanchev 5785923c0e Lower log level of cache miss in HandlerMappingIntrospector
See gh-36309
2026-03-17 19:00:34 +00:00
rstoyanchev 66607cb145 Add PreFlightRequestFilter
Closes gh-36482
2026-03-17 18:54:29 +00:00
Brian Clozel 4637da1f36 Merge branch '7.0.x' 2026-03-17 18:12:40 +01:00
Brian Clozel a21706c58a Copy WS handshake headers to store in session
Prior to this commit, the `StandardWebSocketUpgradeStrategy` would get
the HTTP headers from the handshake request and store them in the
WebSocket session for the entire duration of the session.
As of gh-36334, Spring MVC manages HTTP directly with a native API
instead of copying them. This improves performance but also uncovered
this bug: we cannot keep a reference to HTTP headers once the HTTP
exchange is finished, because such resources can be recycled and reused.

This commit ensures that the handshake headers are copied into the
session info to keep them around for the entire duration of the session.
Without that, Tomcat will raise an `IllegalStateException` at runtime.

This was already done for WebFlux in SPR-17250, but the latest header
management changes in Framework uncovered this issue for the Standard
WebSocket container case.

Fixes gh-36486
2026-03-17 18:09:57 +01:00
Brian Clozel 22e4d84993 Add support for "application/jsonl" JSON lines
Prior to this commit, Spring web frameworks were using the
"application/x-ndjson" media type for streaming JSON payloads delimited
with newlines.

The "application/jsonl" media type seems to gain popularity in the
broader ecosystem and could supersede NDJSON in the future. This commit
adds support for JSON Lines as an alternative.

Closes gh-36485
2026-03-17 12:18:23 +01:00
Sébastien Deleuze e2b9b19970 Upgrade to Kotlin 2.3.20
Closes gh-36484
2026-03-17 11:59:45 +01:00
Brian Clozel 75f964657f Merge branch '7.0.x' 2026-03-17 09:20:16 +01:00
github-actions[bot] de913642fb Update Antora Spring UI to v0.4.26 2026-03-17 09:19:50 +01:00
Sam Brannen 23b73168a0 Merge branch '7.0.x' 2026-03-16 13:39:30 +01:00
jun c2c6130da5 Fix typo in StompSession Javadoc
Closes gh-36469

Signed-off-by: jun <ryuu.public@gmail.com>
2026-03-16 13:38:19 +01:00
Juergen Hoeller 391dd90e84 Support "classpath*:" prefix for resource bundle basename
Closes gh-36292
See gh-36415
2026-03-16 12:23:35 +01:00
Juergen Hoeller 1345760087 Support "classpath*:" prefix for ResourceLoader#getResource
Introduces a general-purpose consumeContent method on Resource and EncodedResource with special behavior for multi-content resources. Regular getInputStream/getReader calls will expose the merged content of all same-named resources in the classpath.

Closes gh-36415
2026-03-16 12:23:16 +01:00
Brian Clozel 51fccf226f Merge branch '7.0.x' 2026-03-16 11:16:48 +01:00
Brian Clozel df817364b2 Fix WebTestClient list assertions
Prior to this commit, the `WebTestClient` could only accept non-nullable
types in its `expectBodyList<T>` Kotlin extension function.
This commit relaxes this requirements to allow for more assertions.

Fixes gh-36476
2026-03-16 11:14:55 +01:00
Brian Clozel bc07a451dc Fix ParameterizedTypeReference nullness
This commit ensures that `ParameterizedTypeReference<T>` can accept
nullable types. This is especially useful for Kotlin extension functions
and assertion contracts.

Fixes gh-36477
2026-03-16 11:12:06 +01:00
Sam Brannen a14a20b61b Merge branch '7.0.x' 2026-03-15 17:06:18 +01:00
Sam Brannen 5eb0e99d58 Fix common typos and grammatical mistakes
Closes gh-36471
2026-03-15 17:05:29 +01:00
Sam Brannen 17699103dc Consistently use American English spelling
Since the Spring Framework uses American English spelling, this commit
updates Javadoc and the reference manual to ensure consistency in that
regard. However, there are two exceptions to this rule that arise due
to their use within a technical context.

- We use "cancelled/cancelling" instead of "canceled/canceling" in
  numerous places (including error messages).
- We use "implementor" instead of "implementer".

Closes gh-36470
2026-03-15 17:04:23 +01:00
Sam Brannen fadbd0fa31 Partially revert forward merge of "Branch for 7.0.x maintenance" 2026-03-15 14:45:09 +01:00
Sam Brannen 40ef084e7f Merge branch '7.0.x' 2026-03-15 14:40:47 +01:00
Sam Brannen 9b366b28b7 Remove obsolete, custom Eclipse configuration for spring-oxm
See gh-36195
2026-03-15 14:32:56 +01:00
Sam Brannen 0f990e44a8 Polish contribution
See gh-36195
2026-03-15 14:32:56 +01:00
Clayton Walker e102bc4933 Improve XJC configuration for spring-oxm in the Gradle build
Closes gh-36195

Signed-off-by: Clayton Walker <clayton.m.walker@gmail.com>
2026-03-15 14:32:44 +01:00
Sam Brannen a07033f3fb Resolve all default context configuration within test class hierarchies
Prior to this commit, if a superclass or enclosing test class (such as
one annotated with @⁠SpringBootTest or simply
@⁠ExtendWith(SpringExtension.class)) was not annotated with
@⁠ContextConfiguration (or @⁠Import with @⁠SpringBootTest), the
ApplicationContext loaded for a subclass or @⁠Nested test class would
not use any default context configuration for the superclass or
enclosing test class.

Effectively, a default XML configuration file or static nested
@⁠Configuration class for the superclass or enclosing test class was
not discovered by the AbstractTestContextBootstrapper when attempting
to build the MergedContextConfiguration (application context cache key).

To address that, this commit introduces a new
resolveDefaultContextConfigurationAttributes() method in
ContextLoaderUtils which is responsible for creating instances of
ContextConfigurationAttributes for all superclasses and enclosing
classes. This effectively enables AbstractTestContextBootstrapper to
delegate to the resolved SmartContextLoader to properly detect a
default XML configuration file or static nested @⁠Configuration class
even if such classes are not annotated with @⁠ContextConfiguration.

Closes gh-31456
2026-03-13 15:39:05 +01:00
Sam Brannen 293a9c0ee3 Allow local @⁠BootstrapWith annotation to override a meta-annotation
This commit revises the resolveExplicitTestContextBootstrapper()
algorithm in BootstrapUtils to allow a local @⁠BootstrapWith annotation
to override a meta-annotation within the same composed annotation.

Closes gh-35938
2026-03-13 15:24:38 +01:00
Sam Brannen 32d1b83f62 Override Servlet 6.1's doPatch() method in FrameworkServlet
See gh-12640
See gh-14975
See gh-36258
Closes gh-36247
2026-03-13 15:17:04 +01:00
Brian Clozel 227bc196b1 Consider 7.0.x branch for Antora UI upgrades 2026-03-13 15:02:25 +01:00
Brian Clozel 2fcef050e0 Build 7.1.0-SNAPSHOT 2026-03-13 14:50:12 +01:00
Brian Clozel be1bf91ce8 Branch for 7.0.x maintenance 2026-03-13 10:22:01 +01:00
Brian Clozel 877825b4ab Next development version (v7.0.7-SNAPSHOT) 2026-03-13 09:33:52 +01:00
Sébastien Deleuze 739d5ba77b Leverage ResourceHandlerUtils in ScriptTemplateView
This commit apply extra checks to ScriptTemplateView resource handling
with ResourceHandlerUtils, consistently with what is done with static
resource handling.

Closes gh-36458
2026-03-12 19:43:17 +01:00
Sébastien Deleuze 19ab92ef59 Restore ScriptTemplateViewTests
Restore both WebMVC and WebFlux variants that were deleted
by mistake in commit 4db2f8ea1b.

This commit also removes the empty resource loader path, as it is not
needed for the main WEB-INF/ use case that is typically configured
explicitly by the user, and not needed to pass the restored tests.

Closes gh-36456
2026-03-12 19:42:28 +01:00
Sam Brannen 04313f062e Improve documentation for FullyQualifiedConfigurationBeanNameGenerator
This commit documents FullyQualifiedConfigurationBeanNameGenerator in
related Javadoc and in the reference manual.

See gh-33448
Closes gh-36455
2026-03-12 17:03:45 +01:00
Sam Brannen e634ced56b Fix log message in ConfigurationClassBeanDefinitionReader
The log message now properly generates the fully-qualified method name
and includes the resolved bean name as well.

Closes gh-36453
2026-03-12 16:23:45 +01:00
Sam Brannen 1502c2296e Remove redundant method invocation 2026-03-12 16:17:23 +01:00
Brian Clozel cc5c7ba186 Fix enclosing class resolution with ClassFile API
Prior to this commit, the `ClassFile` based implementation of
`AnnotationMetadata` would rely on the `NestHost` class element to get
the enclosing class name for a nested class.
This approach works for bytecode emitted by Java11+, which aligns with
our Java17+ runtime policy. But there are cases where bytecode was not
emitted by a Java11+ compiler, such as Kotlin. In this case, the
`NestHost` class element is absent and we should instead use the
`InnerClasses` information to get it.

This commit makes use of `InnerClasses` to get the enclosing class name,
but still uses `NestHost` as a fallback for anonymous classes.

Fixes gh-36451
2026-03-12 10:47:39 +01:00
Sam Brannen 0269eb80da Fix typo and improve Javadoc for ConfigurationBeanNameGenerator 2026-03-11 17:18:11 +01:00
Sam Brannen 9cedcd65ef Polishing 2026-03-11 16:45:30 +01:00
Sam Brannen 4e8acb9ef2 Polish contribution
See gh-36448
2026-03-11 16:45:30 +01:00
gbouwen dbbbf37ac9 Update exception message in JacksonJsonMessageConverter
Closes gh-36448

Signed-off-by: gbouwen <57719521+gbouwen@users.noreply.github.com>
2026-03-11 16:41:19 +01:00
Juergen Hoeller d8216d719b Upgrade to SnakeYAML 2.6, Protobuf 4.34, H2 2.4.240 2026-03-11 15:53:42 +01:00
Juergen Hoeller 63ced3f3b4 Polishing 2026-03-11 13:52:34 +01:00
Juergen Hoeller 89391fd94c Consistently ignore non-loadable annotation types with ClassFile/ASM
Uses ClassFileAnnotationMetadata name for actual AnnotationMetadata.
Moves JSR-305 dependency to compile-only for all spring-core tests.

Closes gh-36432
2026-03-11 13:52:19 +01:00
rstoyanchev 5168e3a38b Polishing contribution
Closes gh-36400
2026-03-10 19:14:41 +00:00
husseinvr97 d4893fb32f Support defaultHtmlEscape in WebFlux
See gh-36400

Signed-off-by: husseinvr97 <husseinmustafabas05@gmail.com>
2026-03-10 19:14:41 +00:00
Juergen Hoeller 104a2033c5 Upgrade to Reactor 2025.0.4 and Micrometer 1.16.4
Includes Jetty 12.1.7, Hibernate ORM 7.2.6, EclipseLink 5.0.0-RC1, Selenium 4.41, Mockito 5.22, Checkstyle 13.3

Closes gh-36443
Closes gh-36444
2026-03-10 20:09:20 +01:00
Brian Clozel cc1514be85 Fix DefaultResponseErrorHandler method visibility
Prior to this commit, the `setMessageConverters` method would have
private visibility. But `initBodyConvertFunction`, which is `protected`,
relies on the message converters being set in the first place.
While this works with `RestTemplate` because this is done automatically,
the `RestClient` does offer a builder method to configure a
`ResponseErrorHandler` and this makes it impossible to configure
converters in this case.

This commit aligns the method visibility by making it protected.

Closes gh-36434
2026-03-10 18:08:09 +01:00
Brian Clozel 6e9758700a Guard against invalid id/event values in Server Sent Events
Prior to this commit, our implementation of Server Sent Events (SSE),
`SseEmitter` (MVC) and `ServerSentEvent` (WebFlux), would not guard
against invalid characters if the application mistakenly inserts such
characters in the `id` or `event` types.
Both implementations would also behave differently when it comes
to escaping comment multi-line events.

This commit ensures that both implementations handle multi-line comment
events and reject invalid characters in id/event types.
This commit also optimizes `String` concatenation and memory usage
when writing data.

Fixes gh-36440
2026-03-10 17:56:58 +01:00
Sam Brannen 37e8aa76e9 Use link for first reference to @⁠Fallback in @⁠Bean Javadoc
See gh-36439
2026-03-10 17:53:33 +01:00
Sam Brannen 27686dc2e2 Document @Fallback alongside Primary in the reference docs and @Bean Javadoc
Closes gh-36439
2026-03-10 17:13:23 +01:00
Sam Brannen 3b8efbe5a6 Document registration recommendations for BeanPostProcessor and BeanFactoryPostProcessor
Closes gh-34964
2026-03-10 13:07:13 +01:00
Sam Brannen 6f2e59a995 Polishing 2026-03-10 13:07:12 +01:00
Sam Brannen 644a20ae2a Polish @⁠Bean Javadoc and reference docs 2026-03-10 12:24:53 +01:00
rstoyanchev 77bc13dc8c Polishing contribution
See gh-36325
2026-03-09 17:52:12 +00:00
rstoyanchev ab9895b5a9 Polishing contribution
Closes gh-36325
2026-03-09 17:49:25 +00:00
Agil ce5c4f3b4b Refactor calculateHashCode method for clarity
This will:
1. Mathematical Distribution (Collision Reduction)
2. Pipelining and CPU Caching
3. Avoiding "Method Heavy" Expressions

See gh-36325

Signed-off-by: Agil <41694337+AgilAghamirzayev@users.noreply.github.com>
2026-03-09 17:38:15 +00:00
rstoyanchev cd0c26b6db Update Javadoc on binding flag in ModelAttribute
Add clarification and mention primary use case.
2026-03-09 14:25:47 +00:00
조형준 1203ace285 Fix typo in HttpExchangeAdapterDecorator Javadoc
Closes gh-36433

Signed-off-by: jun <ryuu.public@gmail.com>
2026-03-09 14:46:20 +01:00
Sam Brannen 1219943e73 Polishing
See gh-36323
2026-03-09 11:15:19 +01:00
Sébastien Deleuze eeddf9a73a Fix transaction managemement snippet and documentation
Closes gh-36323
2026-03-09 10:29:45 +01:00
jisub-dev b2a4bc8900 Add programmatic configuration code snippet
- Extract code examples to separate Java, Kotlin, and XML files
- Add Kotlin configuration sample alongside Java
- Change "Java Config" terminology to "Programmatic Configuration"
- Use include-code directive for better maintainability

See gh-36323
Signed-off-by: jisub-dev <kimjiseob1209@gmail.com>
2026-03-09 10:12:20 +01:00
Sam Brannen 3a266e65d6 Revise nullability in AnnotationConfigContextLoaderUtils 2026-03-08 14:42:17 +01:00
Sam Brannen 463138acbc Resolve context initializers only once in AbstractTestContextBootstrapper
The internal buildMergedContextConfiguration() method in
AbstractTestContextBootstrapper originally resolved the
ApplicationContextInitializer set only once. However, the changes made
in commit 2244461778 introduced a regression resulting in the
initializers being resolved twice: once for validation and once for
actually building the merged context configuration. In addition, the
resolution for validation does not honor the inheritInitializers flag
in ContextConfigurationAttributes.

To address these issues, buildMergedContextConfiguration() once again
resolves the context initializers once via
ApplicationContextInitializerUtils.resolveInitializerClasses().

See gh-18528
Closes gh-36430
2026-03-08 14:32:06 +01:00
Tran Ngoc Nhan b8a4961b81 Remove unused imports in framework-docs examples
Closes gh-36429

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-03-07 15:11:05 +01:00
rstoyanchev 06d4a8fc4b Fix case sensitivity issue in ServletRequestHeadersAdapter
The RequestHeaderOverrideWrapper did not deduplicate in keySet()
across underlying headers and overrides.

A similar change in size() even if it was working correctly,
to align with keySet and make it more efficient.

Closes gh-36418
2026-03-06 16:51:27 +00:00
Sam Brannen 13b0643828 Invoke resolveContextLoader() only once in AbstractTestContextBootstrapper
See commit c2d0d292bd
See gh-35994
Closes gh-36425
2026-03-06 16:05:30 +01:00
Sam Brannen 548b2167b0 Simplify changes made in commit c2d0d292bd
See gh-36390
2026-03-06 13:13:18 +01:00
froggy0m0 de417beff7 Fix typo in ExceptionMapingComparator name
Closes gh-36422

Signed-off-by: 신성현 <froggy0m0a@gmail.com>
2026-03-06 11:57:14 +01:00
rstoyanchev ccc6789cb5 Update docs for path API version resolver
See gh-36398
2026-03-05 17:21:43 +00:00
rstoyanchev f73302a66e Polishing contribution
Closes gh-36398
2026-03-05 17:12:13 +00:00
Martin Mois 348482b5a0 Add usePathSegment with Predicate<RequestPath>
See gh-36398

Signed-off-by: Martin Mois <martin.mois@gmail.com>
2026-03-05 17:12:13 +00:00
rstoyanchev 25bb264bd9 Polishing in ReactorNettyWebSocketClient
Also, remove local variables that should have been removed when
the corresponding, deprecated setters were removed in
2ed281f6a8.

Closes gh-36370
2026-03-05 17:12:13 +00:00
Artem Voronin 9819e1cad5 Propagate max frame length to WebSocket session
This change ensures that maxFramePayloadLength from
WebsocketClientSpec is passed to ReactorNettyWebSocketSession.

Previously, the session used the default 64KB limit regardless
of client configuration, causing TooLongFrameException when
receiving larger frames from servers like Tomcat or Jetty.

See gh-36370

Signed-off-by: Artem Voronin <artem.voronin.dev@gmail.com>
2026-03-05 17:12:13 +00:00
rstoyanchev ce2402a581 Link to Tomcat issue in ServletResponseHeadersAdapter 2026-03-05 17:12:13 +00:00
Sam Brannen c2d0d292bd Re-resolve ContextLoader in logWarningForIgnoredDefaultConfig()
Ideally, we should be able to reuse the ContextLoader that was resolved
in buildDefaultMergedContextConfiguration(); however, since we have
been informed that some implementations of resolveContextLoader()
mutate the state of the supplied ContextConfigurationAttributes to
detect default configuration classes, we need to invoke
resolveContextLoader() on the completeDefaultConfigAttributesList as
well in order not to break custom TestContextBootstrappers that exhibit
such side effects.

Closes gh-36390
2026-03-05 15:28:54 +01:00
Sam Brannen bbe733def7 Address Checkstyle violation 2026-03-05 11:43:06 +01:00
Stéphane Nicoll 03391dfa94 Switch serializable flag to primitive boolean
This commit improves the change made to TypeHint to use a primitive
boolean for the serializable flag.

See gh-36379
2026-03-05 11:23:51 +01:00
Sam Brannen 50c29e64f8 Polish documentation for FrameworkServlet and HttpServletBean 2026-03-05 11:21:44 +01:00
Sam Brannen 22301fd069 Further align synthesized annotation toString() with modern JDKs
Closes gh-36417
2026-03-04 17:39:02 +01:00
Sam Brannen 11ab0b4351 Upgrade to Gradle 9.4
Closes gh-36416
2026-03-04 13:43:07 +01:00
Juergen Hoeller 4734c15d81 Polishing 2026-03-03 23:28:37 +01:00
Sam Brannen 02af3e7a17 Introduce setDefaultCharset() in AbstractResourceBasedMessageSource
Traditionally, AbstractResourceBasedMessageSource has only had a
setDefaultEncoding() method which accepts the name of the default
encoding character set. However, although we have recently made a
concerted effort within the framework to introduce support for
supplying a Charset instead of a character set's name, we had
overlooked this particular scenario.

In light of that, this commit introduces setDefaultCharset(Charset) and
getDefaultCharset() methods in AbstractResourceBasedMessageSource and
makes direct use of the available Charset in
ReloadableResourceBundleMessageSource and ResourceBundleMessageSource.

Furthermore, although technically a regression in behavior, invoking
setDefaultEncoding() on such MessageSource implementations with an
invalid character set name now results in an immediate
UnsupportedCharsetException at configuration time instead of a
NoSuchMessageException at runtime, which will help users to more easily
detect misconfiguration.

Closes gh-36413
2026-03-03 18:08:21 +01:00
cetf 3c6f1b35ba Fix format string argument count
Fixes: gh-36410
Signed-off-by: cetf <cetf9h@163.com>
2026-03-03 12:14:33 +01:00
Sam Brannen 7a420b28df Revise custom @⁠BootstrapWith use case in test
See https://github.com/spring-projects/spring-boot/issues/15077
See gh-35938
2026-03-02 17:07:30 +01:00
Sam Brannen 63723fadb6 Introduce tests for additional @⁠BootstrapWith use cases
See gh-35938
2026-03-02 16:34:39 +01:00
Sam Brannen ab7a2c4e70 Rename configuration.interfaces package to config.interfaces
This commit renames the
org.springframework.test.context.configuration.interfaces package to
org.springframework.test.context.config.interfaces in order to colocate
"config" related tests under the same package.
2026-03-02 16:07:43 +01:00
dependabot[bot] a87b2e0146 Upgrade fast-xml-parser to 5.3.8
Closes gh-36402

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-03-01 13:13:43 +01:00
Sam Brannen bd40f0e6bb Fix typo 2026-03-01 13:03:40 +01:00
Sam Brannen 04186fdf0e Consistently refer to URLs and URIs in documentation 2026-03-01 13:03:14 +01:00
Tran Ngoc Nhan b2b731b0ba Fix links to UriComponentsBuilder and polish examples
Closes gh-36403

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-03-01 12:51:43 +01:00
Juergen Hoeller a3b9098850 Remove prefixed FactoryBean name in ApplicationListenerDetector
Closes gh-36404
2026-03-01 12:08:19 +01:00
Juergen Hoeller 36815f4021 Add support for JPA 4.0 FlushModeType.EXPLICIT
Includes defensive nullable field access in EclipseLinkConnectionHandle.

Closes gh-36401
2026-02-28 19:37:27 +01:00
Sam Brannen 3b1b7ff594 Add Checkstyle suppression 2026-02-28 16:22:57 +01:00
Sam Brannen 95080cabfd Polishing 2026-02-28 16:01:01 +01:00
조형준 017892265e Fix typo in WebMvcConfigurationSupport Javadoc
Closes gh-#36399

Signed-off-by: jun <ryuu.public@gmail.com>
2026-02-28 14:16:14 +01:00
Juergen Hoeller d096a33f13 Add note on test difference against Jackson 3.1.0 2026-02-28 13:36:39 +01:00
Juergen Hoeller b6833ff31f Cancel late-executing tasks within revised closed handling
Closes gh-36362
2026-02-28 13:34:01 +01:00
Stéphane Nicoll 3bc55c77ec Add support for declaring reflection metadata for lambdas
Closes gh-36339
2026-02-27 14:42:46 +01:00
Sam Brannen 824aa137f8 Align implementation of injectDependencies() with injectDependenciesInAotMode() 2026-02-26 18:01:01 +01:00
Sam Brannen 0dc44f79d5 Avoid superfluous MergedContextConfiguration equals() check
See gh-36390
2026-02-26 12:56:38 +01:00
Sam Brannen f481f99516 Avoid unnecessary List and Stream creation
See gh-36390
2026-02-26 12:02:38 +01:00
Sam Brannen 72ed2eaa31 Fix lambda variable names
See gh-36390
2026-02-26 11:57:32 +01:00
Sam Brannen 0676c958f7 Log warning for ignored default context configuration in tests
In Spring Framework 7.1, the TestContext Framework will reliably detect
all default context configuration within the type hierarchy or
enclosing class hierarchy (for @⁠Nested test classes) above a given
test class; however, test suites may encounter failures once we make
that switch in behavior.

In order to help development teams prepare for the switch in 7.1, this
commit logs a warning similar to the following whenever default context
configuration is detected but currently ignored.

  WARN - For test class [org.example.MyTests$NestedTests], the
  following 'default' context configuration classes were detected but
  are currently ignored: org.example.MyTests$Config. In Spring
  Framework 7.1, these classes will no longer be ignored. Please update
  your test configuration accordingly. For details, see:
  https://docs.spring.io/spring-framework/reference/testing/testcontext-framework/ctx-management/default-config.html

See gh-31456
See gh-36392
Closes gh-36390
2026-02-26 11:24:02 +01:00
Sam Brannen 482519d03b Document how to avoid issues w/ ignored default context config in tests
See gh-31456
See gh-36390
Closes gh-36392
2026-02-25 17:36:14 +01:00
Sam Brannen d6b7cea327 Polishing 2026-02-25 17:34:14 +01:00
Sam Brannen 9eea227ab9 Further emphasize @⁠Configuration classes over XML and Groovy in testing chapter
See gh-36393
2026-02-25 15:44:00 +01:00
Sam Brannen 706c98228d Emphasize @⁠Configuration classes over XML and Groovy in testing chapter
Closes gh-36393
2026-02-25 15:26:32 +01:00
rstoyanchev b83cb4a947 Make newRequest methods public
The methods to build a request in RestClientAdapter and WebClientAdapter
are now public to make it easier to create a custom adapter that wraps
the built-in ones and delegates for methods that can be the same.

Closes gh-36374
2026-02-25 12:43:19 +00:00
rstoyanchev 7e79d0e206 Polishing in DefaultRestClientTests 2026-02-25 12:43:19 +00:00
rstoyanchev e58ba2c665 Simplify use of InputStream with RestClient
Closes gh-36380
2026-02-25 12:43:19 +00:00
Sam Brannen 0c9127d111 Use consistent indentation in Gradle build scripts 2026-02-25 11:15:16 +01:00
Sam Brannen c2088517b9 Upgrade to JUnit 6.0.3
Closes gh-36389
2026-02-25 11:05:05 +01:00
Sam Brannen 59b9057e59 Polishing 2026-02-25 10:52:28 +01:00
Sam Brannen 2ec630ef45 Remove obsolete EMPTY_GROUPS constant in InvocableHandlerMethod
See gh-36274
2026-02-25 10:50:45 +01:00
Sam Brannen cf2b59b68b Delete obsolete addCharsetParameter() method
See gh-36318
2026-02-25 10:50:45 +01:00
Sam Brannen f1ca29b05d Move NOTE in "Programmatic Retry Support" to correct location 2026-02-25 10:28:23 +01:00
dependabot[bot] ee6a115a18 Upgrade fast-xml-parser to 5.3.6
Closes gh-36348

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2026-02-25 10:08:56 +01:00
Juergen Hoeller 95a31c4e8c Align constant name in ServletServerHttpResponse
See gh-36385
2026-02-25 09:29:22 +01:00
Brian Clozel e0b54e244e Ignore flushes on ServletServerHttpResponse output stream
Prior to this commit, flush calls on the output stream returned by
`ServletServerHttpResponse#getBody` would be delegated to the Servlet
response output stream.
This can cause performance issues when `HttpMessageConverter` and other
web components write and flush multiple times to the response body.
Here, the Servlet container is in a better position to flush to the
network at the optimal time and buffer the response body until then.

This is particularly true for `HttpMessageConverters` when they flush
many times the output stream, sometimes due to the underlying codec
library. Instead of revisiting the entire message converter contract, we
are here ignoring flush calls to that output stream.

This change does not affect the client side, nor the
`ServletServerHttpResponse#flush` calls.

This commit also introduces a new Spring property
`"spring.http.response.flush.enabled"` that reverts this behavior change
if necessary.

Closes gh-36385
2026-02-24 21:44:48 +01:00
Juergen Hoeller f2b64ad09c Polishing 2026-02-24 17:17:31 +01:00
Juergen Hoeller cff48fff2d Reject late-executing tasks after termination waiting
Closes gh-36362
2026-02-24 17:17:21 +01:00
Juergen Hoeller ab8cb8de6e Add support for non-flushing OutputStream
Avoids decoration for streams that are non-closing/flushing already.

Closes gh-36382
2026-02-24 17:17:04 +01:00
Stéphane Nicoll 434da06d1f Migrate to GraalVM metadata format 1.2.0
This commit adapts RuntimeHints to be compatible with v1.2.0 of the
GraalVM metadata format. The changes are as follows:

* Resources and resource bundles are now defined at the same level. This
is transparent to users.
* Serialization is no longer a top-level concept, but rather an
attribute of a type or proxy. The top-level concept has been deprecated
and the relevant methods have been added.

Closes gh-36379
2026-02-24 17:05:50 +01:00
Brian Clozel a37447e07f Remove duplicate flushes in HttpMessageConverter implementations
Prior to this commit, a few implementations of the `HttpMessageConverter`
contract were inheriting from abstract classes. Those classes were
performing extra `OutputStream#flush` on the response body even though
this is the responsibility of the super class. Such abstract classes
do flush already, after delegating to the `writeInternal` method.

This commit ensures that we remove such extra calls as they tend to
waste resources for no added benefit.

Closes gh-36383
2026-02-24 16:49:37 +01:00
Sam Brannen b1cb9c5052 Polish contribution
See gh-36367
2026-02-23 17:24:13 +01:00
Tran Ngoc Nhan 057633edb5 Polish SpEL operator examples in reference docs
Closes gh-36367

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-23 17:08:22 +01:00
Brian Clozel 7299ff9326 Improve ResourceHttpMessageConverter target type support
This commit updates the target type detection in
`ResourceHttpMessageConverter` to only support target types that are
relevant: `InputStreamResource` for streaming, and types assignable from
`ByteArrayResource` for non-streaming cases.

Closes gh-36368
2026-02-23 11:02:22 +01:00
조형준 53f1656f56 Fix typo in CorsConfiguration Javadoc
Closes gh-36366

Signed-off-by: jun <ryuu.public@gmail.com>
2026-02-22 16:14:45 +01:00
Brian Clozel 2691489381 Fix InvalidMimeTypeException for compatible media types
The `AbstractMessageConverterMethodProcessor` is in charge of handling
controller method return values and to write those as HTTP response
messages. The content negotiation process is an important part.

The `MimeTypeUtils#sortBySpecificity` is in charge of sorting inbound
"Accept" media types by their specificity and reject them if the list
is too large, in order to protect the application from ddos attacks.

Prior to this commit, the content negotiation process would first get
the sorted "Accept" media types, the producible media types as
advertized by message converters - and collect the intersection of both
in a new list (also sorted by specificity). If the "Accept" list is
large enough (but under the limit), the list of compatible media types
could exceed that limit because duplicates could be introduced in that
list: several converters can produce the same content type.

This commit ensures that compatible media types are collected in a set
to avoid duplicates. Without that, exceeding the limit at this point
will throw an `InvalidMimeTypeException` that's not handled by the
processor and result in a server error.

Fixes gh-36300
2026-02-20 18:21:45 +01:00
Tran Ngoc Nhan f103af4982 Remove obsolete space in HandlerMethod.html#assertTargetBean javadoc
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-20 13:43:11 +00:00
rstoyanchev b9a59853fa Use case-insensitive comparator in HttpHeadersAssert
Closes gh-36349
2026-02-20 13:38:51 +00:00
rstoyanchev d4b2a493f9 Fix duplicate header writing in ResponseBodyEmitterReturnValueHandler
Closes gh-36357
2026-02-20 10:45:22 +00:00
rstoyanchev 188cb9b24d Update Javadoc of RestClient.Builder defaultStatusHandler
See gh-36248
2026-02-19 11:42:59 +00:00
rstoyanchev e3568a3f0a Fix generic return type support in HttpServiceMethod
Closes gh-36326
2026-02-18 17:27:02 +00:00
rstoyanchev e106fc0434 Polishing in RestClientAdapterTests and WebClientAdapterTests 2026-02-18 17:27:02 +00:00
Stéphane Nicoll ca3adf43eb Next development version (v7.0.6-SNAPSHOT) 2026-02-18 14:07:54 +01:00
rstoyanchev 85c18caf25 Update docs on supported versions with baseline notation
Closes gh-36316
2026-02-18 11:33:08 +00:00
Juergen Hoeller 22bd8bd704 Skip serialization of potentially non-serializable cached state
Closes gh-36346
2026-02-17 22:13:57 +01:00
Juergen Hoeller 9b10bb5e08 Polishing 2026-02-17 18:57:09 +01:00
Juergen Hoeller 727ccd04ef Avoid setCharacterEncoding(Charset) call with null value
Includes consistent content length check for functional response.

See gh-36343
2026-02-17 18:56:59 +01:00
Juergen Hoeller a9f447e8d7 Consistent adaptation of HTTP headers on Servlet responses
Includes use of Servlet 6.1 setCharacterEncoding(Charset)

Closes gh-36343
2026-02-17 17:38:50 +01:00
海子 Yang 0841e79e32 Copy methodAnnotations in MethodParameter copy constructor
Signed-off-by: 海子 Yang <i.take.today@gmail.com>
2026-02-17 17:17:22 +01:00
Niravil a1868d3e9e fix TransactionAspectSupport#currentTransactionStatus javadoc
Signed-off-by: Niravil <messerignacius@gmail.com>
2026-02-17 16:26:02 +01:00
rstoyanchev e5aac66157 ServletResponseHeadersAdapter checks contentType property
Issue gh-36334
2026-02-17 11:55:34 +00:00
Juergen Hoeller 8bf85d2596 Polishing 2026-02-17 12:27:00 +01:00
Juergen Hoeller 508b31da4f Optimize Entry hashCode in HttpHeaders (plus related polishing) 2026-02-17 11:55:10 +01:00
Juergen Hoeller d291272736 Use HandlerMethod-determined validation groups
Closes gh-36336
2026-02-17 11:50:07 +01:00
海子 Yang db01f07037 Remove unused EMPTY_GROUPS in InvocableHandlerMethod
Signed-off-by: 海子 Yang <i.take.today@gmail.com>
2026-02-17 11:30:54 +01:00
Brian Clozel b9e190e313 Fix HttpMessageConverters configurers support
This commit fixes the `configureMessageConverters` and
`configureMessageConvertersList` behavior.

`configureMessageConverters` was not executing consumers in their order
of registration (but in the reverse order).
`configureMessageConvertersList` was not executing multiple consumers
and was instead executing the first consumer multiple times.

This commit fixes both issues.

Fixes gh-36332
2026-02-16 18:48:26 +01:00
rstoyanchev d712ec3d49 Minor optimization in Tomcat header adapters
get method skips containsKey and instead checks if the enumeration
has elements, which should give the same behavior other than for
headers without values.

See gh-36334
2026-02-16 17:38:01 +00:00
rstoyanchev 5baa4fdd69 Further optimize Servlet header adapters
- Optimize get method for request headers
- Update keySet methods to use custom extension of AbstractSet
- Drop use of native Tomcat headers, which could be an issue for
request and response wrappers that override header methods.
The performance of Servlet adapters should be similar for the
commonly used methods, and it should be possible to optimize
further for the future in HttpHeaders (e.g. by adding a
set alternative to put), and requesting Servlet API refinements.

Closes gh-36334
2026-02-16 17:37:51 +00:00
rstoyanchev 9273a11a2c Stub Servlet headers adapter methods not needed in HttpHeaders
See gh-36334
2026-02-16 17:37:27 +00:00
rstoyanchev 7ea11baff9 Pass-through handling of Servlet headers
See gh-36334
2026-02-16 17:37:09 +00:00
Sam Brannen 655fd2e2bf Document that SpEL expressions using Optional w/ null-safe & Elvis operators are not compilable
Closes gh-36331
2026-02-15 12:26:54 +01:00
Brian Clozel a31574a0a2 Fix MultipartParser & PartGenerator memory leak
Prior to this commit, the reactive `MultipartParser` and `PartGenerator`
types were leaking memory at runtime in specific cases:

* many HTTP clients must send multipart requests to be parsed and close
  the connection while uploading
* the `PartGenerator` must be configured to write file parts to
  temporary files on disk
* concurrency, upload speed must be important to trigger cases where the
  file system is not fast enough to consume incoming buffers

The `MultipartParser` parses and emits `BodyToken` to its sink
(here, the `PartGenerator`). By definition, Reactor's `FluxSink` when
created with `Flux.create(FluxSink)` will use a "buffer" strategy and
will queue emitted elements if they cannot be consumed.

Here, the cancellation signal does dispose internal states in the
`MultiPartParser` and `PartGenerator` but does not clear the internal
queue in `FluxSink`.

This commit ensures that an operation is registered to release buffers
on the discard event.

Fixes gh-36262
2026-02-13 18:33:47 +01:00
Juergen Hoeller 44f3e7b427 Fix Checkstyle violation
See gh-36317
2026-02-13 16:34:58 +01:00
Juergen Hoeller e8e24e65d2 Detect all common size exceptions from Tomcat and Commons FileUpload 2.x
Closes gh-36317
2026-02-13 16:19:46 +01:00
Sam Brannen 9a002a77b2 Stop referring to "Java-8" features in documentation
See gh-36310
2026-02-13 15:21:31 +01:00
Brian Clozel 97e96895db Optimize MediaType(MediaType, Charset) constructor
Prior to this commit, the `MediaType` and `MimeType` "copy" constructors
would not leverage the fact that the existing instance has been
validated already (types, subtype and parameters have been checked
already for errors) and the entire validation would be performed again.
This would also allocate map instances in the process.

This commit ensures that the already validated information is reused
directly and that we avoid unnessecary operations and allocations for
such constructors.

Closes gh-36318
2026-02-13 14:49:34 +01:00
Juergen Hoeller e98c2fe488 Reuse AnnotatedMethod annotation cache in derived instances
Closes gh-36322
2026-02-13 13:55:24 +01:00
Juergen Hoeller 75705bcbb1 Restore early MessageConsumer creation for temporary queue
Closes gh-36321
2026-02-13 13:55:08 +01:00
rstoyanchev 47a2e7059e Optimal charset handling in AbstractHttpMessageConverter
Closes gh-36320
2026-02-13 12:39:03 +00:00
Sam Brannen 14b6339351 Consistently support @⁠Autowired as a meta-annotation
Prior to this commit, the findAutowiredAnnotation() method in
AutowiredAnnotationBeanPostProcessor fully supported finding
@⁠Autowired as a meta-annotation; however, the isRequired() method in
QualifierAnnotationAutowireCandidateResolver only found @⁠Autowired as
a "directly present" annotation without any support for
meta-annotations.

For consistency and to avoid bugs, this commit revises
QualifierAnnotationAutowireCandidateResolver so that we always support
@⁠Autowired as a meta-annotation.

Closes gh-36315
2026-02-12 16:38:24 +01:00
Juergen Hoeller bc2e89a786 Cache ResponseBody annotation presence per controller class
See gh-36311
2026-02-12 13:44:54 +01:00
Sam Brannen 4abbddf601 Avoid duplicate required attribute lookup for @⁠Autowired annotations
This commit revises AutowiredAnnotationBeanPostProcessor so that
determineRequiredStatus(MergedAnnotation<?>) only looks up the required
attribute once.

Closes gh-36314
2026-02-12 13:19:06 +01:00
Sam Brannen 926bcbd9a6 Stop referring to obsolete ListenableFuture in documentation
ListenableFuture as deprecated for removal in 6.0 and removed in 7.0.

See gh-33808
See gh-33809
See commit cb8ed43be1
Closes gh-36313
2026-02-12 13:19:06 +01:00
Sam Brannen cb8ed43be1 Stop referring to "JDK 8" features in documentation
See gh-36310
2026-02-12 12:27:51 +01:00
Juergen Hoeller 1703388074 Cache ResponseBody annotation presence per controller class
Closes gh-36311
2026-02-12 12:20:14 +01:00
Sam Brannen d84c4a39e2 Stop referring to "Java 8" features in documentation
Closes gh-36310
2026-02-12 12:11:02 +01:00
Sam Brannen 6f03c186b9 Polishing 2026-02-12 11:51:39 +01:00
Brian Clozel e10d37ad54 Next development version (v7.0.5-SNAPSHOT) 2026-02-12 10:39:15 +01:00
Juergen Hoeller 4734837fe4 Upgrade to Netty 4.2.10, Hibernate ORM 7.2.4, Checkstyle 13.2 2026-02-11 22:41:52 +01:00
Juergen Hoeller 4a13655aa5 Polishing 2026-02-11 19:22:27 +01:00
Brian Clozel 5ef9972528 Allow to disable defaults in HttpMessageConverters
The builder for `HttpMessageConverters` allows for auto-detection of
message converters on the classpath and their default registration when
`registerDefaults()` is called. Once called, there is no way to undo
this.

This commit adds a new `disableDefaults()` method to disable the default
registration and take full control over the list of message converters.

Closes gh-36303
2026-02-11 18:37:12 +01:00
Christian Schuster a9b1d6335e avoid unnecessary locking in ConcurrentReferenceHashMap's implementation of computeIfAbsent and computeIfPresent
Signed-off-by: Christian Schuster <christian@dnup.de>
2026-02-11 17:53:26 +01:00
Sam Brannen 98d4046e4b Document that @⁠Validated & @⁠Lazy may be used as meta-annotations
See gh-36305
See gh-36306
2026-02-11 17:37:06 +01:00
Sam Brannen 282fee5c95 Consistently find @⁠Lazy as a meta-annotation at arbitrary depths
Prior to this commit, AnnotationConfigUtils looked up @⁠Lazy as a
meta-annotation at arbitrary depths (e.g., when used as a
meta-meta-annotation); however,
ContextAnnotationAutowireCandidateResolver only found @Lazy as a
"directly present" meta-annotation.

For consistency, this commit revises
ContextAnnotationAutowireCandidateResolver so that it also finds @⁠Lazy
as a meta-annotation at arbitrary depths.

Closes gh-36306
2026-02-11 17:33:15 +01:00
Sam Brannen 0d4737aeec Polishing 2026-02-11 17:26:15 +01:00
Juergen Hoeller 1ef8734881 Cache method annotations in AnnotatedMethod as well
See gh-36307
2026-02-11 17:23:05 +01:00
Juergen Hoeller 6dfa54b8ea Cache method annotations in MethodParameter
Closes gh-36307
2026-02-11 16:41:55 +01:00
Sam Brannen 2d3a2c5cbd Consistently find @⁠Validated as a meta-annotation at arbitrary depths
Prior to this commit, ValidationAnnotationUtils looked up @⁠Validated
as a meta-annotation at arbitrary depths (e.g., when used as a
meta-meta-annotation) in determineValidationGroups() but only as a
"directly present" meta-annotation in determineValidationHints().

For consistency, this commit revises determineValidationHints() so that
it finds @⁠Validated as a meta-annotation at arbitrary depths as well.

Closes gh-36274
2026-02-11 16:02:13 +01:00
Brian Clozel 62e590a437 Use updated message in HttpEntityMethodProcessor
Prior to this commit, the `HttpEntityMethodProcessor` would create a new
`ServletServerHttpRequest` input message to parse the native Servlet
request, but would not reuse it for reading the request body using the
message converters.

In gh-32471, we applied a change that updates HTTP headers accordingly
when request parameters are read. But not reusing the input message
means that we are losing this update when instantiating the resulting
`HttpEntity`.

This commit ensures that `HttpEntityMethodProcessor` uses the input
message it just created when decoding the request body.

Fixes gh-36298
2026-02-11 12:32:15 +01:00
Sam Brannen 7f29df4d79 Make StompBrokerRelayMessageHandler's isPauseable() logic dynamic
Prior to this commit, an attempt to restart the
StompBrokerRelayMessageHandler (SBRMH) resulted in an
IllegalStateException stating that the ReactorNettyTcpClient was still
in the process of "Shutting down." The reason is that a
ReactorNettyTcpClient cannot be restarted after it has been closed, and
that is by design.

To address that issue, this commit introduces an
`internallyManagedTcpClient` flag in SBRMH that is used to track
whether SBRMH is in charge of managing the TcpClient internally or if
the TcpClient was supplied by the user and is therefore managed
externally.

If SBRMH manages the TcpClient internally, isPauseable() returns
`true`, and the `tcpClient` field is set to null (in stopInternal())
when the handler is stopped. Consequently, a new internally managed
TcpClient will be created when the handler is restarted.

If the TcpClient is managed externally, the handler is not considered
to be "pauseable", and a reference to the externally managed TcpClient
is retained after the handler has been stopped. If the
ApplicationContext is subsequently restarted, the externally managed
TcpClient will be reused -- which may or may not work, depending on the
implementation of the TcpClient. Note, however, that this has always
been the behavior of SBRMH with regard to stop/start scenarios for
externally managed TcpClients.

Closes gh-36266
2026-02-11 11:19:36 +01:00
rstoyanchev 8fb119df1e Determine validation groups in HandlerMethod
Closes gh-36274
2026-02-11 09:00:52 +00:00
rstoyanchev 1bb0fdda6b Move validation group determination to ValidationAnnotationUtils
See gh-36274
2026-02-10 16:56:33 +00:00
rstoyanchev 6507367d10 Polishing contribution
Closes gh-36179
2026-02-10 15:28:54 +00:00
Junhwan Kim fee7e6b7e2 Refine SendTo/Subscription header propagation
See gh-36179

Signed-off-by: Junhwan Kim <musoyou1085@gmail.com>
2026-02-10 15:28:54 +00:00
Brian Clozel 35c4973504 Upgrade to Reactor 2025.0.3
Closes gh-36288
2026-02-10 14:06:02 +01:00
Sam Brannen 77b54c7409 Stop setting the relayPort, since we explicitly set the TCP client 2026-02-10 13:21:33 +01:00
Sam Brannen ff9ba15762 Extract test logging into extension 2026-02-10 13:20:43 +01:00
Łukasz Jernaś c33b82f2a1 Log which HandlerInterceptor threw the exception
Closes gh-36281

Signed-off-by: Łukasz Jernaś <lukasz.jernas@allegro.com>
2026-02-10 11:44:26 +01:00
Brian Clozel ec459aefbf Upgrade to Micrometer 1.6.3
Closes gh-36287
2026-02-10 11:42:30 +01:00
rstoyanchev b227701473 Optimize RequestMappingInfo hashcode calculation
Precalculated hashcode makes sense for infos in the registry, but
matched infos created on the fly don't need it.

Closes gh-36279
2026-02-10 10:14:54 +00:00
Tran Ngoc Nhan 7a85ce959b Remove obsolete code in Redirecting to a resource section
See gh-34103
Closes gh-36384

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-02-10 11:13:39 +01:00
Brian Clozel e93e55b456 Fix wildcard MIME type support in messaging converters
Prior to this commit, the "application/*+json" wildcard MIME type was
added to the list of supported MIME types in the JSON messaging
converter. This change wasn't fully reflected in the
`AbstractMessageConverter`, because only strict matching of type and
subtybe were considered.

This commit updates the `AbstractMessageConverter` to not only check the
type and subtype, but also check whether the supported MIME type
includes the one given as a parameter.

Fixes gh-36285
2026-02-10 10:41:17 +01:00
rstoyanchev e22b1648bf Cache HandlerMethod with resolved bean if singleton
See gh-36278
2026-02-09 17:16:05 +00:00
rstoyanchev 78967d4bd6 Optimize version match
Closes gh-36276
2026-02-09 16:36:26 +00:00
rstoyanchev 1d2351c87b Optimize single PathPattern match
Closes gh-36275
2026-02-09 16:33:22 +00:00
rstoyanchev 02dc4b6342 Avoid determineValidationGroups not necessary
There is no need to call determineValidationGroups if the method
itself doesn't require method validation.

See gh-36274
2026-02-09 15:52:58 +00:00
Sam Brannen 143828e27c Introduce "Attention Required" section in changelog
Closes gh-36277
2026-02-09 12:39:39 +01:00
Sam Brannen 7998bc9de2 Fix grammar in Javadoc 2026-02-09 12:06:06 +01:00
Manu Sridharan 8a1a9d2ab2 Fix nullability annotation in JdbcTemplate
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2026-02-08 18:13:57 +01:00
Juergen Hoeller 394a97d7e0 Add setPackagesToScan to LocalEntityManagerFactoryBean (and make setDataSource work)
Includes fix for consistent PersistenceException in case of no unit found for name.
Includes proper tests for Local(Container)EntityManagerFactoryBean with scan setup.

Closes gh-36270
Closes gh-36271
2026-02-08 17:54:02 +01:00
Juergen Hoeller 05ffe8249f Adapt to getAllClassNames SPI (post JPA 4.0 M1)
See gh-35705
2026-02-07 21:01:25 +01:00
Juergen Hoeller 20970a4a37 Repeatedly check status while trying to lock for shutdown
Closes gh-36260
2026-02-06 19:03:54 +01:00
rstoyanchev cb4b87cce2 Use headerFilter on SimpAnnotationMethodMessageHandler
See gh-36179
2026-02-06 17:13:11 +00:00
rstoyanchev 1d470fc375 Exposes headerFilter on SimpAnnotationMethodMessageHandler
Closes gh-36179
2026-02-06 17:08:50 +00:00
rstoyanchev 7fc619acdc Polishing contribution
See gh-36179
2026-02-06 17:08:50 +00:00
김준환 e5f8c5b7ae Add header propagation predicate support to message return value handlers
See gh-36179

Signed-off-by: Junhwan Kim <musoyou1085@gmail.com>
2026-02-06 17:08:50 +00:00
Juergen Hoeller 3666ad9d7f Derive StatelessSession from primary Session in HibernateJpaDialect
This is analogous to LocalSessionFactoryBean's SpringSessionContext.

See gh-36025
2026-02-06 00:18:00 +01:00
Juergen Hoeller 652d509cfc Avoid direct javadoc reference to JPA 4.0 EntityAgent class
See gh-36025
2026-02-05 20:13:20 +01:00
Juergen Hoeller 153c378bb2 Polishing 2026-02-05 20:01:47 +01:00
Juergen Hoeller cdbaa7f3a7 Early support for JPA 4.0 EntityAgent (autowiring a shared proxy)
Includes skipping of isOpen check on close where easily possible.

Closes gh-36025
2026-02-05 20:01:26 +01:00
Brian Clozel d1b0bdb3d5 Revert Servlet TRACE error dispatch workaround
Closes gh-36258
2026-02-04 14:53:07 +01:00
Brian Clozel 59a9d0fcb9 Remove outdated GraalVM substitutions
Closes gh-36257
2026-02-04 14:52:40 +01:00
rstoyanchev db9045ae28 Polishing in CharBufferDecoder 2026-02-04 11:37:52 +00:00
rstoyanchev 7c2159fbe9 Polishing contribution
Closes gh-36225
2026-02-04 11:36:45 +00:00
Đặng Minh Dũng f2d3da3f32 Add ProxyFactoryCustomizer
Allows manipulating the `ProxyFactory` before the proxy is created

See gh-36225

Signed-off-by: Đặng Minh Dũng <dungdm93@live.com>
2026-02-04 11:35:48 +00:00
Yurii Platunov f1c86b1bbc Fix formatting in Web MVC HTTP Message Conversion documentation
Closes gh-36250

Signed-off-by: Yurii Platunov <furachannel16@gmail.com>
2026-02-04 11:30:32 +01:00
Johnny Lim 7fde8a6fa3 Remove obsolete doc for spring.context.annotated-bean-reader.create
See gh-35570
Closes gh-36241

Signed-off-by: Johnny Lim <izeye@naver.com>
2026-02-04 11:06:16 +01:00
Ivars Silamiķelis 033c309d39 Fix JSON syntax in STOMP overview documentation
Closes gh-36229

Signed-off-by: Ivars Silamiķelis <ivars.silamikelis@gmail.com>
2026-02-04 11:04:13 +01:00
Juergen Hoeller ac243fae65 Runtime compatibility with JPA 4.0.0-M1 and Hibernate ORM 8.0.0.Alpha1
Closes gh-35705
2026-02-03 19:13:48 +01:00
Juergen Hoeller ad19c1ac82 Introduce beforeRetry callback with RetryState argument
Closes gh-36245
2026-02-02 18:34:00 +01:00
Sébastien Deleuze 29d125e659 Add resource hint for BeanRegistrar implementing ImportAware
Closes gh-36242
2026-02-02 15:44:22 +01:00
Juergen Hoeller d31bd8139d Remove duplicated Jakarta Validation API declaration 2026-02-02 14:45:22 +01:00
Juergen Hoeller fb10455d3c Upgrade to Groovy 5.0.4, Tomcat 11.0.18, Jetty 12.1.6, Jackson 3.0.4/2.20.2, Hibernate ORM 7.2.3, Checkstyle 13.1 2026-02-02 12:14:40 +01:00
Juergen Hoeller 40350653e1 Upgrade to ASM 9.9.1 and Objenesis 3.5
Includes JavaPoet 0.10.0

Closes gh-36243
2026-02-02 12:13:41 +01:00
Sam Brannen a08a4d6068 Document @⁠SpringExtensionConfig in the reference manual
This commit also updates the Javadoc for the SpringExtension and
@⁠SpringExtensionConfig to point out that the SpringExtension always
uses a test-class scoped ExtensionContext if
@⁠TestInstance(Lifecycle.PER_CLASS) semantics are in effect.

Closes gh-36240
2026-01-31 16:24:38 +01:00
dependabot[bot] 6fd84e4c2f Upgrade fast-xml-parser from 4.5.2 to 5.3.4 in /framework-docs
Closes gh-36234
2026-01-31 15:31:24 +01:00
Juergen Hoeller 516bf1c606 Consistently detect resilience annotations on interfaces
Closes gh-36233
2026-01-30 17:12:22 +01:00
Sam Brannen 32b55e68fc Upgrade to Gradle 9.3.1 2026-01-30 15:48:15 +01:00
Sam Brannen b1f427f137 Fix typo 2026-01-30 13:41:20 +01:00
Sébastien Deleuze f52481493c Use @Nullable Void in TaskCallback#from
See gh-36208
2026-01-30 13:36:29 +01:00
qwding 149397ed10 Optimize NamedParameterUtils#buildValueArray by lazily fetching SqlParameter
This PR optimizes the performance of NamedParameterUtils#buildValueArray by deferring the call to findParameter(declaredParams, paramName, i).

Changes: In the original implementation, findParameter was called for every parameter in the loop, regardless of whether the paramValue retrieved from paramSource was already an instance of SqlParameterValue.

Since findParameter involves iterating through the declaredParams list (or performing lookups), skipping this call when paramValue instanceof SqlParameterValue is true reduces unnecessary CPU cycles and memory access, especially for queries with a large number of parameters or long declaredParams lists.

Signed-off-by: qwding <761945125@qq.com>
2026-01-30 11:59:43 +01:00
Brian Clozel e1d3076570 Fix "remove" implementation in netty headers adapter
Prior to this commit, the `Netty4HeadersAdapter` `MultiValueMapi#remove`
implementation would return an empty list if no value was present. This
is not consistent with other implementations.

This change ensures that `null` is returned for those cases.

Fixes gh-36226
2026-01-29 11:06:46 +01:00
Juergen Hoeller 16f4b23c32 Consistently close streams through try-with-resources
Closes gh-36223
2026-01-28 18:08:06 +01:00
Sam Brannen 54c3d01270 Revise documentation on JSR-330 support in the reference manual
Closes gh-36222
2026-01-28 18:06:39 +01:00
Sam Brannen 799a520c35 Consistently refer to "an SQL" statement, type, etc.
Aside from the three classes I modified, we already do this
consistently across the code base and in the reference manual.
2026-01-28 18:02:34 +01:00
Patrick Strawderman bf5386712c Use Java Files utilities in FileCopyUtils
Use helpers from java.nio.file.Files for some methods in FileCopyUtils.

Additionally, add unit tests for the various file-related methods.

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2026-01-28 17:46:09 +01:00
Juergen Hoeller 5d33de943b Polishing 2026-01-28 17:09:02 +01:00
Juergen Hoeller 7da65fe4fc Support -1 for undetermined length in SqlBinaryValue/SqlCharacterValue
Closes gh-36219
2026-01-28 17:08:40 +01:00
Sam Brannen 0d612b3b1d Make TaskCallback a @⁠FunctionalInterface 2026-01-28 14:54:52 +01:00
Sam Brannen 4dacc64a30 Fix formatting and spelling 2026-01-28 14:27:27 +01:00
Sam Brannen ba47dd0714 Fix links to JUnit User Guide
Closes gh-36217
2026-01-28 14:16:32 +01:00
rstoyanchev 79386b0e83 Fix unfinished edit from previous commit
See gh-36198
2026-01-28 12:27:09 +00:00
rstoyanchev d1bfe03358 Update docs on trailing slash handling
Closes gh-36198
2026-01-28 12:21:33 +00:00
rstoyanchev 4bc9f68451 Update docs content types for ProblemDetail
Closes gh-36192
2026-01-28 12:21:33 +00:00
Sam Brannen ce0e37536b Fix Javadoc formatting
See gh-36207
2026-01-28 11:00:42 +01:00
Juergen Hoeller b0ac8df13e Consistent delegation to target ValidatorFactory 2026-01-27 20:55:01 +01:00
Juergen Hoeller 80a57c2468 Consistent references to Hibernate ORM 7.x 2026-01-27 20:46:30 +01:00
Juergen Hoeller 02e05b40b0 Polishing 2026-01-27 20:30:46 +01:00
Juergen Hoeller c8c99d0464 Support JtaTransactionManager/SpringBeanContainer on HibernateJpaVendorAdapter
Makes ConfigurableJtaPlatform public and removes outdated WebSphere UOW check.

Closes gh-36216
2026-01-27 20:30:21 +01:00
Juergen Hoeller 867dd0e972 Upgrade to Hibernate ORM 7.2.2 2026-01-27 20:28:18 +01:00
Sébastien Deleuze 2c96f18439 Upgrade nullability plugin to 0.0.11
Closes gh-36188
2026-01-27 14:10:18 +01:00
Patrick Strawderman 96fb5d72eb Use Reader.transferTo in FileCopyUtils
Use the transferTo method in FileCopyUtils#copy(Reader, Writer).

Closes gh-36196

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2026-01-27 09:38:58 +01:00
Sébastien Deleuze bc01eeb433 Leverage JUnit 6 suspending function support
Closes gh-36215
2026-01-27 08:45:04 +01:00
rstoyanchev 77c24b28b6 Polishing in ReactorClientHttpConnector 2026-01-26 10:51:00 +00:00
Kuyho Chung e809395635 Clarify Kotlin Coroutine definition
Closes gh-36209
Signed-off-by: Kuyho Chung <kchung1995@gmail.com>
2026-01-26 09:54:15 +01:00
Sam Brannen 801035bea7 Upgrade to AssertJ 3.27.7 2026-01-25 17:51:00 +01:00
Sam Brannen 9e4a54bb99 Ensure RetryTaskTests compiles in Eclipse IDE
Prior to this commit, "new RetryTask<>" declarations whose
TaskCallbacks (implemented as lambda expressions) did not actually
throw an exception resulted in a compilation error in Eclipse:

  "Unhandled exception type Exception".

This is due to the fact that RetryTask is declared with "E extends
Exception", and the Eclipse compiler therefore infers that the lambda
expression potentially throws a checked Exception.

To address that, this commit explicitly declares that the affected
lambda expressions throw unchecked RuntimeExceptions:

  "new RetryTask<String, RuntimeException>"
2026-01-25 17:46:14 +01:00
Sam Brannen e56f7c1e53 Polishing 2026-01-25 17:35:17 +01:00
Padraic Slattery 65bdc78a1e Update GitHub upload-artifact action to version 6
Closes gh-36199

Signed-off-by: Padraic Slattery <pgoslatara@gmail.com>
2026-01-25 17:07:09 +01:00
Juergen Hoeller fd3bbb057e Polishing 2026-01-25 10:42:13 +01:00
Juergen Hoeller c47da1247a Add TaskCallback/Callable/Runnable wrapper for retryable tasks
Closes gh-36208
2026-01-25 10:41:25 +01:00
Juergen Hoeller 22cf7958a5 Revise setPersistenceUnitName javadoc
Closes gh-36205
2026-01-25 10:38:24 +01:00
Phillip Webb ab314aadd9 Refine YamlProcessor to allow different empty values
Update `YamlProcessor` to allow any value to be inserted for
empty entries. This update will allow blank strings to be used
instead of `null` which better aligns with the way that
`.properties` files are loaded.

This update also allows allows the specified `emptyValue` to be
inserted instead of a blank String when the YAML contains `null`
or `~` values.

See gh-36197
See gh-19986

Signed-off-by: Phillip Webb <phil.webb@broadcom.com>
2026-01-24 20:23:48 +01:00
Sébastien Deleuze 611811d8fc Anticipate fixing Kotlin 2.3 compilation warning
Closes gh-36203
2026-01-23 18:34:45 +01:00
Phillip Webb 0c9f40b171 Allow YAML processors to create a flattened map with nulls included
Add an additional `getFlattenedMap` method to `YamlProcessor` to allow
the resulting flattened map to include nulls.

This update will allow processor subclasses to tell the difference
between YAML that is defined with an empty object vs missing the key
entirely:

e.g.:

  application:
    name: test
    optional: {}

vs

  application:
    name: test
    optional: {}

Closes gh-36197

Signed-off-by: Phillip Webb <phil.webb@broadcom.com>
2026-01-23 18:07:06 +01:00
Sam Brannen 5b4eda3d20 Clean up warnings in Gradle build 2026-01-22 17:27:24 +01:00
Sam Brannen af8fd8f07d Upgrade to TestNG 7.12 2026-01-22 17:27:00 +01:00
rstoyanchev 345fa51e77 Handle early exception from AsynchronousFileChannel#write
Closes gh-36184
2026-01-21 15:43:03 +01:00
Juergen Hoeller c05ea841bc Declare Callable parameter with nullable type variable
Closes gh-36191
2026-01-21 19:45:18 +01:00
Juergen Hoeller dab28b5dce Upgrade to Selenium 4.40 2026-01-21 15:09:24 +01:00
Juergen Hoeller 1c4b20287f Use correlation id for explicit sendAndReceive response queue
See gh-36162
See gh-36177
2026-01-21 14:46:36 +01:00
Sébastien Deleuze 8fbd147f0b Upgrade nullability plugin to 0.10.0
Closes gh-36188
2026-01-21 10:39:41 +01:00
Juergen Hoeller 1c56ec3f7e Polishing 2026-01-20 19:24:03 +01:00
Juergen Hoeller 65565de1a8 Prevent accidental printStackTrace() usage in main codebase
Closes gh-36185
2026-01-20 19:23:37 +01:00
Juergen Hoeller b3c26255b1 Upgrade to Hibernate ORM 7.2.1 and Protobuf 4.33.4 2026-01-20 19:23:29 +01:00
Sam Brannen 66962875f9 Reinstate test for Jetty in CookieIntegrationTests 2026-01-20 17:11:03 +01:00
Sam Brannen 5490ba94ae Simplify tests 2026-01-20 17:10:07 +01:00
Sam Brannen 17e02804ba Revert changes to FailingBeforeAndAfterMethodsTestNGTests 2026-01-20 15:47:45 +01:00
Sam Brannen 357205723f Simplify tests 2026-01-20 13:54:19 +01:00
Sam Brannen c4c167c0e1 Convert various test classes to @⁠ParameterizedClass
See gh-35833
2026-01-20 13:53:56 +01:00
rstoyanchev 4119ecc25b Refine solution to clear Netty channel attribute
Closes gh-36158
2026-01-20 11:34:18 +00:00
Sam Brannen 9ebfdb8b6a Fix test parameterization in CaffeineReactiveCachingTests
Prior to this commit, test methods in CaffeineReactiveCachingTests
were parameterized twice with the same configuration class.

See gh-31637
See gh-35833
2026-01-20 11:43:22 +01:00
Sébastien Deleuze c4cb55fbde Modernize DispatcherServlet context hierarchy diagram
See gh-36175
2026-01-20 09:41:28 +01:00
Sam Brannen 7917ae53e8 Polishing 2026-01-19 19:16:28 +01:00
Sébastien Deleuze 693ec8219f Introduce RestClient.ResponseSpec#requiredBody
Closes gh-36173
2026-01-19 18:15:34 +01:00
rstoyanchev 9b95482557 ContentRequestMatchers supports HttpEntity multipart
Closes gh-36154
2026-01-19 17:05:16 +00:00
Sam Brannen a029dfc6a8 Improve display names for parameterized invocations
See gh-35833
2026-01-19 17:59:49 +01:00
Sébastien Deleuze a921c487b4 Fix snippet imports
See gh-36175
2026-01-19 17:38:30 +01:00
Sébastien Deleuze 3f01830d11 Refine CORS documentation to match latest changes
Closes gh-36156
2026-01-19 17:27:19 +01:00
Sébastien Deleuze 64d95d7f3e Extract code snippets from mvc-servlet.adoc
Closes gh-36175
2026-01-19 17:24:38 +01:00
Sébastien Deleuze 5a4b1bd1d1 Extract code snippets from logging.adoc
See gh-36175
2026-01-19 17:24:38 +01:00
Sébastien Deleuze a91402dcc6 Extract code snippets from multipart.adoc
See gh-36175
2026-01-19 17:24:38 +01:00
Sébastien Deleuze 0014e0b3c9 Extract code snippets from context-hierarchy.adoc
See gh-36175
2026-01-19 17:24:38 +01:00
Sébastien Deleuze 49da766551 Extract code snippets from exceceptionhandlers.adoc
See gh-36175
2026-01-19 17:24:38 +01:00
Sébastien Deleuze 50bbe6191a Extract code snippets from container-config.adoc
See gh-36175
2026-01-19 17:24:37 +01:00
Shubham Kalloli a8c33c13e2 Upgraded Apache POI and Commons IO to remediate CVEs
Signed-off-by: Shubham Kalloli <shubham.kalloli@est.tech>
2026-01-19 17:06:02 +01:00
Sam Brannen b164db35c1 Revise contribution
See gh-36170
2026-01-18 16:59:30 +01:00
Tran Ngoc Nhan 385e62dbf0 Replace getErrors() with getBindingResult() in examples
DataBinder#getErrors was removed in v4.0.0.M1.

Closes gh-36170

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-18 16:55:32 +01:00
Sam Brannen 4d4adeb2c6 Polish Javadoc 2026-01-18 16:52:04 +01:00
Juergen Hoeller 7aa862f5ec Make scope fully configurable
Closes gh-36171
2026-01-18 15:55:36 +01:00
Juergen Hoeller 2d2809f45c Consistently throw Task/InvocationRejectedException on access rejected
Closes gh-36167
2026-01-18 15:39:58 +01:00
Michał Pisarski 3f390d55f0 Add overloaded sendAndReceive methods to JmsOperations and JmsTemplate to use explicit response queue
Signed-off-by: Michał Pisarski <pisekfm@o2.pl>
2026-01-17 00:16:15 +01:00
Juergen Hoeller 2b96a61063 Apply transactionIsolationLock in EclipseLinkConnectionHandle as well
Closes gh-36165
2026-01-16 23:12:07 +01:00
Juergen Hoeller c55351aa4a Remove javadoc references to WebLogic API
See gh-36151
2026-01-16 22:50:46 +01:00
Juergen Hoeller 48bedd0af1 Revise DefaultMessageListenerContainer connection recovery
Includes listener validation for consistent back-off behavior.

Closes gh-36143
2026-01-16 22:38:01 +01:00
Juergen Hoeller c1b0e68d6c Bring back WebLogicJtaTransactionManager for WebLogic 15.1.1
Closes gh-36151
2026-01-16 22:37:20 +01:00
rstoyanchev fe2113f5a3 Clear Netty channel attribute
Closes gh-36158
2026-01-16 17:21:27 +00:00
Sam Brannen 2ff2a89f22 Upgrade to Gradle 9.3
Closes gh-36161
2026-01-16 15:41:31 +01:00
Brian Clozel 14641c4299 Next development version (v7.0.4-SNAPSHOT) 2026-01-15 09:26:50 +01:00
Juergen Hoeller 62fd09dfa5 Polishing 2026-01-14 22:05:06 +01:00
Sam Brannen 9df19dedaf Revise wording for PauseMode documentation
See gh-36044
2026-01-14 17:02:22 +01:00
Sam Brannen 01a57a7219 Simplify DefaultContextCache implementation by using entrySet().removeIf() 2026-01-14 13:47:44 +01:00
Sam Brannen b5c2003c51 Fix variable name 2026-01-14 13:44:04 +01:00
Sam Brannen 5f5da06467 Upgrade to JUnit 6.0.2
Closes gh-36149
2026-01-14 13:00:31 +01:00
rstoyanchev 9f19b4074d Exclude DataAccessException and MessagingException in DisconnectedClientHelper
Closes gh-36134
2026-01-14 11:44:43 +00:00
Yanming Zhou a784eb0ab4 Improve DisconnectedClientHelper to better guard ClassNotFoundException
Before this commit, WebClientException is ignored if RestClientException is not present.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-01-14 11:03:09 +00:00
Sam Brannen fa404063ab Avoid unnecessary pausing of application contexts for tests
In commit 9711db787e, we introduced support for disabling test
application context pausing via a Spring property or JVM system
property, as follows.

-Dspring.test.context.cache.pause=never

However, users may actually be interested in keeping the pausing
feature enabled if contexts are not paused unnecessarily.

To address that, this commit introduces a new
PauseMode.ON_CONTEXT_SWITCH enum constant which is now used by default
in the DefaultContextCache.

With this new pause mode, an unused application context will no longer
be paused immediately. Instead, an unused application context will be
paused lazily the first time a different context is retrieved from or
stored in the ContextCache. This effectively means that an unused
context will not be paused at all if the next test class uses the same
context.

Although ON_CONTEXT_SWITCH is the now the default pause mode, users
still have the option to enable context pausing for all usage scenarios
(not only context switches) by setting the Spring property or JVM
system property to ALWAYS (case insensitive) — for example:

-Dspring.test.context.cache.pause=always

This commit also introduces a dedicated "Context Pausing" section in
the reference manual.

See gh-36117
Closes gh-36044
2026-01-14 11:37:37 +01:00
Sam Brannen 948af8bcc6 Fix typo in Javadoc 2026-01-14 11:37:37 +01:00
Juergen Hoeller e3997e3060 Upgrade to Reactor 2025.0.2 and Micrometer 1.16.2
Includes Vavr 0.11, HtmlUnit 4.21, Checkstyle 13.0

Closes gh-36144
Closes gh-36145
2026-01-14 11:29:29 +01:00
Juergen Hoeller 0323218129 Deprecate PagedListHolder and PropertyComparator for removal
Closes gh-36139
2026-01-13 21:20:38 +01:00
Brian Clozel a62699ccfc Further Gradle deprecation fixes
Closes gh-36132
2026-01-13 09:32:08 +01:00
Yejeong, Ham dd6faf62bb Build: Fix deprecated Groovy syntax in spring-aspects
Replace legacy Groovy DSL property assignment (space-separated) with
the standard assignment operator (=) in spring-aspects.gradle.

The legacy syntax is deprecated in Gradle 9 and will be removed in
Gradle 10. This change eliminates deprecation warnings during the
build and ensures future compatibility.

See gh-36132

Signed-off-by: Yejeong, Ham <dev@thelightway.kr>
2026-01-13 09:31:48 +01:00
rstoyanchev cbc2c63abc Polishing contribution
Closes gh-36125
2026-01-12 12:48:49 +00:00
hojeong 2f83e6b4b5 Update reference for API version without a value
See gh-36125

Signed-off-by: hojeong park <parkhj062@gmail.com>
Signed-off-by: hojeong <parkhj062@gmail.com>
2026-01-12 12:24:13 +00:00
Sam Brannen 19c2506476 Do not restart contexts if pausing is disabled
If the PauseMode is set to NEVER, we never pause contexts and therefore
do not need to restart them.

See gh-36117
2026-01-12 12:24:18 +01:00
Brian Clozel ee4780fab6 Build javadoc against HttpClient 5.6.x 2026-01-12 12:11:26 +01:00
Sam Brannen 8e6d44349d Polishing 2026-01-12 11:50:03 +01:00
Sam Brannen ceb6ab3c74 Introduce ContextCacheTestSuite 2026-01-12 11:48:31 +01:00
Sébastien Deleuze 7140ab5bca Simplify TransactionalOperator.executeAndAwait
This commit simplifies TransactionalOperator.executeAndAwait by removing
Optional. It is based on a proposal by @vlsi refined to handle properly
reactive transaction commits (see related commit
217b6e37a6).

Closes gh-36039
2026-01-12 10:52:39 +01:00
rstoyanchev 615c25d4fa Polishing contribution
Closes gh-36126
2026-01-12 09:51:17 +00:00
Juhwan Lee 3df66580f3 Support property placeholders in HTTP service registry
Implement EmbeddedValueResolverAware to resolve ${...} placeholders
in @HttpExchange URL attributes.

See gh-36126
Signed-off-by: Juhwan Lee <jhan0121@gmail.com>
2026-01-12 08:56:35 +00:00
Sam Brannen 9711db787e Introduce Spring property to disable context pausing for tests
Spring Framework 7.0 introduced support for pausing inactive
application contexts between test classes and restarting them once they
are needed again. If pausing and restarting are fast, this feature does
not have a negative impact on test suites.

However, if the pausing or restarting of certain Lifecycle components
in the application context is slow, that can have a negative impact on
the duration of the overall test suite.

In gh-36044, we hope to find a way to avoid unnecessarily pausing an
application context after a test class if the same context is used by
the next test class that is run. That should help reduce the risk of a
negative impact caused by the pause/restart feature; however, for
certain scenarios that may not be enough. In light of that, this commit
introduces a mechanism for completely disabling the pausing feature via
a Spring property or JVM system property, as follows.

-Dspring.test.context.cache.pause=never

See gh-35168
See gh-36044
Closes gh-36117
2026-01-11 11:42:14 +01:00
Yanming Zhou d3a385d222 Retain original requested bean class for SpringContainedBean
Closes GH-36115

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2026-01-09 19:52:22 +01:00
Juergen Hoeller 38a397873e Polishing 2026-01-09 19:33:52 +01:00
Juergen Hoeller 73fa708905 Fix SmartFactoryBean type matching for ResolvableType.NONE
Closes gh-36123
2026-01-09 19:33:32 +01:00
rstoyanchev 23a532ed82 Polishing contribution
Closes gh-36097
2026-01-09 15:06:07 +00:00
Nabil Fawwaz Elqayyim e0db67aa3b Fix double encoding in DefaultApiVersionInserter
Ensure that the DefaultApiVersionInserter does not re-encode existing parts
of the input URI by using the 'encoded' flag in UriComponentsBuilder.

This prevents percent-encoded characters (like %20) from being incorrectly
double-encoded to %2520 during the version insertion process.

See gh-36097

Signed-off-by: Nabil Fawwaz Elqayyim <master@nabilfawwaz.com>
2026-01-09 15:06:07 +00:00
Sam Brannen 1370a833ed Further clarify the meaning of maxAttempts in FixedBackOff and ExponentialBackOff
See gh-36119
2026-01-09 15:37:32 +01:00
Sam Brannen 8d4320e9ef Honor headers in AbstractMessageSendingTemplate.convertAndSend() variant
Prior to this commit, the following method in AbstractMessageSendingTemplate
simply ignored the supplied headers map.

convertAndSend(Object, Map<String, Object>, MessagePostProcessor)

Closes gh-36120
2026-01-09 15:04:47 +01:00
Sam Brannen c53a00a6c4 Polish Javadoc 2026-01-09 15:04:47 +01:00
Sam Brannen 00606d2171 Use default destination name with JmsClient.sendAndReceive() and headers
Prior to this commit, if the JmsClient was configured with a default
destination name (instead of a default Destination), invoking the
sendAndReceive() variant which accepts a map of headers resulted in an
exception stating that a default destination is required.

To address that, this commit overrides the
convertSendAndReceive(Object, Map<String, Object>, Class<T>, MessagePostProcessor)
method in JmsMessagingTemplate to add support for both a default
Destination and a default destination name.

Closes gh-36118
2026-01-09 15:04:47 +01:00
Juergen Hoeller 3e5d8d184a Clarify back-off attempts versus retries for BackOff maxAttempts setting
Closes gh-36119
2026-01-09 14:32:59 +01:00
rstoyanchev b69cbad38d Fall back on the value type in BodyInserters if necessary
Closes gh-36078
2026-01-09 11:52:18 +00:00
rstoyanchev 39106b5811 Restore ApiVersionResolver contract
Instead of making it async and having a sync subinterface variant,
this restores ApiVersionResolver to be as it was with an async
subinterface variant.

ApiVersionStrategy, and the infrastructure invoking it, remains
async first, but also accommodates sync resolvers.

This should provide a better balance with backwards compatibility
while also accommodating async version resolution as the less
common scenario.

See gh-36084
2026-01-09 10:25:44 +00:00
rstoyanchev 2f91baa71c Polishing in ApiVersionResolver 2026-01-09 09:38:53 +00:00
rstoyanchev d8e303f95b Merge branch for PR 36084
Resolve conflicts and refactor merged code in AbstractHandlerMapping

See gh-36084
2026-01-08 17:43:35 +00:00
rstoyanchev 8ff89ffda2 Update contribution
- deprecate sync method on ApiVersionResolver
- add SyncApiVersionResolver
- refactor resolverParseAndValidateApiVersion method

See gh-36084
2026-01-08 17:41:27 +00:00
rstoyanchev dcf5d69d94 Rename async methods
See gh-36084
2026-01-08 17:41:19 +00:00
rstoyanchev 7d33a87278 Polishing contribution
See gh-36084
2026-01-08 17:41:11 +00:00
Jonathan Kaplan b878771dca Update ApiVersionResolver to return Mono String
See gh-36084

Signed-off-by: Jonathan Kaplan <jkaplan@empty-nes.com>
2026-01-08 17:41:01 +00:00
Sam Brannen 06f0f2f317 Polishing 2026-01-08 18:32:57 +01:00
Sam Brannen f16474d585 Reliably resolve overloaded write methods in PropertyDescriptorUtils
Prior to this commit, the algorithm behind determineBasicProperties()
in PropertyDescriptorUtils did not reliably resolve the correct write
method when one candidate write method had a parameter type that was a
subtype of another candidate write method whose parameter type was an
exact match for the resolved read method's return type.

In other words, the algorithm always resolved the candidate write
method with the most specific parameter type (similar to covariant
return types) which is not necessarily the resolved read method's
return type.

To address that, this commit ensures that determineBasicProperties()
always selects an exact match for the write method whenever possible.

As an added bonus, determineBasicProperties() no longer invokes
BasicPropertyDescriptor.getWriteMethod(), which avoids triggering the
resolution algorithm multiple times (when multiple write method
candidates exist), resulting in lazy resolution of the write method the
first time client code invokes getWriteMethod().

Closes gh-36113
2026-01-08 18:13:46 +01:00
Sam Brannen dfb17d84d6 Reintroduce deleted text in Javadoc 2026-01-08 18:11:55 +01:00
Sébastien Deleuze eea9130ea6 Fix context class resolution for nested types
This commit introduces ContextClassRequestBodyAdvice which adds a
"contextClass" hint allowing to resolve generics for Optional,
HttpEntity or ServerSentEvent container types.

Closes gh-36111
2026-01-08 16:53:28 +01:00
Sébastien Deleuze d85ac300bb Update JsonView advices Javadoc
Make the documentation relevant for all Jackson converters.
2026-01-08 16:53:19 +01:00
Sébastien Deleuze d4d10dc75d Enable JacksonSmileEncoderTests#annotEncodeServerSentEvent
This test has been fixed at some (unidentified) point and should be
enabled.
2026-01-08 16:49:11 +01:00
Juergen Hoeller 169465cce1 Align InvocationRejectedException javadoc with TaskRejectedException
See gh-36109
See gh-36114
2026-01-08 16:18:14 +01:00
Juergen Hoeller c4d5e3c57d Add task rejection support to SyncTaskExecutor's concurrency throttle
Closes gh-36114
2026-01-08 15:51:17 +01:00
Juergen Hoeller 38f5f4de8e Add configurable throttle policy to @ConcurrencyLimit annotation
Closes gh-36109
2026-01-08 15:50:57 +01:00
Sébastien Deleuze 644072f7ea Refine the AOT Cache creation section
Put Java 25+ snippet first and refine the note.

Closes gh-36108
2026-01-08 14:50:14 +01:00
Mikhail Polivakha 859940b824 Polishing of the AOT cache documentation
See gh-36108
Signed-off-by: Mikhail Polivakha <mikhailpolivakha@email.com>
2026-01-08 14:49:21 +01:00
Sam Brannen 992ae2ea6b Precompute PropertyDescriptor array in SimpleBeanInfoFactory
Closes gh-36112
2026-01-08 13:34:03 +01:00
Sam Brannen 589a10e6e6 Polish Javadoc formatting 2026-01-08 13:25:15 +01:00
Sam Brannen 79bd2b11da Polishing 2026-01-08 13:23:23 +01:00
Sam Brannen 0624c3a597 Introduce tests for non-generic types for PropertyDescriptorUtils
This commit introduces tests for proper support for non-generic types
in PropertyDescriptorUtils.determineBasicProperties(), effectively to
test the status quo and serve as regression tests.
2026-01-08 13:15:53 +01:00
Sébastien Deleuze bf695c058d Configure Jackson XML codecs when present
Closes gh-35752
2026-01-08 11:52:38 +01:00
Sébastien Deleuze a1204a405a Introduce Jackson XML codecs
See gh-35752
2026-01-08 11:52:38 +01:00
rstoyanchev e0aa116217 Re-initialize API version in each HandlerMapping
Each HandlerMapping may have its own ApiVersionStrategy rules, or may not
have one at all. This change ensures independent decisions.

See gh-36059
2026-01-08 09:32:34 +00:00
Philip Bolting 7fdda1cf0f Fix typo in MVC REST Error Responses documentation
Signed-off-by: Philip Bolting <pb@philipbolting.de>
2026-01-08 08:40:31 +01:00
rstoyanchev 05b98b0a32 Suppress API version errors on ERROR dispatch
While an API version may be important for mapping in an ERROR dispatch,
it is more important to allow the original exception to be handled.

Closes gh-36058
2026-01-07 16:00:40 +00:00
rstoyanchev 46efd930f0 Update docs
On the order of a ControllerAdvice that overrides the handling of
built-in exceptions in a scenario with Boot autoconfig.

Closes gh-35982
2026-01-07 16:00:39 +00:00
rstoyanchev a9027ddf76 Refine handling of API version errors
Among HandlerMapping's some may not expect an API version. This is why
those that do must be careful not to raise API validation errors if
they don't match the request.

Closes gh-36059
2026-01-07 16:00:39 +00:00
rstoyanchev 5551292639 Polishing contribution
Closes gh-35989
2026-01-07 16:00:39 +00:00
Minkyu Park 1240962d68 Optimize single-char wildcard path matching performance
Use lazy evaluation in SingleCharWildcardedPathElement to avoid
unnecessary Character.toLowerCase() calls.
Resolves performance TODO from 2017.

Closes gh-36095

Signed-off-by: Minkyu Park <rb6609@naver.com>
2026-01-07 14:37:54 +01:00
Brian Clozel 9ef4ceb047 Polishing contribution
Closes gh-36083
2026-01-07 14:29:13 +01:00
hayden.rear c7413cbdfc Configure HttpMessageConverters as a list
This commit adds a new `configureMessageConvertersList` method on the
builder to add/remove/move converters in the resulting list before they
are individually post-processed.

This allows to re-introduce a behavior that was missing with the new
contract: the ability to append a converter at the end of the list.

See gh-36083

Signed-off-by: hayden.rear <hayden.rear@gmail.com>
2026-01-07 14:29:05 +01:00
Sam Brannen e94aaab288 Improve exception message for JPA entity scanning 2026-01-07 13:13:27 +01:00
Sébastien Deleuze c5044bfdbc Refine multipart-forms.adoc
See gh-36094
2026-01-07 12:49:25 +01:00
Tran Ngoc Nhan 9abe4b46ca Fix Kotlin example in Multipart Content
Closes gh-36094
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-07 12:20:59 +01:00
Sébastien Deleuze 192da6229c Fix locale interceptor code snippet
See gh-36105
See gh-36099
2026-01-07 09:52:33 +01:00
Sébastien Deleuze e1402fd252 Upgrade Antora dependencies
Closes gh-36105
2026-01-07 09:51:04 +01:00
Sébastien Deleuze 253eb28458 Update CBOR Jackson codec Javadoc
See gh-20513
2026-01-06 18:26:26 +01:00
Brian Clozel 97cd9dd03b Support HttpComponents 5.6
This commit updates the HttpComponents HttpClient to refer to the parsed
`HttpEntity` for the content-related HTTP response headers such as
encoding and body length.

Closes gh-36100
2026-01-06 16:56:45 +01:00
Sébastien Deleuze 3027d78f40 Modernize the DispatcherServlet Locale documentation
The Java sample for "Locale Interceptor" shows a
`urlHandlerMapping.setUrlMap(Map.of("...` line due the inability to
disable the code chomping Asciidoctor extension with the code include
one. It will be fixed by a subsequent commit or a bug fix in
https://github.com/spring-io/asciidoctor-extensions.

Closes gh-36099
2026-01-06 11:04:05 +01:00
Sébastien Deleuze d752e80356 Add missing line to MVC config interceptors snippet
To ensure consistency with Kotlin and XML snippets.
2026-01-06 11:04:05 +01:00
Sam Brannen e7f019bd3f Introduce tests for PropertyDescriptorUtils with bounded generics
As a follow up to commit 4b07edbaeb, this commit introduces tests for
PropertyDescriptorUtils.determineBasicProperties() using types with
bounded generics.

Note, however, that the following test effectively fails, since
PropertyDescriptorUtils.determineBasicProperties() does not match the
behavior of java.beans.Introspector. Consequently, this test method
currently changes the expected write method type conditionally.

resolvePropertiesWithUnresolvedGenericsInSubclassWithOverloadedSetter()

See gh-36019
2026-01-05 17:12:59 +01:00
Sébastien Deleuze 6939cb90df Add ServerRequest.bindAndAwait Kotlin extension
Closes gh-36092
2026-01-02 18:06:27 +01:00
Sébastien Deleuze 3ddaf51f5d Remove @EnableWebFlux from documentation code snippets
Like what we did for `@EnableWebMvc`, we want to remove `@EnableWebFlux`
from typical code snippets extending WebFluxConfigurer to make them more
Spring Boot friendly.

Closes gh-36091
2026-01-02 18:06:27 +01:00
Sébastien Deleuze 6a28f06b2e Extract some WebFlux functional snippets
See gh-36089
2026-01-02 18:06:27 +01:00
Sébastien Deleuze 5ecece91dc Polishing
See gh-36089
2026-01-02 18:06:26 +01:00
Tran Ngoc Nhan 13d7a6c480 Fix Kotlin snippets in "CORS" and "Functional Endpoints" sections
Closes gh-36089
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2026-01-02 18:05:34 +01:00
Sébastien Deleuze 6e66af15a6 Extract remaining WebMVC configuration snippets
Closes gh-36088
2025-12-31 12:15:12 +01:00
Sébastien Deleuze cd8e38448c Remove the "Other Web Frameworks" documentation
Closes gh-36086
2025-12-31 10:58:44 +01:00
Sébastien Deleuze 93ce99ea06 Polishing 2025-12-31 10:58:44 +01:00
Sébastien Deleuze bf8a1600e5 Add missing override annotations to PropagationContextElement
Closes gh-36087
2025-12-31 10:58:43 +01:00
Sébastien Deleuze 96eee8c8b1 Make nullability flexible in ConverterFactory#getConverter
This commits udpates ConverterFactory#getConverter to accept both
nullable and non-null T in the Converter return value.

Flexible nullability at ConverterFactory type level would have been
ideal, but is not possible due to how Kotlin deals with Class<T> when
T is nullable.

See gh-36063
2025-12-30 16:07:39 +01:00
Tran Ngoc Nhan b8ed4f2ba8 Correct encode Javadoc for UriComponents and UriComponentsBuilder
Closes gh-36040
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-12-30 15:26:08 +01:00
Tran Ngoc Nhan 0048f01074 Fix links in client-builder.adoc
Closes gh-36079
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-12-30 15:11:52 +01:00
Sébastien Deleuze 0b904a878d Fix indentation in framework-docs.gradle 2025-12-30 15:04:14 +01:00
Sébastien Deleuze 9c78f84915 Modernize the view technologies section
Closes gh-35450
2025-12-30 15:03:34 +01:00
Sébastien Deleuze a55309d478 Null-mark org.springframework.test.web.support package
See gh-36054
2025-12-29 17:09:53 +01:00
Sébastien Deleuze 46fb7c026c Upgrade to nullability plugin 0.0.9
This commit also replaces Arch Unit packageInfoShouldBeNullMarked() rule
by either configuring requireExplicitNullMarking = false when the whole
module does not have JSpecify annotations, or explicit @NullUnmarked
when some have and some don't.

See gh-36054
2025-12-29 17:09:53 +01:00
Manu Sridharan d36244ee56 Update to NullAway 0.12.15 and fix new warnings
Closes gh-36054
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2025-12-29 17:09:52 +01:00
Sam Brannen 4b07edbaeb Reliably resolve generic read/write methods in PropertyDescriptorUtils
Prior to this commit, the determineBasicProperties() method in
PropertyDescriptorUtils did not reliably resolve read/write methods in
type hierarchies with generics. This utility method is used by
SimpleBeanInfoFactory which is used by BeanUtils and BeanWrapperImpl.
Thus, failure to reliably resolve read/write JavaBeans methods resulted
in bugs in certain scenarios.

For example, BeanUtils.copyProperties() randomly failed to copy certain
properties if the write method for the property could not be resolved.

To address such issues, this commit revises the implementation of
PropertyDescriptorUtils as follows.

1) Read methods with covariant return types are now consistently
   resolved correctly.

2) If multiple ambiguous write methods are discovered, the algorithm now
   checks for an exact match against the resolved generic parameter type
   as a fallback.

Closes gh-36019
2025-12-29 12:18:23 +02:00
Brian Clozel eb3bfc0d65 Document HttpHeaders#toSingleValueMap() case-sensitive behavior
This commit updates the `HttpHeaders` javadoc to better reflect that
`asSingleValueMap()`, `asMultiValueMap()`, and `toSingleValueMap()` all
return case-sentitive map implementations.

Closes gh-36070
2025-12-29 11:02:28 +01:00
木葉 Scarlet d077e043d6 Consistently declare @⁠Nullable on parameter in equals() implementations
Closes gh-36075

Signed-off-by: 木葉 Scarlet <93977077+mukjepscarlet@users.noreply.github.com>
2025-12-29 11:43:49 +02:00
Sam Brannen 7212fbe36a Polishing 2025-12-29 11:43:23 +02:00
Juergen Hoeller 5b6c231788 Use dedicated ApplicationEventFactory interface in EventPublicationInterceptor
See gh-36072
2025-12-25 11:25:54 +01:00
Juergen Hoeller aeb0115605 Introduce MethodRollbackEvent for @Transactional rollbacks
Closes gh-36073
2025-12-24 18:54:39 +01:00
Juergen Hoeller 08104100d3 Introduce generalized MethodFailureEvent for use in EventPublicationInterceptor
Closes gh-36072
2025-12-24 18:50:04 +01:00
Brian Clozel 214cb2c1e1 Polishing contribution
Closes gh-36056
2025-12-23 15:33:20 +01:00
Terry Tao 26e0f550b0 Fix LinkedCaseInsensitiveMap entrySet case-insensitivity
See gh-36056

Signed-off-by: Terry Tao <yueyang.tao@gmail.com>
2025-12-23 15:33:14 +01:00
Brian Clozel 012fb29097 Fix nullness mismatch for Converter/ConverterFactory
In gh-35947, the `Converter` contract was refined to allow for nullable
return values. This created a mismatch with the `ConverterFactory`
contract.

This commit fixes this mismatch by allowing nullable return values in
`Converter` instances created by `ConverterFactory`.

Fixes gh-36063
2025-12-23 11:37:44 +01:00
Juergen Hoeller 92a43c007a Introduce MethodRetryEvent for @Retryable execution
Closes gh-35382
2025-12-23 09:28:23 +01:00
Brian Clozel fc1ff88ede Avoid duplicate flushes in String Http converter
Prior to this commit, the `StringHttpMessageConverter` would perform a
flush after writing the body, via `StreamUtils#copy`. This operation is
not needed as a flush is already performed by the abstract class.

Flush calls by HTTP message converters is being reconsidered altogether
in gh-35427, but we should first remove this extra operation.

Closes gh-36065
2025-12-22 15:34:41 +01:00
Juergen Hoeller fc2e1dd2e5 Avoid redirection for JUnit javadoc link 2025-12-21 22:07:14 +01:00
Juergen Hoeller ffd2e03a9f Upgrade to Log4J 2.25.3, Protobuf 4.33.2, Selenium 4.39 2025-12-21 22:01:11 +01:00
Juergen Hoeller fd6e15bb4d Align execute(TaskCallback) declaration with return value nullability
See gh-36057
2025-12-21 21:44:10 +01:00
Juergen Hoeller 85c6fb0fd0 Add invoke(Runnable) as variant of invoke(Supplier)
See gh-36052
2025-12-21 21:40:50 +01:00
Juergen Hoeller 0b2bb7e751 Declare TaskCallback return value as potentially nullable
Closes gh-36057
2025-12-20 15:21:14 +01:00
Juergen Hoeller faa17abdae Introduce invoke(Supplier) with last original RuntimeException propagated
Closes gh-36052
2025-12-20 15:20:58 +01:00
Brian Clozel 89ca8e6976 Document how to discard response body with WebTestClient
This commit better documents the ways to discard the response body with
`WebTestClient`.

Closes gh-35953
2025-12-19 16:48:57 +01:00
Brian Clozel 7353ab41d2 Fix memory leak in WiretapConnector
Prior to this commit, we found in gh-35953 that using the `WebTestClient`
the following way leaks data buffers:

```
var body = client.get().uri("download")
  .exchange()
  .expectStatus().isOk()
  .returnResult()
  .getResponseBodyContent();
```

Here, the test performs expectations on the response status and headers,
but not on the response body. The WiretapConnector already supports this
case by subscribing to the Flux response body in those cases and
accumulating the entire content as a single byte[].

Here, the `DataBuffer` instances are not decoded by any `Decoder` and
are not released. This results in a memory leak.

This commit ensures that the automatic subscription in
`WiretapConnector` also releases the buffers automatically as the DSL
does not allow at that point to go back to performing body expectations.

Fixes gh-36050
2025-12-19 16:10:33 +01:00
Stéphane Nicoll f1db0ef036 Do not display error location when unknown
Closes gh-36041
2025-12-17 14:33:14 +01:00
Stéphane Nicoll e9a4b93477 Expose compiler warnings in CompilationException
This commit improves TestCompiler to expose both errors and warnings
instead of an opaque message. When compilation fails, both errors and
warnings are displayed.

This is particularly useful when combined with the `-Werror` option
that turns the presence of a warning into an error.

Closes gh-36037
2025-12-17 14:33:14 +01:00
Juergen Hoeller 86e89d53a9 Do not attempt nested PropertyHandler resolution for argument conversion
Includes fix for return type declaration in PropertyAccessor subclasses.

See gh-36024
2025-12-17 14:30:44 +01:00
Juergen Hoeller c813577908 Consistently use DefaultParameterNameDiscoverer.getSharedInstance()
This includes MethodParameter resolving getParameterName() by default now.
initParameterNameDiscovery(null) can be used to suppress such resolution.

Closes gh-36024
2025-12-17 13:39:02 +01:00
Brian Clozel ec6b7730a2 Polishing contribution
Closes gh-36032
2025-12-17 12:35:30 +01:00
jher235 fc29d88778 Use StringBuilder in JdbcTemplate for batch updates
See gh-36032

Signed-off-by: jher235 <tim668666@gmail.com>
2025-12-17 12:35:30 +01:00
Brian Clozel 033df68da6 Fix Javadoc links 2025-12-17 10:21:30 +01:00
Brian Clozel df5b06dabc Fix RfcUriParser parsing for single char fragments
Prior to this commit, the `RfcUriParser` would ignore URI fragments if
their length is < 2. This commit fixes the length check to allow for
single char fragments when parsing URIs.

Fixes gh-36029
2025-12-17 09:51:53 +01:00
Juergen Hoeller 3d8d7ffa1e Upgrade to AspectJ 1.9.25, Tomcat 11.0.15, Netty 4.2.9, Jackson 3.0.3, EclipseLink 5.0.0-B13, Mockito 5.21, Checkstyle 12.3 2025-12-16 13:55:36 +01:00
Juergen Hoeller 6d5a512d90 Suppress serial warning 2025-12-16 13:54:40 +01:00
Sébastien Deleuze d4e4250bb1 Remove JavaScript/Kotlin from ScriptEngine documentation
Closes gh-27919
2025-12-15 18:43:09 +01:00
Sam Brannen 93bc022a46 Extract CopyPropertiesTests as nested test class in BeanUtilsTests 2025-12-15 18:11:35 +01:00
Sam Brannen a4c72c8fcf Polish integration tests 2025-12-15 15:05:05 +01:00
Juergen Hoeller 3d7862abb6 Upgrade to Hibernate ORM 7.2.0.Final 2025-12-15 14:27:39 +01:00
Juergen Hoeller 7fd0c5041d Use default ConstraintValidatorFactory for provider-internal validators
Closes gh-36012
2025-12-15 14:26:58 +01:00
Juergen Hoeller d99ace81c1 Enforce publicly accessible method for externalClassLoader(ClassLoader)
Closes gh-36012
2025-12-14 14:48:33 +01:00
Sam Brannen ed451c107f Polishing 2025-12-13 17:11:05 +01:00
Sam Brannen 452257eb96 Revise contribution
See gh-36022
2025-12-13 17:10:06 +01:00
Tran Ngoc Nhan a7863a0877 Fix typos and grammar in reference manual
Closes gh-36022

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-12-13 16:50:39 +01:00
Sam Brannen 1da0e13a2b Polishing 2025-12-12 15:41:23 +01:00
Stéphane Nicoll ee6a156275 Refresh GitHub Actions 2025-12-12 11:51:11 +01:00
Brian Clozel 0b6fe8dcc5 Next development version (v7.0.3-SNAPSHOT) 2025-12-11 17:34:57 +01:00
Juergen Hoeller e2c9dc7138 Revert to previous behavior for 7.0.2 (based on Boot/Data impact)
Preparing the revised behavior for 7.1 instead.

See gh-31456
2025-12-11 15:37:41 +01:00
Sam Brannen 1818161f58 Ensure bottom-up semantics in resolveDefaultContextConfigurationAttributes()
Closes gh-31456
2025-12-11 13:37:32 +01:00
Sam Brannen 8916ee9f81 Set inheritLocations to true in ContextConfigurationAttributes constructor
Closes gh-36000
2025-12-11 13:06:50 +01:00
Brian Clozel d835fe311d Do not send null HTTP header value in JdkClientHttpRequest
Prior to this commit, the `JdkClientHttpRequest` would add all values
from `HttpHeaders` to the native request builder. This could cause
`NullPointerException` being thrown at runtime because the `HttpClient`
does not support that.

This commit replicates a fix that was applied to the
`SimpleClientHttpRequest`, turning null values into empty "".

Fixes gh-35996
2025-12-11 09:45:30 +01:00
rstoyanchev 0eefac21c9 Polishing contribution
Closes gh-35758
2025-12-10 18:17:12 +00:00
Samuel Gulliksson e99791f289 Improve i18n-support for NoResourceFoundException.
Return the requested resource as ErrorResponse.getDetailMessageArguments,
making it usable with message customization and i18n.

See gh-35758

Signed-off-by: Samuel Gulliksson <samuel.gulliksson@gmail.com>
2025-12-10 18:17:12 +00:00
Sam Brannen 658775b914 Avoid unnecessary list creation & processing in AbstractTestContextBootstrapper
Closes gh-35995
2025-12-10 18:56:57 +01:00
Sam Brannen ea7a1d789e Resolve ContextLoader only once in AbstractTestContextBootstrapper
Closes gh-35994
2025-12-10 18:56:50 +01:00
Sam Brannen 4ae471df01 Resolve all default context configuration within @⁠Nested hierarchy
Prior to this commit, if an enclosing test class (such as one annotated
with @⁠SpringBootTest or simply @⁠ExtendWith(SpringExtension.class))
was not annotated with @⁠ContextConfiguration (or @⁠Import with
@⁠SpringBootTest), the ApplicationContext loaded for a @⁠Nested test
class would not use any default context configuration for the enclosing
test class.

Effectively, a default XML configuration file or static nested
@⁠Configuration class for the enclosing test class was not discovered
by the AbstractTestContextBootstrapper when attempting to build the
MergedContextConfiguration (application context cache key).

To address that, this commit introduces a new
resolveDefaultContextConfigurationAttributes() method in
ContextLoaderUtils which is responsible for creating instances of
ContextConfigurationAttributes for all superclasses and enclosing
classes. This effectively enables AbstractTestContextBootstrapper to
delegate to the resolved SmartContextLoader to properly detect a
default XML configuration file or static nested @⁠Configuration class
even if such classes are not annotated with @⁠ContextConfiguration.

Closes gh-31456
2025-12-10 18:56:42 +01:00
Sam Brannen 75e3f44a7b Update Javadoc due to changes in retry support
See gh-35940
2025-12-10 16:45:43 +01:00
Juergen Hoeller adcd7cb4cb Introduce RetryListener#onRetryableExecution callback with RetryState
Closes gh-35940
2025-12-10 15:09:33 +01:00
Sam Brannen d0be180a69 Make @​Retryable and RetryTemplate timeout tests more robust
See gh-35963
2025-12-10 14:22:42 +01:00
Sam Brannen 3731fed4ca Revise MultiValueMapCollector implementation and tests
See https://github.com/spring-projects/spring-data-commons/issues/3420
Closes gh-35958
2025-12-10 13:35:00 +01:00
u214578 bfc02cda0c Introduce MultiValueMapCollector for use with streams
See https://github.com/spring-projects/spring-data-commons/issues/3420
See gh-35958

Signed-off-by: Florian Hof <florian.hof@sbb.ch>
2025-12-10 13:28:59 +01:00
Sam Brannen f734d04a0d Fix grammar 2025-12-10 13:28:59 +01:00
Sam Brannen ce4c9ebe3c Polishing 2025-12-10 12:31:26 +01:00
Brian Clozel 7c4801304d Upgrade to Reactor 2025.0.1
Closes gh-35985
2025-12-09 22:19:53 +01:00
Brian Clozel 2731183420 Upgrade to Micrometer 1.16.1
Closes gh-35984
2025-12-09 22:18:03 +01:00
Sam Brannen 38cf4ab3fc Make RetryTemplate timeout tests more robust
See gh-35963
2025-12-09 17:03:41 +01:00
Sam Brannen 2137ec70d2 Make @​Retryable timeout tests more robust
See gh-35963
2025-12-09 16:56:53 +01:00
Sam Brannen 61201db704 Improve error message for preemptive timeout in RetryTemplate
The error message in such cases now indicates that the retry process
is being aborted preemptively due to pending sleep time.

For example:

  Retry policy for operation 'myMethod' would exceed timeout (5 ms) due
  to pending sleep time (10 ms); preemptively aborting execution

See gh-35963
2025-12-09 16:46:44 +01:00
Sam Brannen 2643c6212f Delete obsolete test code 2025-12-09 16:39:20 +01:00
Sam Brannen b46328a000 Fix broken assertions in @​Retryable timeout tests
See gh-35963
2025-12-09 16:38:05 +01:00
Sam Brannen cc4c693db7 Log RetryException for @Retryable methods
To improve diagnostics, this commit logs a DEBUG message including the
RetryException thrown by RetryTemplate when it's used behind the scenes
for @Retryable method invocations.

Closes gh-35983
2025-12-09 16:24:00 +01:00
Sam Brannen a206ea8b12 Make @​Retryable timeout tests more robust
See gh-35963
2025-12-09 16:10:43 +01:00
Sam Brannen 9f1d9fe82c Support timeouts in @​Retryable and RetryPolicy
Specifically, this commit introduces:

- timeout and timeoutString attributes in @​Retryable

- a default getTimeout() method in RetryPolicy

- a timeout() method in RetryPolicy.Builder

- an onRetryPolicyTimeout() callback in RetryListener

- support for checking exceeded timeouts in RetryTemplate (also used
  for imperative method invocations with @​Retryable)

- support for checking exceeded timeouts in reactive pipelines with
  @​Retryable

Closes gh-35963
2025-12-09 14:06:35 +01:00
Juergen Hoeller ab33000750 Do not keep target connection after failed settings
Includes aligned setReadOnly exception suppression.

Closes gh-35980
2025-12-09 12:59:27 +01:00
Juergen Hoeller e2ab9cd5da Use composed cache key for different SmartFactoryBean object types
Closes gh-35974
2025-12-09 12:59:19 +01:00
Sam Brannen 103db5429a Use AtomicIntegerAssert 2025-12-09 12:43:18 +01:00
Sam Brannen 68f8139206 Polishing 2025-12-08 17:11:38 +01:00
Sam Brannen a9da900b5b Fix test logic 2025-12-08 17:10:27 +01:00
Brian Clozel e7e4b3559a Polishing contribution
Closes gh-35978
2025-12-08 16:10:20 +01:00
Johnny Lim feb77f924a Fix SubscriberInputStream.resume()
See gh-35978

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-12-08 16:10:05 +01:00
Brian Clozel 12c3dc0cbe Fix compressed HEAD requests handling in JDK client
Prior to this commit, the `JdkClientHttpRequestFactory` would support
decompressing gziped/deflate encoded response bodies but would fail if
the response has no body but has a "Content-Encoding" response header.
This happens as a response to HEAD requests.

This commit ensures that only responses with actual message bodies are
decompressed.

Fixes gh-35966
2025-12-08 15:23:55 +01:00
Juergen Hoeller df27627516 Accept assignable match for covariant return type
See gh-35936
2025-12-08 12:41:43 +01:00
Sam Brannen 939aa84214 Revise type-level nullability in ConvertingComparator
This commit revises the type-level nullability declaration in
ConvertingComparator in order to adapt to recent nullability changes in
Converter.

This commit also revises the workaround in commit 53d9ba879d.

See gh-35947
2025-12-08 11:22:14 +01:00
Brian Clozel 9f77f401ad Complete Propagator.Getter implementation
As of Micrometer Tracing 1.6.0, the `Propagator.Getter` interface
adds a new `getAll` method with a default implementation return a
singleton collection.

This commit adds the missing implementation override in both Servlet and
Reactor web server contexts.

Fixes gh-35965
2025-12-08 11:07:30 +01:00
Sébastien Deleuze f19f1a667c Add support for package-private BeanRegistrar
Closes gh-35803
2025-12-05 17:04:51 +01:00
Sébastien Deleuze 69207c6c16 Introduce BeanFactoryInitializationCode#getClassName
See gh-35803
2025-12-05 17:04:51 +01:00
Sébastien Deleuze f61832ecb8 Fix indentation 2025-12-05 17:04:51 +01:00
Juergen Hoeller 14790493f4 Upgrade to Log4J 2.25.2, Groovy 5.0.3, Jetty 12.1.5, Jetty Reactive HttpClient 4.1.4, Checkstyle 12.2 2025-12-05 17:03:57 +01:00
Juergen Hoeller 53d9ba879d Suppress NullAway warning for nullable Annotation return value 2025-12-05 16:53:24 +01:00
Juergen Hoeller 9d2d9ae0ff Reinstate stopOrder test
See gh-35964
2025-12-05 16:30:00 +01:00
Juergen Hoeller c74af40288 Stop already started Lifecycle beans on cancelled refresh
Closes gh-35964
2025-12-05 16:14:27 +01:00
Juergen Hoeller 196c1dd51c Handle absolute file URLs in getClassPathManifestEntriesFromJar
Closes gh-35682
2025-12-05 16:13:30 +01:00
Sam Brannen 44689b9ec0 Simplify RestTestClientIntegrationTests and remove duplicate field 2025-12-05 16:00:42 +01:00
Sam Brannen b916dc962e Document that annotations which reference types not present are ignored
Add warnings to the class-level Javadoc for MergedAnnotations,
AnnotatedTypeMetadata, AnnotationMetadata, and MethodMetadata to point
out that annotations may be ignored if their attributes reference types
that are not present in the classpath.

Closes gh-35959
2025-12-05 15:50:02 +01:00
Tran Ngoc Nhan 87d0113b25 Correct Reactive Libraries reference link
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-12-05 14:09:02 +00:00
rstoyanchev cee185ce3b Append query on redirect in UrlHandlerFilter
Closes gh-35873
2025-12-05 12:35:32 +00:00
rstoyanchev e45727d4fa Polishing in InMemoryWebSessionStore
Closes gh-35866
2025-12-05 12:29:11 +00:00
Mengqi Xu bc088ebdef Allow configuring default maxIdleTime on InMemoryWebSessionStore.
See gh-35866

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-12-05 12:28:37 +00:00
Sam Brannen f1cf91c9f9 Polishing 2025-12-05 12:22:24 +01:00
Sébastien Deleuze d36475cb4c Use flexible generic type level nullability in Converter
Allow defining converters that return non-null values by
leveraging flexible generic type level nullability in
org.springframework.core.convert.converter.Converter.

Closes gh-35947
2025-12-05 07:28:52 +01:00
Sébastien Deleuze 8b6d7e0da7 Refine KotlinDetector#hasSerializableAnnotation
Refine KotlinDetector#hasSerializableAnnotation in order to detect
deeply nested generic types.

Closes gh-35960
2025-12-04 15:54:03 +01:00
Sam Brannen 0a86a7e3a8 Use == instead of instanceof for primitive array type checks
Closes gh-35962
2025-12-04 15:06:08 +01:00
rstoyanchev 8edde374bb Lower bad requests to DEBUG level in AbstractHandshakeHandler
Closes gh-35930
2025-12-04 09:07:55 +00:00
rstoyanchev 35b58cd0ee Avoid http - web.utils package cycle
Closes gh-35952
2025-12-04 09:07:55 +00:00
Juergen Hoeller dfc900c7c4 Add @Override to existing resetCaches() methods
See gh-35845
See gh-35840
2025-12-04 07:09:21 +01:00
Juergen Hoeller 07c0213f20 Polishing 2025-12-04 00:12:31 +01:00
Juergen Hoeller 667851c0fa Avoid computeIfAbsent for createMappings which calls back into same map
Closes gh-35944
2025-12-04 00:12:22 +01:00
Juergen Hoeller 96aadc2b12 Add resetCaches() method to general CacheManager interface
Closes gh-35845
See gh-35840
2025-12-04 00:12:13 +01:00
Sam Brannen 2c6ccaea05 Use simple type name for meta-annotation in log message
In contrast to the previous commit, a warning similar to the following
is now logged in such cases.

WARN o.s.c.a.MergedAnnotation -
  Failed to introspect meta-annotation @MyAnnotation on class
  example.Config: java.lang.TypeNotPresentException:
  Type example.OptionalDependency not present

See gh-35927
2025-12-03 17:15:53 +01:00
Sam Brannen 62d09be2ae Log warning if meta-annotation is ignored due to types not present
Prior to this commit, if a meta-annotation could not be loaded because
its attributes referenced types not present in the classpath, the
meta-annotation was silently ignored.

To improve diagnostics for such use cases, this commit introduces WARN
support in IntrospectionFailureLogger and revises AttributeMethods.canLoad()
to log a warning if a meta-annotation is ignored due to an exception
thrown while attempting to load its attributes.

For example, a warning similar to the following is now logged in such
cases.

WARN o.s.c.a.MergedAnnotation -
  Failed to introspect meta-annotation @example.MyAnnotation on class
  example.Config: java.lang.TypeNotPresentException:
  Type example.OptionalDependency not present

This commit also improves log messages in AnnotationTypeMappings.

Closes gh-35927
2025-12-03 17:00:24 +01:00
Stéphane Nicoll 47f65b3dff Use correct product name for IntelliJ IDEA 2025-12-02 16:54:56 +01:00
Sam Brannen c7e24a5c26 Update antora-extensions to 1.14.7
Closes gh-35949
2025-12-02 15:33:56 +01:00
Sam Brannen a493bd959d Fix nullability in TestContextAnnotationUtils.findAnnotationDescriptor() 2025-12-02 15:32:32 +01:00
Juergen Hoeller 92e9543ad4 Select method with resolved return type match (among multiple candidates)
Removes unnecessary array type check for parameters of candidate methods.

Closes gh-35936
2025-12-01 23:25:59 +01:00
ivonaest 68231aa08c Upgrade json-path to 2.10.0
Closes gh-35924
Signed-off-by: ivonaest <ivona.cvija@est.tech>
2025-12-01 15:27:45 +01:00
Juergen Hoeller 71d18ebabc Improve debug log for received message 2025-12-01 15:03:08 +01:00
Juergen Hoeller 3ccb0786db Clear remaining invoker resources when releasing shared Connection
Closes gh-35932
2025-12-01 15:03:00 +01:00
rstoyanchev 15c16d2c3a FragmentsRendering exposes its fragments
Closes gh-35775
2025-12-01 11:17:40 +00:00
John Niang 5dcb85db8d BindingContext constructor uses given ReactiveAdapterRegistry arg
Closes gh-35771

Signed-off-by: John Niang <johnniang@foxmail.com>
2025-12-01 11:07:11 +00:00
rstoyanchev 4ae03ecd40 Use channelId for ReactorNettyWebSocketSession's id
Closes gh-35883
2025-12-01 11:01:04 +00:00
jnizet 1603045c7d Avoid passing null as argument marked as non-nullable
Closes gh-35933
Signed-off-by: jnizet <jb@ninja-squad.com>
2025-12-01 10:29:20 +01:00
Juergen Hoeller ace2b2bac9 Upgrade to Hibernate ORM 7.2.0.CR3 2025-11-30 11:32:33 +01:00
Juergen Hoeller f082c435e1 Polishing 2025-11-30 11:31:10 +01:00
Juergen Hoeller c6810334ca Move extended web data binders to common support packages
This resolves cyclic dependencies between function and annotation-based packages.

See gh-35800
2025-11-30 11:31:04 +01:00
Juergen Hoeller 3b90311c17 Revise ApplicationContext#getId() nullability to non-null
Closes gh-35925
2025-11-28 13:58:11 +01:00
Sam Brannen 946fc65712 Stop linking to 6.1.22-SNAPSHOT reference docs
With this commit, we now include snapshots for main (which currently
correlates to 7.0.x), 6.2.x, and 7.0.x to 9.*.x.

Closes gh-35923

(cherry picked from commit 305a512a55)
2025-11-28 13:00:22 +01:00
Juergen Hoeller fd25e2f468 Use concurrent set for reactive transaction synchronizations
Closes gh-35921
2025-11-28 10:24:21 +01:00
Sébastien Deleuze 46ceedf992 Refine AbstractKotlinSerializationHttpMessageConverter#canWrite
AbstractKotlinSerializationHttpMessageConverter#writeInternal is able to
resolve the ResolvableType from the Object parameter when the provided
one via the ResolvableType parameter is not resolvable, but
AbstractKotlinSerializationHttpMessageConverter#canWrite lacks of
such capability.

This commit refines
AbstractKotlinSerializationHttpMessageConverter#canWrite to resolve the
ResolvableType from the Class<?> parameter when the provided one via the
ResolvableType parameter is not resolvable.

Closes gh-35920
2025-11-27 16:52:45 +01:00
Brian Clozel a4b3111928 Make HttpEntity headers mutables
Since its inception, instantiating an `HttpEntity` makes its
`HttpHeaders` read-only. While immutability is an interesting design
principle, here we shouldn't enforce this.

For example, developers can expect to instantiate a `ResponseEntity`
and still mutate its headers.

Closes gh-35888
2025-11-27 16:37:47 +01:00
Juergen Hoeller 4c4161c8c0 Cache resolved singleton beans in injected Provider instance
Includes alignment for direct Optional injection points, consistently registering an autowiredBeanNames entry for an Optional as well as a non-Optional injection result.

Closes gh-35373
Closes gh-35919
2025-11-27 16:01:57 +01:00
Juergen Hoeller 61d5413c23 Tighten cacheable decision behind @Lazy injection point
Closes gh-35917
2025-11-27 16:00:43 +01:00
Brian Clozel 08e6d762d2 Always buffer response body in RestTestClient
Prior to this commit, `RestTestClient` tests could only perform
expectations on the response without consuming the body. In this case,
the client could leak HTTP connections with the underlying HTTP library
because the response was not entirely read.

This commit ensures that the response is always fully drained before
performing expectations. The client is configured to buffer the response
content, so further body expectations are always possible.

Fixes gh-35784
2025-11-27 15:50:00 +01:00
Sébastien Deleuze 7a19cbb452 Change AbstractSmartHttpMessageConverter canRead/canWrite overrides
Extending AbstractSmartHttpMessageConverter typically requires to
override both Class and ResolvableType variants of canRead. This was not
intended as SmartHttpMessageConverter interface has default methods
doing the conversion from Class parameters to ResolvableType ones, but
AbstractHttpMessageConverter overrides it.

This commit changes AbstractSmartHttpMessageConverter canRead/canWrite
overrides from ResolvableType to Class ones that delegate to the
ResolvableType variants. It also refines
AbstractJacksonHttpMessageConverter accordingly.

Closes gh-35916
2025-11-27 15:38:35 +01:00
Juergen Hoeller 2f1e1d483a Remove early adaptation to JTA 2.1 setReadOnly method
The UserTransaction read-only semantics are still in discussion. If they turn out to be stricter than Spring's read-only hint, we should only apply them when configured with an explicit enforceReadOnly=true flag at the Spring JtaTransactionManager level (similar to the same-named flag in DataSourceTransactionManager).

See gh-35915
See gh-35633
2025-11-27 13:16:45 +01:00
Sam Brannen 24d152cdab Convert sentence to tip in Kotlin testing chapter
This commit also moves the text to a more appropriate section of the
chapter.
2025-11-27 12:37:06 +01:00
Sam Brannen cc530d4df2 Support RuntimeBeanReference(name, type) in AOT-generated code
The RuntimeBeanReference(name, type) constructor was introduced in 7.0;
however, BeanDefinitionPropertyValueCodeGeneratorDelegates in our AOT
infrastructure was not updated to support the new constructor.

This commit revises BeanDefinitionPropertyValueCodeGeneratorDelegates
to ensure that AOT generated code for a RuntimeBeanReference uses the
RuntimeBeanReference(name, type) constructor, thereby retaining the
originally configured bean name.

See gh-35101
Closes gh-35913
2025-11-27 11:37:46 +01:00
Juergen Hoeller 6c3132cb8c Narrow method annotation check in hasQualifier to setter methods
Closes gh-35908
2025-11-26 23:01:55 +01:00
Juergen Hoeller a15274d431 Revise volatile access to singletonInstance field
For defensiveness against a singletonInstance/initialized visibility mismatch, we accept the locking overhead for pre-initialized null values (where we need the initialized field) in favor of a defensive fast path for non-null values (where we only need the singletonInstance field).

Closes gh-35905
2025-11-26 17:20:11 +01:00
Tran Ngoc Nhan 45d4fd3b7e Fix broken Javadoc links to methods
Closes gh-35899
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-11-26 17:05:16 +01:00
Sam Brannen 3fd5d69939 Remove JUnit 4 based meta-annotation example
This commit also converts the examples from XML configuration files to
@⁠Configuration classes.

Closes gh-35903
2025-11-26 16:37:04 +01:00
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
Sam Brannen 6504177e7b Refer to "Spring Tools" instead of "Spring Tools for Eclipse"
Closes gh-35901
2025-11-26 16:11:41 +01:00
Sam Brannen c1125699bb Document that the SpringExtension requires JUnit Jupiter 6.0 or higher
Closes gh-35900
2025-11-26 15:47:21 +01:00
Juergen Hoeller f58d0f6aae Consistent namespace element declarations 2025-11-26 15:09:05 +01:00
Juergen Hoeller c1b6bfb681 Expose non-existent resources at the end of the sorted result
Closes gh-35895
2025-11-26 15:08:24 +01:00
Juergen Hoeller 9d4abb63d8 Clarify JMS sessionTransacted flag for local versus global transaction
Closes gh-35897
2025-11-26 15:06:22 +01:00
rstoyanchev a9a404266c Data binding from pathvars and headers in fn handlers
Closes gh-35800
2025-11-26 12:30:48 +00:00
rstoyanchev b29f4ed37e Minor refactoring in DefaultServerRequest
Ensure bind logic is shared across DefaultServerRequest and
BuiltServerRequest.

See gh-35800
2025-11-26 12:30:48 +00:00
rstoyanchev 4847ee80b0 Add required type to TypeMismatchException message args
Closes gh-35837
2025-11-26 12:30:48 +00:00
Sam Brannen f4ee120a42 Use current links to JUnit documentation
Closes gh-35892
2025-11-26 13:22:26 +01:00
Sam Brannen e625a28f6d Fix formatting for backticks in Kotlin docs 2025-11-26 13:15:56 +01:00
Sam Brannen 45c1cd9295 Link to Spring Framework Artifacts wiki page
This commit revises the Integration Testing chapter to reference the
"Spring Framework Artifacts" wiki page instead of the nonexistent
"Dependency Management" section of the reference manual.

Closes gh-35890
2025-11-26 12:55:01 +01:00
Sébastien Deleuze 2641b5d783 Polishing
See gh-35861
2025-11-26 10:27:01 +01:00
Sébastien Deleuze dc0c463137 Keep using ZoneId.of("GMT") in HttpHeaders
Otherwise some header values are changed from "GMT" to "Z" and
some tests are broken. We don't want to change the current
runtime behavior, so this commit reverts the related change to
keep using ZoneId.of("GMT") in HttpHeaders.

Closes gh-35861
2025-11-26 10:27:00 +01:00
Vincent Potucek 83bbf16e6c Modernize java.time API usages
See gh-35861
Signed-off-by: Vincent Potucek <vpotucek@me.com>
2025-11-26 10:24:34 +01:00
Juergen Hoeller 3686b89ab5 Revise proxyTargetClass handling in ResilientMethodsConfiguration and ProxyAsyncConfiguration
An annotation-specified proxyTargetClass attribute must only be applied when true, otherwise we need to participate in global defaulting.

Closes gh-35863
2025-11-25 18:03:04 +01:00
Sébastien Deleuze 85ca9f46dd Support reading unresolvable types in AbstractJacksonHttpMessageConverter
Closes gh-35889
2025-11-25 16:00:04 +01:00
Sébastien Deleuze e2287020c3 Polishing
See gh-35889
2025-11-25 16:00:04 +01:00
Sébastien Deleuze 9e18c75ff1 Fix ApiVersionConfigurer Kotlin code sample
Closes gh-35887
2025-11-25 14:51:31 +01:00
Sébastien Deleuze fb9f31d101 Update reference documentation to use Jackson 3
Closes gh-35886
2025-11-25 13:31:39 +01:00
Sébastien Deleuze 4ee0a8ee33 Refine Kotlin Serialization codec type checks
ServerSentEvent and String checks, removed from
KotlinSerializationSupport in Spring Framework 7.0, are reintroduced by
this commit at the right level (KotlinSerializationSupport for
ServerSentEvent and KotlinSerializationString(Decoder|Encoder) for
String).

Closes gh-35885
2025-11-25 13:31:39 +01:00
Sébastien Deleuze f3908832c5 Add WebFlux SSE support with GSON
Closes gh-35884
2025-11-25 13:31:39 +01:00
Sébastien Deleuze c10266e57e Fix handling of ServerSentEvent with Jackson encoder
This commit fixes ServerSentEvent handling with Jackson encoder
when no Accept header is specified.

It also moves the String checks to the JSON codec level, as they do not
make sense for binary formats.

Closes gh-35872
2025-11-25 13:31:38 +01:00
Sébastien Deleuze 1b6b163f24 Polishing 2025-11-25 12:37:45 +01:00
github-actions[bot] 8642a39a03 Update Antora Spring UI to v0.4.25
Closes gh-35876

Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-11-24 14:44:34 +01:00
github-actions[bot] f62cc98a97 Update Antora Spring UI to v0.4.22
Closes gh-35860
2025-11-24 10:12:11 +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
Brian Clozel 4bc97ad532 Next development version (v7.0.2-SNAPSHOT) 2025-11-20 11:53:27 +01:00
Sam Brannen abec289e9f Stop mentioning non-existent NestedServletException
NestedServletException has been removed from the framework.
2025-11-19 17:32:19 +01:00
Juergen Hoeller 3026f0a49b Lazily initialize ProblemDetail for picking up actual status code
Closes gh-35829
2025-11-19 17:21:32 +01:00
Sam Brannen 9fe4e7798d Fix link to MockMvc test in HtmlUnit section
See gh-35853
2025-11-19 17:17:50 +01:00
Sam Brannen d178930186 Polishing 2025-11-19 17:11:17 +01:00
Tran Ngoc Nhan 91d2a51f3f Fix cross-reference links in HtmlUnit sections
Closes gh-35853

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-11-19 16:53:49 +01:00
Juergen Hoeller f456674529 Polishing 2025-11-19 16:19:14 +01:00
Juergen Hoeller 35b8fbf901 Remove javadoc references to deprecated PropertiesBeanDefinitionReader
Closes gh-35836
2025-11-19 16:18:56 +01:00
Sébastien Deleuze 1d1851f48a Refine RestOperations Kotlin extensions nullability
This commit aligns RestOperationsExtensions.kt nullability with the
Java APIs one, like what has been done in gh-35846 for JdbcOperations.

Closes gh-35852
2025-11-19 16:08:51 +01:00
Sébastien Deleuze 23f0cfb925 Fix JdbcOperations Kotlin extensions
This commit updates JdbcOperationsExtensions.kt to:
 - Properly use the spread operator for invoking Java methods with
   a varargs parameter
 - Align JdbcOperationsExtensions return values nullability
   with the Java API (breaking change)
 - Use varargs where Java counterpart does (breaking change, undo some
   changes from gh-34668)
 - Use nullable args instead of non-nullable ones

 Closes gh-35846
2025-11-19 15:55:00 +01:00
Brian Clozel 2cca56064e Restrict "validateMultiReleaseJar" task to Java 25+
This commit configures the "validateMultiReleaseJar" Gradle task only if
the current Java runtime for Gradle is 25+.

Closes gh-35850
2025-11-19 13:55:27 +01:00
Yanming Zhou e0353fe75f Fix buildSrc:test failing on JDKs before JDK 25 with Non-English locale
See https://github.com/spring-projects/spring-framework/issues/35777#issuecomment-3551591336

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-11-19 17:43:12 +08:00
rstoyanchev f80b79bc45 Configure JsonPath in RestTestClient with MappingProvider
Closes gh-35793
2025-11-18 15:46:57 +00:00
rstoyanchev adffd3dcf6 Fix JsonConverterDelegate initialization in RestTestClient
If the RestClient was built with default message converters, then
in mutate, the saved builder also has 0 converters, and adding a
interferes with default registrations.

We need to check if there are no converters at all, and if so
use the default registrations.

See gh-35793
2025-11-18 15:46:57 +00:00
rstoyanchev 284a28659d Add isEmpty() to HttpMessageConverters
See gh-35793
2025-11-18 15:46:57 +00:00
Juergen Hoeller 57a1d4007b Fix getCacheNames() concurrent access in NoOpCacheManager
Closes gh-35842
2025-11-18 13:37:39 +01:00
Juergen Hoeller bc3431f435 Add resetCaches() method to Caffeine/ConcurrentMapCacheManager
Closes gh-35840
2025-11-18 13:37:14 +01:00
Juergen Hoeller de5b9aab55 Narrow Aware interface exclusion check to BeanFactoryAware only
Closes gh-35835
2025-11-18 13:36:29 +01:00
Sébastien Deleuze f72891c24d Upgrade to Gradle 9.2.1
Closes gh-35839
2025-11-18 10:13:56 +01:00
Sam Brannen fac8708857 Migrate CronTriggerTests to @⁠ParameterizedClass
This commit migrates CronTriggerTests to @⁠ParameterizedClass as a proof
of concept for how this can be applied across the code base.

See gh-35833
2025-11-17 16:36:57 +01:00
Sam Brannen 0342cd0904 Merge HtmlCharacterEntityDecoderTests into HtmlUtilsTests
See gh-35711
2025-11-17 15:27:51 +01:00
Brian Clozel e0fd42981a Fix compilation warnings
See gh-35711
2025-11-17 15:24:44 +01:00
Brian Clozel 87d95dc30a Polishing contribution
Closes gh-35477
2025-11-17 15:07:48 +01:00
potato 47de8b05e6 Fix HtmlUtils unescape for supplementary chars
See gh-35477

Signed-off-by: potato <65760583+juntae6942@users.noreply.github.com>
2025-11-17 15:07:42 +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
github-actions[bot] 6115c3966c Update Antora Spring UI to v0.4.20
Closes gh-35813
2025-11-17 14:23:26 +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
Sébastien Deleuze 4756a4be23 Polishing
See gh-35820
2025-11-17 11:33:56 +01:00
Tran Ngoc Nhan 40c5c5d5f0 Add Kotlin code samples for KT-22208
Closes gh-35820
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-11-17 11:33:56 +01:00
Sébastien Deleuze 6b8552b4c1 Refine ParameterizedPreparedStatementSetter nullability
This commit refines ParameterizedPreparedStatementSetter nullability
to ensure consistency with JdbcTemplate#batchUpdate.

Closes gh-35749
2025-11-17 10:31:56 +01:00
Brian Clozel f42eea183e Polishing tests
Closes gh-35678
2025-11-17 09:39:50 +01:00
Sam Brannen ebcfe113d1 Disable flaky failWhileSendingMultipartRequest() test
See gh-35678
2025-11-15 15:55:10 +01:00
Sam Brannen b133c2b346 Document semantics of SpringExtension.getApplicationContext()
Since getApplicationContext() was originally not intended to be part of
the public API, its Javadoc is intentionally sparse. However, since it
is actually a public API used by third parties, this commit improves the
documentation for getApplicationContext() by pointing out that invoking
the method actually results in the context being eagerly loaded, which
may not be desired.

This commit also updates the Javadoc for supportsParameter() along the
same lines.

Closes gh-35764
2025-11-15 15:44:21 +01:00
Sam Brannen 648629fab2 Polish Javadoc for SpringExtension 2025-11-15 15:42:32 +01:00
Sam Brannen f2bf227cd0 Upgrade to testng-engine 1.1.0 2025-11-15 12:42:24 +01:00
Brian Clozel 1260081436 Add WebClient integration test for multipart
This commit adds an integration test for `WebClient`, specifically
testing that a failure happening while pulishing the request body is
reported on the main reactive pipeline.

See gh-35678
2025-11-14 16:34:15 +01:00
Tran Ngoc Nhan 18d8d458e3 Fix typos in tests
Closes gh-35815

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-11-13 13:43:54 +01:00
Brian Clozel 1aa520162b Next development version (v7.0.1-SNAPSHOT) 2025-11-13 11:33:12 +01:00
Brian Clozel 333031e64c Merge branch '6.2.x' 2025-11-13 10:11:56 +01:00
Brian Clozel ed444eb0c1 Next development version (v6.2.14-SNAPSHOT) 2025-11-13 10:11:35 +01:00
Juergen Hoeller 888d0f9adc Upgrade to Micrometer 1.16.0
Includes Tomcat 11.0.14, Jackson 3.0.2/2.20.1, Hibernate 7.2.0.CR2, Checkstyle 12.1.2

Closes gh-35811
2025-11-13 09:31:36 +01:00
Brian Clozel 08798e05de Merge branch '6.2.x' 2025-11-13 09:19:56 +01:00
Brian Clozel da31750e5f Upgrade to Micrometer 1.14.13
Closes gh-35810
2025-11-13 09:15:09 +01:00
Brian Clozel b853203846 Upgrade to Reactor 2024.0.12
Closes gh-35809
2025-11-13 09:14:04 +01:00
Brian Clozel 89e0273244 Fix UnprocessableContent support in WebClientResponseException
Prior to this commit, `WebClientResponseException` would only support
the deprecated "unprocessable entity" status.
This commit adds the missing support for "unprocessable content" when
creating exceptions with `WebClientResponseException#create`.

Fixes gh-35802
2025-11-13 08:59:35 +01:00
Brian Clozel 8c4b30a9c7 Merge branch '6.2.x' 2025-11-12 21:58:02 +01:00
Brian Clozel 2b04df045a Upgrade to Jetty 12.0.30
Closes gh-35806
2025-11-12 21:57:31 +01:00
Brian Clozel 395ddd2ca6 Upgrade to Jetty 12.1.4
Closes gh-35805
2025-11-12 21:52:22 +01:00
Sam Brannen a5a0840f48 Stop implying that HttpHeaders implements java.util.Map 2025-11-12 18:02:30 +01:00
Sam Brannen a54618b498 Simplify HttpHeaders(HttpHeaders) constructor 2025-11-12 17:47:39 +01:00
Sam Brannen d37030b9e1 Polishing 2025-11-12 17:47:39 +01:00
Sam Brannen f62380cc7b Make WebSocketHttpHeaders compatible with HttpHeaders APIs
Prior to this commit (and despite the changes made in commit
4593f877dd), WebSocketHttpHeaders was not compatible with the
HttpHeaders(HttpHeaders) constructor or the copyOf(HttpHeaders) and
readOnlyHttpHeaders(HttpHeaders) factory methods.

To address that, this commit revises the implementation of
WebSocketHttpHeaders so that it only extends HttpHeaders, analogous to
ReadOnlyHttpHeaders. In other words, WebSocketHttpHeaders no longer
stores or delegates to a local HttpHeaders instance.

Closes gh-35792
2025-11-12 17:08:35 +01:00
Sam Brannen 93b72fa080 Polishing 2025-11-12 16:53:24 +01:00
Brian Clozel 3ac7f83900 Relax media type checks in HttpMessageConverters
Prior to this commit, `HttpMessageConverters` would assert that the
given converter in `withXmlConverter` has a media type that is equal to
"application/xml" in its list of supported converters.

This approach would not work if the given converter supports
"application/xml;charset=UTF-8" because of the strict equal check being
performed.

This commit ensures that we only consider the type and subtype of the
considered media types when comparing, removing the parameters from the
picture.

Fixes gh-35801
2025-11-12 15:50:15 +01:00
Sam Brannen deca37da4a Improve Javadoc for new HttpHeaders features 2025-11-12 15:11:33 +01:00
Sam Brannen 347040c5a4 Improve Javadoc for HttpHeaders.formatHeaders() 2025-11-12 14:17:13 +01:00
Juergen Hoeller 8999336458 Make SessionHolder publicly accessible for external resource management
Closes gh-35799
2025-11-12 14:14:04 +01:00
Brian Clozel a8b8468af0 Update Antora UI Spring to v0.4.19
This commit also updates the GitHub workflow for automatic updates to
the currently supported branches.

Closes gh-35798
2025-11-12 12:32:08 +01:00
rstoyanchev b648e226cd Update deprecation notices in WebTestClient 2025-11-12 10:54:46 +00:00
rstoyanchev fb8bbe838d Polishing in RouterFunctions
See gh-35791
2025-11-12 10:52:04 +00:00
rstoyanchev dff0858340 Update generics on WebMvc RouterFunctions.Builder
Same as 7555d0e489, but for WebMvc.

Closes gh-35791
2025-11-12 08:07:36 +00: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 40544e096f Fix typo in ProxyMethodInvocation javadoc 2025-11-11 19:42:02 +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
Juergen Hoeller 39d29c8f7e Replace ConcurrentReferenceHashMap with synchronized IdentityHashMap
Closes gh-35788
2025-11-11 19:31:08 +01:00
Sam Brannen 4593f877dd Fix HttpHeaders and WebSocketHttpHeaders interop issues
Since HttpHeaders no longer implements MultiValueMap (see gh-33913),
a few interoperability issues have arisen between HttpHeaders and
WebSocketHttpHeaders.

To address those issues, this commit:

- Revises addAll(HttpHeaders), putAll(HttpHeaders), and putAll(Map) in
  HttpHeaders so that they no longer operate on the HttpHeaders.headers
  field.

- Overrides addAll(String, List), asSingleValueMap(), and
  asMultiValueMap() in WebSocketHttpHeaders.

- Deletes putAll(HttpHeaders), putAll(Map), and forEach(BiConsumer) in
  WebSocketHttpHeaders, since they do not need to be overridden.

This commit also removes unnecessarily overridden Javadoc in
WebSocketHttpHeaders and revises the implementation of several methods
in HttpHeaders so that they delegate to key methods such as get()
instead of directly accessing the HttpHeaders.headers field.

See gh-33913
Closes gh-35792
2025-11-11 18:29:29 +01:00
Sam Brannen a3e8a173a8 Polishing 2025-11-11 16:52:07 +01:00
Juergen Hoeller 15a3f425cb Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/util/ConcurrentReferenceHashMap.java
2025-11-11 15:42:11 +01:00
Juergen Hoeller 5c5367a1be Polishing 2025-11-11 15:40:08 +01:00
Juergen Hoeller 12dd758158 Provide compute method implementations in ConcurrentReferenceHashMap
Closes gh-35794
2025-11-11 15:39:21 +01:00
Sébastien Deleuze 687c40454f Merge branch '6.2.x' 2025-11-11 13:54:35 +01:00
Sébastien Deleuze 5aec239261 Add hints for entities package-private methods
Closes gh-35711
2025-11-11 13:52:59 +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
rstoyanchev 721c40b5c5 Add defaultVersion to set of supported versions
Closes gh-35755
2025-11-11 12:28:28 +00:00
rstoyanchev 7555d0e489 Update generics on WebFlux RouterFunctions.Builder
Consistently allow subtypes of ServerResponse to be returned for any
provided HandlerFunction and HandlerFilterFunction. Both allow use of
subtypes such as EntityServerResponse and RenderingResponse, and
in the end we support any ServerResponse.

Closes gh-35791
2025-11-11 12:28:28 +00:00
Sébastien Deleuze 622251d89a Merge branch '6.2.x' 2025-11-11 13:00:16 +01:00
Dmitry Sulman d0ff8f9243 Fix HttpServiceMethod for suspending functions returning Flow
Closes gh-35718
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-11-11 12:58:42 +01:00
Sam Brannen e4f8ae0338 Stop setting local port in HtmlUnitRequestBuilder
This commit picks up where commit a0baeae9cf left off.

Specifically, in order to align with the behavior of
AbstractMockHttpServletRequestBuilder, HtmlUnitRequestBuilder no longer
sets the local port in the MockHttpServletRequest.

See gh-35709
2025-11-10 17:20:23 +01:00
Brian Clozel e85afff8a3 Merge branch '6.2.x' 2025-11-10 16:30:50 +01:00
Brian Clozel ba39385cce Use executor for blocking I/O in Reactor request factory
Prior to this commit, the `ReactorClientHttpRequestFactory` and the
`ReactorClientHttpRequest` would use the `Executor` from the current
event loop for performing write operations.
Depending on I/O demand, this work could be blocked and would result in
blocked Netty event loop executors and the HTTP client hanging.

This commit ensures that the client uses a separate Executor for such
operations. If the application does not provide one on the request
factory, a `Schedulers#boundedElastic` instance will be used.

Fixes gh-34707
2025-11-10 16:12:14 +01:00
rstoyanchev 9daf99af3f Merge branch '6.2.x' 2025-11-10 14:43:58 +00:00
rstoyanchev e735c2d9c5 Improve Filter overview in reference docs
Closes gh-30454
2025-11-10 14:43:34 +00:00
rstoyanchev 3cb498fa98 Improve docs on streaming via StreamingHttpOutputMessage
Closes gh-35700
2025-11-10 14:43:34 +00:00
Sam Brannen c6b4b43076 Merge branch '6.2.x' 2025-11-10 15:39:18 +01:00
Sam Brannen 335a2c4e21 Support response encoding in select and options JSP form tags
Prior to this commit, Spring Framework's JSP form tags supported the
response encoding in most places; however, <form:select> and
<form:options> still did not support the response character encoding.

To address that, this commit updates SelectTag, OptionsTag, and
OptionWriter to provide support for response character encoding in the
`select` and `options` JSP form tags.

See gh-33023
Closes gh-35783
2025-11-10 15:35:13 +01:00
Sam Brannen 1714a00492 Suppress warnings in Gradle build 2025-11-10 14:13:34 +01:00
Sébastien Deleuze 543390c84f Merge branch '6.2.x' 2025-11-10 12:04:15 +01:00
Chandra Bhan Singh ddb45a9302 Correct documentation formatting for Mono type
Closes gh-35786
Signed-off-by: Chandra Bhan Singh <cbhansingh1@gmail.com>
2025-11-10 12:03:37 +01:00
Sébastien Deleuze 816cee12e5 Change default converters ordering
This commit adds a new withKotlinSerializationCborConverter
method to HttpMessageConverters and updates DefaultHttpMessageConverters
to put JSON and CBOR Kotlin Serialization converters before
their Jackson/GSON/JSONB counterparts with their new default
behavior that only handles classes with `@Serializable` at
type or generics level.

When there is no alternative converter for the same mime type,
Kotlin Serialization converters handle all supported cases.

Closes gh-35761
2025-11-10 11:36:00 +01:00
Sébastien Deleuze d64edc01c0 Prevent Kotlin Serialization converters side effects
This commit updates Kotlin serialization converters to perform
an additional check invoking
KotlinDetector#hasSerializableAnnotation to decide if the
related type should be processed or not.

The goal is to prevent in the default arrangement conflicts
between general purpose converters like Jackson and
Kotlin serialization when both are used.

New constructors allowing to specify a custom predicate
are also introduced.

See gh-35761
2025-11-10 11:35:44 +01:00
Sébastien Deleuze d0f57013b0 Change default codecs ordering and add Jackson CBOR
This commit updates BaseDefaultCodecs by adding Kotlin
Serialization codecs before their Jackson/GSON counterparts
with their new default behavior that only handles classes with
`@Serializable` at type or generics level.

When there is no alternative codec for the same mime type,
Kotlin Serialization codecs handle all supported cases.

This commit also adds missing Jackson CBOR codecs, and moves both
CBOR and Protobuf codecs to a lower priority, as they are less
commonly used than JSON ones, with the same ordering used on
Spring MVC side.

See gh-35761
Closes gh-35787
2025-11-10 11:35:29 +01:00
Sébastien Deleuze 19dd488dd7 Prevent Kotlin Serialization codecs side effects
This commit updates Kotlin serialization codecs to perform
an additional check invoking
KotlinDetector#hasSerializableAnnotation to decide if the
related type should be processed or not.

The goal is to prevent in the default arrangement conflicts
between general purpose codecs like Jackson and
Kotlin serialization when both are used.

New constructors allowing to specify a custom predicate
are also introduced.

See gh-35761
2025-11-10 11:35:02 +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
Brian Clozel 771517dc36 Ensure that jar verification runs on JDK 25
This commit ensures that the JAR verification task runs on JDK 25 as
this feature has been introduced in https://bugs.openjdk.org/browse/JDK-8355940

Fixes gh-35777
See gh-35773
2025-11-10 09:57:06 +01:00
Sam Brannen 388abf9312 Fix Javadoc link 2025-11-09 16:05:06 +01:00
Sam Brannen e91befa5bb Polishing 2025-11-09 15:24:26 +01:00
Juergen Hoeller 5353c964ef Upgrade to Hibernate Validator 9.1.0.Final 2025-11-08 12:14:16 +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 38555df3d8 Fix Aware exclusion check to apply to interface method only
See gh-35780
2025-11-08 09:53:17 +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
Sébastien Deleuze d9580fd436 Upgrade to Reactor 2025.0.0
Closes gh-35779
2025-11-08 08:28:42 +01:00
Sam Brannen 386c6cafc9 Fix typo in test 2025-11-07 16:13:16 +01:00
Brian Clozel 1bf8756f20 Add integration tests for validateMultiReleaseJar task
This commit also renames the "validateJar" task to
"validateMultiReleaseJar".

Closes gh-35768
2025-11-07 15:20:27 +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
Sam Brannen a0baeae9cf Fix port handling in HtmlUnitRequestBuilder
Prior to this commit, HtmlUnitRequestBuilder set the server port in the
MockHttpServletRequest to -1 if the URL did not contain an explicit
port. However, that can lead to errors in consumers of the request that
do not expect an invalid port number.

In addition, HtmlUnitRequestBuilder always set the remote port in the
MockHttpServletRequest to the value of the server port, which does not
make sense, since the remote port of the client has nothing to do with
the port on the server.

To address those issues, this commit revises HtmlUnitRequestBuilder so
that it:

- Does not set the server and local ports if the explicit or derived
  default value is -1.
- Consistently sets the server and local ports to the same valid value.
- Does not set the remote port.

Closes gh-35709
2025-11-06 15:03:41 +01:00
rstoyanchev 115dee9be1 Fix failing test
See gh-35707
2025-11-06 13:18:41 +00:00
rstoyanchev 09105eb7b2 Option to supply client builder in HttpServiceGroupConfigurer
Closes gh-35707
2025-11-06 11:58:37 +00:00
rstoyanchev 6dd40a0252 Refactoring in HttpServiceProxyRegistryFactoryBean
See gh-35707
2025-11-06 11:58:37 +00: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 49237fceae Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/annotation/QualifierAnnotationAutowireCandidateResolver.java
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-11-05 19:33:48 +01:00
Juergen Hoeller bce1445d92 Accept fallback match for bean name or method-level qualifier as well
Closes gh-35690
2025-11-05 19:31:53 +01:00
Brian Clozel 783299d24e Merge branch '6.2.x' 2025-11-05 18:36:15 +01:00
Brian Clozel 285182be27 Relax multiple segment matching constraints in PathPattern
Prior to this commit, gh-35213 allowed wildcard path elments at the
start of path patterns. This came with an additional constraint that
rejected such patterns if the pattern segment following the wildcard one
was not a literal:

* `/**/{name}` was rejected
* `/**/something/{name}` was accepted

The motivation here was to make the performance impact of wildard
patterns as small as possible at runtime.

This commit relaxes this constraint because `/**/*.js` patterns are very
popular in the security space for request matchers.

Closes gh-35686
2025-11-05 18:32:44 +01:00
Brian Clozel 9a54fac998 Merge branch '6.2.x' 2025-11-05 15:18:10 +01:00
Brian Clozel 8bb63081a8 Document PathPattern matching for single/multiple segments
This commit improves the reference document to better reflect the
different between `*` or `{name}` on one side, and `**` or `{*path}` on
the other.

The former patterns only consider a single path segment and its content,
while the latter variants consider zero or more path segments. This
explains why `/test/{*path}` can match `/test`.

Closes gh-35727
2025-11-05 14:58:58 +01:00
Sam Brannen 94d7aa2844 Suppress deprecation warnings 2025-11-05 14:55:07 +01:00
Sam Brannen 934394eb2a Document AOT workaround for @⁠PersistenceContext & @⁠PersistenceUnit in tests
Although @⁠PersistenceContext and @⁠PersistenceUnit are still not
supported in tests running in AOT mode, as of Spring Framework 7.0,
developers can inject an EntityManager or EntityManagerFactory into
tests using @⁠Autowired instead of @⁠PersistenceContext and
@⁠PersistenceUnit, respectively.

See commit 096303c477
See gh-33414
Closes gh-31442
2025-11-05 14:30:41 +01:00
rstoyanchev 798931eea8 Merge branch '6.2.x' 2025-11-05 12:24:15 +00:00
rstoyanchev b128f59714 Expose handler to ApiVersionDeprecationHandler implementations
Closes gh-35750
2025-11-05 12:23:59 +00:00
rstoyanchev cd67010518 Update Principal check in TransportHandlingSockJsService
Closes gh-35753
2025-11-05 12:23:59 +00:00
rstoyanchev a698b1bc0d Refine validation section for controllers
Closes gh-35759
2025-11-05 12:23:43 +00:00
Juergen Hoeller 585b4e08e8 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessor.java
#	spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/PersistenceManagedTypesBeanRegistrationAotProcessorTests.java
2025-11-05 12:54:30 +01:00
Juergen Hoeller 2060c340ce Upgrade to Caffeine 3.2.3, Selenium 4.38, HtmlUnit 4.18 2025-11-05 12:44:28 +01:00
Juergen Hoeller 4f97c41e58 Avoid javadoc failure for line break with annotation reference
See gh-35736
2025-11-05 12:35:09 +01:00
Juergen Hoeller 0243059f53 Polishing 2025-11-05 12:22:56 +01:00
Juergen Hoeller b027b73a7a Relax configuration class requirement in configurer callback javadoc
Closes gh-35736
2025-11-05 12:22:44 +01:00
Sébastien Deleuze e5fccd1fbb Upgrade nullability plugin to 0.0.8
Closes gh-35751
2025-11-05 11:07:53 +01:00
rstoyanchev 3b0cc2821f Restore section id's in RestTestClient docs
Recent commit a23c37 changed those due to a change in the structure,
but there is no need, and it is better to not break existing links.

See gh-35701
2025-11-05 10:06:06 +00:00
rstoyanchev 02e928e4e3 Docs for the WebTestClient AssertJ integration
Closes gh-35737
2025-11-05 10:06:06 +00:00
rstoyanchev 7445f542f4 AssertJ support for WebTestClient
Closes gh-35737
2025-11-05 10:06:06 +00:00
rstoyanchev cd8690254b Polishing in RestTestClient AssertJ support
See gh-35701
2025-11-05 10:06:05 +00:00
rstoyanchev 125002844e Add JsonConverterDelegate
The JsonConverterDelegate interface replaces usages of
HttpMessageContentConverter to provides the flexibility to use either
message converters or WebFlux codecs.

HttpMessageContentConverter is deprecated, and replaced with a package
private copy (DefaultJsonConverterDelegate) in the
org.springframework.test.json package that is accessible through
a static method on JsonConverterDelegate.

See gh-35737
2025-11-05 10:04:56 +00:00
Brian Clozel 5f895d7b1f Merge branch '6.2.x' 2025-11-05 10:51:54 +01:00
Brian Clozel c0429dbb09 Fix file extension resolution for media types with q parameter
Prior to this commit, the `MappingMediaTypeFileExtensionResolver` would
resolve file extensions for a given media type by using a direct lookup
using the given media type provided by the request.
If the request contains a quality parameter like
"application/json;q=0.9", this would not resolve configured file
extensions for this media type.
While other media type parameters can be meaningful, the quality
parameter should not be used for lookups. This commit ensures that the
quality parameter is dropped before performing lookups.

Fixes gh-35754
2025-11-05 10:48:24 +01:00
Sébastien Deleuze 5e213b2407 Upgrade nullability plugin to 0.0.7
Closes gh-35751
2025-11-04 14:19:43 +01:00
Sam Brannen b019ebee6e Document that @⁠MockitoSpyBean cannot spy on a scoped proxy
See gh-35722
2025-11-04 13:42:22 +01:00
Sam Brannen c0c94d5d86 Reject attempt to use @⁠MockitoSpyBean with a scoped proxy
Prior to this commit, an attempt to use @⁠MockitoSpyBean to spy on a
scoped proxy configured with
@⁠Scope(proxyMode = ScopedProxyMode.TARGET_CLASS) resulted in an
exception thrown by Mockito when the spy was stubbed. The exception
message stated "Failed to unwrap proxied object" but did not provide
any further insight or context for the user.

The reason is that ScopedProxyFactoryBean is used to create such a
scoped proxy, which uses a SimpleBeanTargetSource, which is not a
static TargetSource. Consequently,
SpringMockResolver.getUltimateTargetObject(Object) is not able to
unwrap the proxy.

In order to improve diagnostics for users, this commit eagerly detects
an attempt to spy on a scoped proxy and throws an exception with a
meaningful message. The following is an example, trimmed stack trace
from the test suite.

org.springframework.beans.factory.BeanCreationException:
  Error creating bean with name 'myScopedProxy': Post-processing of
  FactoryBean's singleton object failed
  ...
Caused by: java.lang.IllegalStateException:
  @⁠MockitoSpyBean cannot be applied to bean 'myScopedProxy', because
  it is a Spring AOP proxy with a non-static TargetSource. Perhaps you
  have attempted to spy on a scoped proxy, which is not supported.
    at ...MockitoSpyBeanOverrideHandler.createSpy(MockitoSpyBeanOverrideHandler.java:78)

Closes gh-35722
2025-11-04 13:27:05 +01:00
Brian Clozel ad22a99993 Merge branch '6.2.x' 2025-11-03 17:09:57 +01:00
Brian Clozel d65de19e7d Deprecate setConnectTimeout on HttpComponents client factory
Prior to this commit, the `HttpComponentsClientHttpRequestFactory` would
set the connection timeout on the request configuration. This has been
deprecated by the client itself and this value should be set while
creating the client on the connection manager itself.

This commit deprecates this method, as there is no way for the factory
to set this value anymore.

Closes gh-35748
2025-11-03 16:53:54 +01:00
Brian Clozel e6a076017b Configure custom Kotlin Serialization converter
Prior to this commit, `HttpMessageConverters` would consider the Kotlin
Serialization JSON converter as an alternative to the Jackson variant.
As seen in related issues, this converter is more commonly used for
annotated classes specifically and applications often rely on Jackson
acting as a fallback for types not supported by Kotlin Serialization.

This commit enables applications to configure such a converter on
`HttpMessageConverters` and order it ahead of of the JSON one.

Closes gh-35733
2025-11-03 14:33:12 +01:00
Sam Brannen 1fc446b3fc Provide AOT support for @⁠Nested classes in a @⁠ParameterizedClass
This commit adds AOT support for discovering @⁠Nested test classes
within a @⁠ClassTemplate test class, which includes
@⁠ParameterizedClass test classes.

Closes gh-35744
2025-11-03 12:25:37 +01:00
Sam Brannen 096303c477 Use @⁠Autowired EntityManager in Jupiter JPA tests
Switching from @⁠PersistenceContext to @⁠Autowired for dependency
injection in tests allows such tests to participate in AOT processing.

Note, however, that we still have TestNG-based tests that use
@⁠PersistenceContext — for example, AbstractEjbTxDaoTestNGTests.

See gh-29122
See gh-31442
See gh-33414
2025-11-03 12:06:57 +01:00
Sam Brannen 2f47efe2d3 Polishing 2025-11-03 12:05:34 +01:00
Sébastien Deleuze 6e7957fc22 Merge branch '6.2.x' 2025-11-03 11:15:49 +01:00
Sébastien Deleuze 16822c2fd0 Polishing
Closes gh-35746
2025-11-03 11:14:30 +01:00
Moad Elfatihi 983d39a970 Update CI documentation reference in README
Replace obsolete Concourse pipeline reference with GitHub Actions.
The Concourse link returns 404.

See gh-35746
Signed-off-by: Moad ELFATIHI <elfatihi.moad@gmail.com>
2025-11-03 11:14:14 +01:00
rstoyanchev 1ee05cc180 Update contribution
Closes gh-35698
2025-11-03 09:51:25 +00:00
Thomas Recloux 8e046b8a3c Clone RestTestClientBuilder in mutate()
See gh-35698

Signed-off-by: Thomas Recloux <trecloux@purse.eu>
2025-11-03 09:32:19 +00:00
rstoyanchev 183a9466c5 Add dedicated ApiVersionResolver implementations
Closes gh-35747
2025-11-03 09:19:38 +00:00
Juergen Hoeller 29a76a6c70 Merge branch '6.2.x'
# Conflicts:
#	spring-web/src/main/java/org/springframework/http/client/BufferingClientHttpResponseWrapper.java
2025-11-02 20:42:43 +01:00
Juergen Hoeller 4b7cf85d71 Retrieve cached response body in a thread-safe manner
Closes gh-35745
2025-11-02 20:40:02 +01:00
Juergen Hoeller 2b526efe65 Polishing 2025-11-02 17:38:50 +01:00
Juergen Hoeller a8410aa601 Merge branch '6.2.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/datasource/DataSourceUtils.java
#	spring-jdbc/src/test/java/org/springframework/jdbc/datasource/DataSourceTransactionManagerTests.java
2025-11-02 17:37:13 +01:00
Juergen Hoeller a33027703d Preserve Connection readOnly state for defaultReadOnly DataSource
Includes DataSourceTransactionManagerTests alignment with main branch.

Closes gh-35743
2025-11-02 17:28:12 +01:00
Sam Brannen 81d69216b1 Rename to MockMvcRestTestClientTests and remove use of SpringExtension
The MockMvcClientHttpRequestFactoryTests variant for RestTestClient was
copied from MockMvcClientHttpRequestFactoryTests which actually uses
MockMvcClientHttpRequestFactory. In addition,
MockMvcClientHttpRequestFactoryTests unnecessarily used the
SpringExtension.

This commit therefore renames the class to MockMvcRestTestClientTests
and removes the use of the SpringExtension.

See gh-29122
2025-11-02 16:47:38 +01:00
Sam Brannen 80b7a34942 Merge branch '6.2.x' 2025-11-02 16:24:42 +01:00
Sam Brannen ae804cb2d0 Improve @⁠NumberFormat Javadoc
See gh-35742
2025-11-02 16:23:47 +01:00
Stefano Cordio 46503d6a45 Fix typo in @⁠NumberFormat Javadoc
Closes gh-35742

Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2025-11-02 16:14:11 +01:00
Sam Brannen 9c93ece790 Merge branch '6.2.x' 2025-11-01 14:46:44 +01:00
Sam Brannen b4a13dddfc Fix JUnit Jupiter discovery issues on 6.2.x 2025-11-01 14:46:23 +01:00
Sam Brannen 205f3e392d Clean up warnings in tests 2025-11-01 14:38:39 +01:00
Sam Brannen 960df8e7a1 Merge branch '6.2.x' 2025-11-01 14:34:00 +01:00
Sam Brannen 661dca5e54 Remove accidental use of SpringExtension in ServletContextAwareBeanWacTests 2025-11-01 14:26:08 +01:00
Sam Brannen b976010a9e Simplify MockMvcClientHttpRequestFactoryTests 2025-11-01 14:26:07 +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
Sam Brannen 324b254849 Upgrade to JUnit 6.0.1 and prevent AOT scanning failure for JUnit 4 tests
This commit upgrades our test suite to use JUnit 6.0.1 and removes the
systemProperty("junit.platform.discovery.issue.severity.critical", "WARNING")
configuration from spring-test.gradle, so that all discovery issues will
fail the build for the spring-test module as well.

In addition, this commit prevents potential AOT test scanning failures
for JUnit 4 tests by setting the
"junit.vintage.discovery.issue.reporting.enabled" configuration
parameter to "false" in TestClassScanner.

See https://github.com/junit-team/junit-framework/issues/5030
Closes gh-35740
2025-11-01 12:28:59 +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
Sam Brannen f2cfc692cf Merge branch '6.2.x' 2025-11-01 11:10:34 +01:00
Sam Brannen f89737e398 Upgrade to JUnit 5.14.1
Closes gh-35739
2025-11-01 11:05:43 +01:00
Brian Clozel af026c0373 Review HttpMessageConverters semantics in Builder
Prior to this commit, the `HttpMessageConverters` builder API had
methods like "jsonMessageConverter" for configuring a specific converter
for JSON support. This converter would be always configured at a given
position, even if default converters registration is not requested.
On the other hand, `customMessageConverter` would add any converter
ahead of the list, in all cases. This difference was not conveyed as it
should by the API.

This commit makes the following changes:

* builder methods are renamed to `withJsonConverter` and variants, to
  better convey the fact that those are replacing the default converter
  for a given format.
* `customMessageConverter` is renamed to `addCustomConverter` to better
  reflect the additive aspect.
* the JavaDoc has been updated accordingly
* `withJsonConverter` and others are now only effective if the default
  registration of auto-detected converters is requested. This better
  aligns with the behavior in the reactive codecs configuration

Closes gh-35704
2025-10-31 17:18:28 +01:00
Stéphane Nicoll 03c5ea25f5 Merge branch '6.2.x' 2025-10-31 15:35:41 +01:00
Stéphane Nicoll ecdf069c5d Add AOT support for AutowiredPropertyMarker
Closes gh-35731
2025-10-31 15:30:54 +01:00
Sébastien Deleuze ce050f152e Upgrade OkHttp to 5.3.0
Closes gh-35729
2025-10-31 06:54:24 +01:00
Juergen Hoeller b2b526162f Polishing 2025-10-30 21:05:47 +01:00
Juergen Hoeller d7acdc54b4 Upgrade to Hibernate Validator 9.1.0.CR1 2025-10-30 21:05:39 +01:00
Sébastien Deleuze a705c6f32a Merge branch '6.2.x' 2025-10-30 19:42:45 +01:00
Anton Xu 01a58a253b Fix minor typo in RestClient
Closes gh-35723
Signed-off-by: Anton Xu <anton-xu@hotmail.com>
2025-10-30 19:41:56 +01:00
rstoyanchev a23c3775a8 Docs for the RestTestClient AssertJ integration
Closes gh-35701
2025-10-30 17:34:00 +00:00
Juergen Hoeller d63f1a8bea Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-10-30 17:32:16 +01:00
Juergen Hoeller f28e245baa Upgrade to Groovy 4.0.29, Jetty 12.0.29, Jackson 2.18.5 2025-10-30 17:30:21 +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 00e1429378 Polish SQLErrorCodeSQLExceptionTranslatorTests 2025-10-30 16:13:38 +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
Juergen Hoeller e6037a739e Upgrade to Groovy 5.0.2, Tomcat 11.0.13, Jetty 12.1.3, Checkstyle 12.1.1 2025-10-30 15:33:15 +01:00
Juergen Hoeller 34562d3145 Merge branch '6.2.x' 2025-10-30 15:32:36 +01:00
Sébastien Deleuze aeed3c963b Move the "Groovy Bean Definition DSL" section
This commit moves the "Groovy Bean Definition DSL"
section to the Groovy page

Closes gh-35721
2025-10-30 15:06:09 +01:00
Sébastien Deleuze 4880ed5c33 Deprecate the lang XML namespace
And remove the related reference documentation.

Closes gh-35719
2025-10-30 15:03:16 +01:00
Sébastien Deleuze b1cd508016 Deprecate the BeanShell scripting support
Closes gh-35720
2025-10-30 15:03:16 +01:00
Juergen Hoeller 5471961f06 Restore exposure of original BatchUpdateException as root cause
Closes gh-35717
See gh-35547
2025-10-30 14:59:00 +01:00
Sam Brannen d33f2c6f73 Fix Javadoc links
See gh-35697
2025-10-30 14:43:29 +01:00
rstoyanchev a8349e1c5c AssertJ support for RestTestClient
See gh-35701
2025-10-30 13:30:46 +00:00
Sam Brannen 41ae13df5d Use test-method scoped ExtensionContext in the SpringExtension
As of Spring Framework 6.2.13, we support JUnit Jupiter 5.12's
ExtensionContextScope.TEST_METHOD behavior in the SpringExtension and
the BeanOverrideTestExecutionListener; however, users can only benefit
from that if they explicitly set the following configuration parameter
for their entire test suite, which may have adverse effects on other
third-party JUnit Jupiter extensions.

junit.jupiter.extensions.testinstantiation.extensioncontextscope.default=test_method

For Spring Framework 7.0, in order to support dependency injection into
test class constructors and fields in @⁠Nested test class hierarchies
from the same ApplicationContext that is already used to perform
dependency injection into lifecycle and test methods (@⁠BeforeEach,
@⁠AfterEach, @⁠Test, etc.), we have decided to configure the
SpringExtension to use ExtensionContextScope.TEST_METHOD by default. In
addition, we have decided to provide a mechanism for users to switch
back to the legacy "test-class scoped ExtensionContext" behavior in
case third-party TestExecutionListener implementations are not yet
compatible with test-method scoped ExtensionContext and TestContext
semantics.

This commit achieves the above goals as follows.

- A new @⁠SpringExtensionConfig annotation has been introduced, which
  allows developers to configure the effective ExtensionContext scope
  used by the SpringExtension.

- The SpringExtension now overrides
  getTestInstantiationExtensionContextScope() to return
  ExtensionContextScope.TEST_METHOD.

- The postProcessTestInstance() and resolveParameter() methods in the
  SpringExtension now find the properly scoped ExtensionContext for the
  supplied test class, based on whether the @⁠Nested test class
  hierarchy is annotated with
  @⁠SpringExtensionConfig(useTestClassScopedExtensionContext = true).

See gh-35680
See gh-35716
Closes gh-35697
2025-10-30 13:54:16 +01:00
rstoyanchev b5557160e0 Merge branch '6.2.x' 2025-10-30 12:24:39 +00:00
rstoyanchev 715bc68c16 Rename methods in FragmentsRendering
Previous commit 81ea35c726 in main for 7.0
should have been applied in 6.2.x first for 6.2.1.

This commit applies the changes in 6.2.x as intended,
effective as of 6.2.13.

Closes gh-33974
2025-10-30 12:17:51 +00:00
Sam Brannen 61453bce6c Merge branch '6.2.x' 2025-10-30 11:25:55 +01:00
Sam Brannen 9c24f7ba8c Document test-method scoped TestContext semantics
Although gh-35680 introduced support for JUnit Jupiter's TEST_METHOD
ExtensionContextScope in the SpringExtension and
BeanOverrideTestExecutionListener, those were internal changes that are
not directly visible by TestExecutionListener authors.

However, in order to be compatible with a test-method scoped
TestContext (which takes its values from the current Jupiter
ExtensionContext), existing third-party TestExecutionListener
implementations may need to be modified similar to how
BeanOverrideTestExecutionListener was modified in commit d24a31d469.

To raise awareness of how to deal with such issues, this commit
documents test-method TestContext semantics for TestExecutionListener
authors.

Closes gh-35716
2025-10-30 11:22:25 +01:00
Sébastien Deleuze 9f9f0a7014 Polish suspending functions support in RSocketServiceMethod
Closes gh-35473
2025-10-30 10:51:58 +01:00
Dmitry Sulman 3190269567 Support suspending functions in RSocketServiceMethod
See gh-35473
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-10-30 10:51:27 +01:00
Sébastien Deleuze 0bcff38f8e Polishing
Closes gh-34372
2025-10-29 19:25:30 +01:00
Yasumasa Suenaga 706ea2c213 Fix potential CRaC hangup after restoring
See gh-34372
Signed-off-by: Yasumasa Suenaga <yasuenag@gmail.com>
2025-10-29 19:25:22 +01:00
Sébastien Deleuze 9a10b04fe0 Upgrade to Kotlin 2.2.21
Closes gh-35714
2025-10-29 17:09:58 +01:00
Sam Brannen 9c0f714639 Upgrade to Gradle 9.2
This commit upgrades the build to use Gradle 9.2 and reinstates the use
of the Groovy safe-navigation operator (?.) in framework-api.gradle.

See https://github.com/gradle/gradle/issues/35049
See d038269ec3
Closes gh-35713
2025-10-29 17:06:29 +01:00
rstoyanchev 0319fe9211 Deprecate Hamcrest use in WebTestClient
Closes gh-35703
2025-10-29 09:50:36 +00:00
rstoyanchev b4c6300ac6 Remove Hamcrest use from RestTestClient
Closes gh-35702
2025-10-29 09:50:36 +00:00
Juergen Hoeller 92a186b44b Merge branch '6.2.x' 2025-10-28 20:39:56 +01:00
Juergen Hoeller a40647a62f Remove empty ConstraintValidator#initialize implementations 2025-10-28 20:38:08 +01:00
Juergen Hoeller b53fb13f30 Add tests for name-based dependency resolution against util:map
See gh-35690
2025-10-28 20:34:49 +01:00
Park Juhyeong 4b7b280ac3 Optimize resource URL resolution in SortedResourcesFactoryBean
Cache resource URLs before sorting to eliminate repeated I/O calls
during comparator operations. The previous implementation called
getURL() multiple times per resource during sorting (O(n log n)
calls), and silently swallowed IOExceptions by returning 0,
potentially causing unstable sort results.

This change:
- Caches URLs once per resource before sorting (O(n) I/O calls)
- Removes unnecessary ArrayList conversions
- Provides clear exception handling with context
- Improves performance by ~70% for typical use cases

Signed-off-by: Park Juhyeong <wngud5957@naver.com>
2025-10-28 20:30:33 +01:00
Sébastien Deleuze 830f846766 Merge branch '6.2.x' 2025-10-28 15:39:02 +01:00
Sébastien Deleuze b3aefac9c3 Remove jibx-marshaller element from spring-oxm.xsd
Closes gh-35699
2025-10-28 15:38:53 +01:00
Sébastien Deleuze 694224f1a6 Remove outdated Spring version mentions
Close gh-35696
2025-10-28 13:58:09 +01:00
rstoyanchev f07873c966 Merge branch '6.2.x' 2025-10-28 12:07:46 +00:00
rstoyanchev b19059f6cb Handle null from JDK HttpResponse#body
Closes gh-35692
2025-10-28 11:44:16 +00:00
Sébastien Deleuze 6ac13d16d8 Relax BeanRegistrar checks on bean definition attributes
This commit allows legit usage of AutoProxyUtils bean definition
attributes with BeanRegistrar.

Closes gh-35645
2025-10-28 12:17:09 +01:00
Sam Brannen 179c63a7c9 Introduce EMPTY_ANNOTATION_ARRAY in ParameterResolutionDelegate 2025-10-28 12:16:11 +01:00
Sébastien Deleuze 7e671abb9f Polish MyBeanRegistrar Kotlin code sample 2025-10-28 10:05:24 +01:00
Sébastien Deleuze 618bce3bd8 Adapt MyBeanRegistrar Kotlin code sample
This commit adapts the MyBeanRegistrar Kotlin code sample to use a
lambda supplier instead of a callable reference since this capability
has been removed.

See gh-35549
Closes gh-35694
2025-10-28 09:51:22 +01:00
Sébastien Deleuze 4356fc11e1 Revert "Add support for callable references to BeanRegistrarDsl"
This reverts commit aa9ab8e545.

See gh-35694
2025-10-28 09:40:22 +01:00
Sébastien Deleuze 8d951c569b Document BeanRegistrarDsl with RouterFunctionDsl
Closes gh-35549
2025-10-27 14:07:43 +01:00
Sam Brannen 65daea1e2a Polish tests for the SpringExtension 2025-10-27 12:18:36 +01:00
Sébastien Deleuze 1ea043db28 Document automatic context propagation
Closes gh-35689
2025-10-27 11:10:53 +01:00
Sam Brannen 24b50650d7 Suppress warnings 2025-10-26 16:06:08 +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 f0a61cc9c6 Fix test failure caused by previous commit
See gh-35675
2025-10-24 13:18:40 +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
rstoyanchev af86b30aa7 Merge branch '6.2.x' 2025-10-24 13:02:40 +01:00
rstoyanchev 810e069bcc FieldError uses HexFormat to format byte[]
See gh-35675
2025-10-24 13:01:28 +01:00
Sam Brannen c42020e3a7 Merge branch '6.2.x' 2025-10-24 13:57:51 +02:00
Elijah Mock 62f42cab6b Fix minor typo in JDBC Core Classes documentation
This commit adds a missing closing parenthesis in an example.

Closes gh-35684

Signed-off-by: Elijah Mock <28277163+ekcom@users.noreply.github.com>
2025-10-24 13:56:25 +02:00
rstoyanchev 9331e1e86c Allow Protobuf codec extensions
Closes gh-35403
2025-10-23 12:16:52 +01:00
rstoyanchev 6ebb2071f5 Allow to set MimeType's in ProtobufCodecSupport
See gh-35403
2025-10-23 12:16:52 +01:00
rstoyanchev 754372a1f6 Allow ProtobufHttpMessageConverter extensions
Make ProtobufFormatDelegate protected and visible to subclasses.
Expose constructor that allows passing the delegate in.

See gh-35403
2025-10-23 12:16:52 +01:00
rstoyanchev 87607cccff Polishing in Protobuf support
See gh-35403
2025-10-23 12:16:52 +01:00
Sam Brannen 7c83892b9b Merge branch '6.2.x' 2025-10-22 19:16:07 +02:00
Sam Brannen 9ee16b8ea3 Switch back to HSQL for JpaEntityListenerTests on main 2025-10-22 19:14:26 +02:00
Sam Brannen 5f5b19a898 Merge branch '6.2.x' 2025-10-22 18:59:57 +02:00
Sam Brannen e61884e4bd Introduce tests for "No transaction in progress for @⁠Nested test class"
Since we now officially support the TEST_METHOD ExtensionContextScope
(see gh-35676 and gh-35680), this commit introduces tests which
demonstrate that the issue raised in gh-34576 is no longer an "issue" if
the user indirectly configures the SpringExtension to use the TEST_METHOD
scope via the "junit.jupiter.extensions.testinstantiation.extensioncontextscope.default"
configuration parameter.
2025-10-22 18:58:08 +02:00
Sam Brannen 0f2fc79fb7 Update exception message to use correct test class
See gh-35680
2025-10-22 18:04:13 +02:00
Sam Brannen fd6b18a07a Merge branch '6.2.x' 2025-10-22 17:09:38 +02:00
Sam Brannen ba70c1384a Polish SpringExtension internals 2025-10-22 17:07:53 +02:00
Sam Brannen d24a31d469 Support JUnit Jupiter ExtensionContextScope.TEST_METHOD
Historically, @⁠Autowired fields in an enclosing class of a @⁠Nested
test class have been injected from the ApplicationContext for the
enclosing class. If the enclosing test class and @⁠Nested test class
share the same ApplicationContext configuration, things work as
developers expect. However, if the enclosing class and @⁠Nested test
class have different ApplicationContexts, that can lead to
difficult-to-debug scenarios. For example, a bean injected into the
enclosing test class will not participate in a test-managed transaction
in the @⁠Nested test class (see gh-34576).

JUnit Jupiter 5.12 introduced a new ExtensionContextScope feature which
allows the SpringExtension to behave the same for @⁠Autowired fields as
it already does for @⁠Autowired arguments in lifecycle and test
methods. Specifically, if a developer sets the ExtensionContextScope to
TEST_METHOD — for example, by configuring the following configuration
parameter as a JVM system property or in a `junit-platform.properties`
file — the SpringExtension already supports dependency injection from
the current, @⁠Nested ApplicationContext in @⁠Autowired fields in an
enclosing class of the @⁠Nested test class.

junit.jupiter.extensions.testinstantiation.extensioncontextscope.default=test_method

However, there are two scenarios that fail as of Spring Framework
6.2.12.

1. @⁠TestConstructor configuration in @⁠Nested class hierarchies.
2. Field injection for bean overrides (such as @⁠MockitoBean) in
   @⁠Nested class hierarchies.

Commit 82c34f7b51 fixed the SpringExtension to support scenario #2
above.

To fix scenario #1, this commit revises
BeanOverrideTestExecutionListener's injectField() implementation to
look up the fields to inject for the "current test instance" instead of
for the "current test class".

This commit also introduces tests for both scenarios.

See gh-34576
See gh-35676
Closes gh-35680
2025-10-22 17:00:44 +02:00
Vedran Pavic c5ec169c83 Update JdkClientHttpRequest javadoc
This commit updates `JdkClientHttpRequest.TimeoutHandler` javadoc to
reference up-to-date JDK issue that tracks improvements to HTTP client's
request timeout handling.

Closes gh-35581

Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
2025-10-22 15:39:43 +02:00
Brian Clozel 2f66c07b0d Merge branch '6.2.x' 2025-10-22 12:31:35 +02:00
Brian Clozel a5141b187a Fix '**' parsing within a PathPattern segment
Prior to this commit, a regexp path segment ending with a double wilcard
(like "/path**") would be incorrectly parsed as a double wildcard
segment ("/**").

This commit fixes the incorrect parsing.

See gh-35679
2025-10-22 12:21:57 +02:00
Brian Clozel d3c1e678c2 Support wildcard path elements at the start of path patterns
Prior to this commit, the `PathPattern` and `PathPatternParser` would
allow multiple-segments matching and capturing with the following:

* "/files/**" (matching 0-N segments until the end)
* "/files/{*path}" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This would be only allowed as the last path element in the pattern and
the parser would reject other combinations.

This commit expands the support and allows multiple segments matching at
the beginning of the path:

* "/**/index.html" (matching 0-N segments from the start)
* "/{*path}/index.html" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This does come with additional restrictions:

1. "/files/**/file.txt" and "/files/{*path}/file.txt" are invalid,
   as multiple segment matching is not allowed in the middle of the
   pattern.
2. "/{*path}/files/**" is not allowed, as a single "{*path}" or "/**"
   element is allowed in a pattern
3. "/{*path}/{folder}/file.txt"  "/**/{folder:[a-z]+}/file.txt" are
   invalid because only a literal pattern is allowed right after
   multiple segments path elements.

Closes gh-35679
2025-10-22 12:21:57 +02:00
Sébastien Deleuze dce7518be3 Upgrade to Jackson 3.0.1
Closes gh-35677
2025-10-22 08:32:25 +02:00
Brian Clozel 914f83f4a6 Improve RestTemplate to RestClient migration guide
This commit improve the reference documentation in order to:

* highlight the deprecation status of `RestTemplate`
* improve the migration guide for `RestClient`, better explaining
  possible behavior differences and a migration strategy.

Closes gh-35620
2025-10-21 21:54:48 +02:00
Sam Brannen e937d8ee8a Remove reference to @⁠javax.inject.Inject on main 2025-10-21 18:02:12 +02:00
Sam Brannen bda8f20b0b Merge branch '6.2.x' 2025-10-21 17:43:10 +02:00
Sam Brannen 82c34f7b51 Introduce isAutowirableConstructor(Executable,PropertyProvider) in TestConstructorUtils
This commit introduces a new isAutowirableConstructor(Executable, PropertyProvider)
overload in TestConstructorUtils and deprecates all other existing variants
for removal in 7.1.

Closes gh-35676
2025-10-21 17:37:04 +02:00
Sam Brannen 3c14b42f82 Merge branch '6.2.x' 2025-10-21 16:32:00 +02:00
Sam Brannen cb0f26a152 Use consistent naming for Bean Override test classes
cherry-picked from c6e5cfe03d
2025-10-21 16:25:12 +02:00
Sam Brannen 711df0259b Merge branch '6.2.x' 2025-10-21 15:38:48 +02:00
Sam Brannen bccfbfd630 Fix previous commit for 6.2.x compatibility
See gh-35674
2025-10-21 15:37:35 +02:00
Brian Clozel 5923d36de3 Merge branch '6.2.x' 2025-10-21 13:50:25 +02:00
Brian Clozel 506b76032f Add missing reflection hints for JdbcUtils
This commit adds the missing reflection hints for `JdbcUtils`, as this
class reflects on `java.sql.Types` public fields.

Fixes gh-35674
2025-10-21 13:50:13 +02:00
Sébastien Deleuze 3bedf42fbc Fix Jetty multipart client support with Java 25
Closes gh-35531
2025-10-21 12:46:17 +02:00
Sébastien Deleuze 79795c8e09 Avoid compilation error on WebTestClient without Hamcrest
This commit removes JSpecify (TYPE_USE) annotations on
org.hamcrest.Matcher parameters to prevent a related
"Cannot attach type annotations" error when Hamcrest
(optional dependency) is not in the classpath with Java > 22.

Closes gh-35666
2025-10-21 12:18:10 +02:00
Juergen Hoeller 83edf6a4aa Adapt test for MockServletContext version
See gh-35671
2025-10-21 01:07:03 +02:00
Juergen Hoeller 687fc935a8 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/context/annotation/CommonAnnotationBeanPostProcessor.java
#	spring-test/src/main/java/org/springframework/mock/web/MockServletContext.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/servlet/MockServletContext.java
2025-10-21 01:04:38 +02:00
Juergen Hoeller 7adcd99ea2 Polishing 2025-10-21 00:59:56 +02:00
Juergen Hoeller aa625f0ba9 Consistently declare Servlet mock classes with Servlet 6.1 baseline
Closes gh-35671
2025-10-21 00:43:28 +02:00
Juergen Hoeller 7ca2a5dec5 Early support for Jakarta Servlet 6.2 and Jakarta Activation 2.2
Closes gh-35670
2025-10-21 00:42:03 +02:00
Sébastien Deleuze 29d4a91903 Comment broken Jakarta Javadoc URL 2025-10-20 17:39:00 +02:00
Sébastien Deleuze 5fd3c9c449 Fix @Import with multiple bean registrars
This commit uses a MultiValueMap instead of a Map to store bean
registrars, allowing to support multiple bean registrars imported by
the same configuration class.

Closes gh-35653
2025-10-20 17:36:51 +02:00
wakingrufus b65390828e Add a test for multiple bean registrars
This commit add a test for multiple bean registrars imported by the same
configuration class.

See gh-35653
Signed-off-by: wakingrufus <wakingrufus@gmail.com>
2025-10-20 17:36:51 +02:00
Brian Clozel cab46c74d5 Downgrade to JSONassert 1.5.x
Closes gh-34901
2025-10-20 17:14:45 +02: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
Brian Clozel 6d824586bb Polishing contribution
Fixes gh-35659
2025-10-20 15:32:36 +02:00
Damian Malczewski 8a6576eace Make HttpStatus.resolve return non-deprecated one
In previous versions, HttpStatus.resolve (or valueOf) always returned
non-deprecated HTTP status for given code. This was ensured implicitly,
by placing non-deprecated enum entries before their respective
deprecations. This was not ensured for 413 Content Too Large.

See gh-35659

Signed-off-by: Damian Malczewski <damian.m.malczewski@gmail.com>
2025-10-20 15:32:19 +02:00
Brian Clozel 5accc21223 Clean HTTP response headers after decompression in JDK client
Prior to this commit, gh-35225 introduced HTTP response body
decompression support for "gzip" and "deflate" encodings for the
`JdkClientHttpRequestFactory`.

While body decompression works, the client keeps the "Content-Encoding"
and "Content-Length" response headers intact, which misleads further
response handling: the body size has changed and it is not compressed
anymore.

This commit ensures that the relevant response headers are removed from
the HTTP response after decompression.

Fixes gh-35668
2025-10-20 11:38:25 +02:00
Juergen Hoeller b85993c7cb Add test for HibernatePersistenceConfiguration
See gh-35662
2025-10-19 10:45:57 +02:00
Juergen Hoeller 228662ad9f Derive StatelessSession from transactional Session on Hibernate 7.2
Closes gh-35664
See gh-7184
2025-10-19 10:45:43 +02:00
Juergen Hoeller c063249bd4 Consistent support for JPA 3.2 transaction timeout
Closes gh-35663
2025-10-18 15:44:41 +02:00
Juergen Hoeller b261b74793 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/CoroutinesUtils.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/DefaultPersistenceUnitManager.java
#	spring-orm/src/main/java/org/springframework/orm/jpa/persistenceunit/MutablePersistenceUnitInfo.java
#	spring-orm/src/test/java/org/springframework/orm/jpa/persistenceunit/PersistenceXmlParsingTests.java
2025-10-18 15:32:19 +02:00
Juergen Hoeller 765e30c3a6 Polishing 2025-10-18 15:30:15 +02:00
Juergen Hoeller beb224e3f9 Add support for JPA 3.2 PersistenceConfiguration
See gh-35662
2025-10-18 15:05:38 +02:00
Sam Brannen cfb268f6de Suppress warning in SmartPersistenceUnitInfoInvocationHandler 2025-10-18 13:58:11 +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
Sam Brannen 687bc7652d Avoid unnecessary import for SpringExtension's Javadoc 2025-10-18 13:35:54 +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
Brian Clozel 44de925c5e Add reflection hints for SpringPersistenceUnitInfo
Fixes gh-35655
2025-10-17 14:34:15 +02:00
Dónal Murtagh 22ecab5aab Fix code snippets in Javadoc for exchangeSuccessfully()
Closes gh-35642

Signed-off-by: Dónal Murtagh <donal.murtagh@clarusonesourcing.com>
2025-10-16 18:44:33 +02:00
Brian Clozel a7c43d90fd Merge branch '6.2.x' 2025-10-16 09:32:41 +02:00
Brian Clozel 18a879779e Next development version (v6.2.13-SNAPSHOT) 2025-10-16 09:32:20 +02:00
Juergen Hoeller 1c64f867c8 Upgrade to Netty 4.2.7
See gh-35637
2025-10-15 19:44:18 +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 b9d6a90220 Merge branch '6.2.x' 2025-10-15 16:43:06 +01:00
rstoyanchev 03c3ec1577 Fall back on remoteHost if remoteAddress is null
See gh-35589
2025-10-15 16:42:40 +01:00
Sébastien Deleuze b46c41bb3a Add first class ParameterizedTypeReference support to BeanRegistrar
This commit replaces ParameterizedTypeReference and ResolvableType
target type customization with the lambda by directly exposing
ParameterizedTypeReference methods at top level, as generics
variants of the class-based existing ones.

Closes gh-35635
2025-10-15 17:05:11 +02:00
Brian Clozel e6481a011b Deprecate "feed" and "document" view packages
Prior to this commit, Spring Framework would ship several abstract
`*View` implementations for rendering PDF, RSS or XLS documents using
well-known libraries. More recently, supporting libraries evolved a lot
with new versions and forks. Spring Framework is not in a position to
efficiently support all variants within the project.

This commit deprecates the relevant classes. Instead, libraries can
reuse existing code and ship optional support for Spring directly.
Often, updating imports and library usage is enough.
As an alternative, applications can decide to perform rendering
direclty in web handlers.

Closes gh-35451
2025-10-15 16:36:24 +02:00
Juergen Hoeller 2e4ca41382 Add getBeanProvider(ParameterizedTypeReference) overload
Closes gh-31444
2025-10-15 16:10:28 +02:00
Sébastien Deleuze 6503f35404 Upgrade nullability plugin to 0.0.6
Closes gh-35644
2025-10-15 15:55:48 +02:00
Sébastien Deleuze d23757cc1f Upgrade to Dokka 2.1.0
Closes gh-35532
2025-10-15 14:17:51 +02:00
Juergen Hoeller 7dc78a4318 Align default order between @EnableAsync and @EnableResilientMethods
Retries async methods with Future return types in non-reactive path.

Closes gh-35643
2025-10-15 13:52:44 +02:00
rstoyanchev f15c12a190 Merge branch '6.2.x' 2025-10-15 12:37:52 +01:00
rstoyanchev c88bfc54c9 Refactor state management in StompSubProtocolHandler
Closes gh-35591
2025-10-15 12:31:42 +01:00
rstoyanchev 3607f98240 Refine null handling in UriComponentsBuilder#query
Closes gh-35629
2025-10-15 12:31:08 +01:00
Schäfer, H.H. (Hans Hosea) 649bd3ee2d Do not clear queryParams UriComponentsBuilder#query
See gh-35628

Signed-off-by: Schäfer, H.H. (Hans Hosea) <HansHosea.Schaefer@ing.de>
2025-10-15 12:31:08 +01:00
Sam Brannen 1c2a24a8ed Merge branch '6.2.x' 2025-10-15 12:49:16 +02:00
Sam Brannen a96558c965 Revise commit 01acb80501
See gh-35631
2025-10-15 12:48:52 +02:00
Sébastien Deleuze 8ec9ab6698 Add builder-based constructors to Jackson 3 infrastructure
This commit also polishes documentation, constructor parameter and
field names.

Closes gh-35597
2025-10-15 11:49:55 +02:00
Sam Brannen 3493fc9324 Merge branch '6.2.x' 2025-10-15 11:30:31 +02:00
Sam Brannen 1612b7c5db Remove test prefixes 2025-10-15 11:28:49 +02:00
Sam Brannen 01acb80501 Improve exception handling in ConfigurationClassBeanDefinitionReader
Thanks to a proposal from @wilkinsona, this commit introduces a
try-catch block in loadBeanDefinitions(...) which throws an
IllegalStateException that provides context regarding the configuration
class and cause of the failure.

Closes gh-35631

Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
2025-10-15 11:26:06 +02:00
Brian Clozel 04ae53d6bb Reinstate JakartaEE javadoc linking 2025-10-15 11:11:49 +02:00
Juergen Hoeller 22cb819a14 Upgrade to Micrometer 1.16.0-RC1
Closes gh-35639
2025-10-14 19:26:06 +02:00
Juergen Hoeller 331f62fd03 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
2025-10-14 19:24:48 +02:00
Juergen Hoeller f4438ce9e3 Upgrade to Reactor 2024.0.11 and Micrometer 1.14.12
Includes Netty 4.1.128

Closes gh-35638
Closes gh-35640
2025-10-14 19:21:34 +02:00
Juergen Hoeller 5033b9d3c5 Reset by-type cache for Object after registering a new singleton
Closes gh-35634
2025-10-14 19:20:57 +02:00
Juergen Hoeller d733023a29 Consistently apply fallback attribute to proxy definition as well
See gh-35627
2025-10-14 19:17:57 +02:00
Schäfer, H.H. (Hans Hosea) df67c1cf2d 35626: defaultCandidate for scoped proxies
Signed-off-by: Schäfer, H.H. (Hans Hosea) <HansHosea.Schaefer@ing.de>
2025-10-14 19:07:03 +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
Edgar Asatryan 141df5291d Prevent NoClassDefFoundError when Jetty Reactive HttpClient not on classpath
Closes gh-35608

Signed-off-by: Edgar Asatryan <nstdio@gmail.com>
2025-10-14 16:49:10 +01:00
Sébastien Deleuze 0be22a8d71 Merge branch '6.2.x' 2025-10-14 17:45:22 +02:00
Sébastien Deleuze dcfe33f427 Fix Hibernate Javadoc to avoid a redirect 2025-10-14 17:40:44 +02:00
Sébastien Deleuze 3b4d6631c8 Upgrade to Reactor 2025.0.0-RC1
Closes gh-35637
2025-10-14 17:23:37 +02:00
rstoyanchev 9a2bfeae2f AbstractMockHttpServletRequestBuilder exposes HttpHeaders
Closes gh-35576
2025-10-14 16:21:23 +01:00
rstoyanchev 9ed3c034f5 AbstractMockHttpServletRequestBuilder uses HttpHeaders internally
See gh-35576
2025-10-14 16:21:23 +01:00
Juergen Hoeller 001fc8e585 Add early support for JTA 2.1 read-only attribute
Closes gh-35633
2025-10-14 13:25:13 +02:00
rstoyanchev 43c13ca043 Polishing contribution
Closes gh-35348
2025-10-14 11:37:40 +01:00
秦利斌 17cf2ad457 MvcUriComponentsBuilder resolves embedded values
See gh-35348

Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-10-14 11:37:24 +01:00
rstoyanchev 00190a1111 Add exchangeSuccessfully to test clients
Closes gh-35582
2025-10-14 11:37:01 +01:00
Sébastien Deleuze 180ea125d2 Stop using --report-unsupported-elements-at-runtime
This commit stop using the --report-unsupported-elements-at-runtime
deprecated option with GraalVM 25+.

Closes gh-35632
2025-10-14 11:49:34 +02: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
Sébastien Deleuze 1f2948f78c Stop using --install-exit-handlers
This commit stop using the --install-exit-handlers deprecated option
which is enabled by default with GraalVM 25+.

Closes gh-35557
2025-10-14 10:44:21 +02:00
Juergen Hoeller e901516732 Make SpringPersistenceUnitInfo public for custom bootstrapping purposes
See gh-35622
2025-10-13 23:24:46 +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
Brian Clozel f9b691cad4 Revert "Enable new build options for GraalVM 25 native image builds"
This reverts commit 9975113879.
2025-10-13 17:37:03 +02:00
Sébastien Deleuze ec77bb0032 Introduce automatic context propagation in Coroutines
Closes gh-35485
2025-10-13 16:14:25 +02:00
Sam Brannen ea27415b7b Merge branch '6.2.x' 2025-10-13 15:12:50 +02:00
Sam Brannen 2591cab561 Polishing 2025-10-13 15:12:21 +02:00
Sam Brannen 8456cd1e74 Polish contribution
See gh-35587
2025-10-13 15:12:21 +02:00
Igor Murzich 7699b4af9c Retain order of produces media types in @⁠ExceptionHandler
Closes gh-35587

Signed-off-by: Igor Murzich <imurzich@gmail.com>
2025-10-13 15:12:21 +02:00
Juergen Hoeller 6c5de48059 Ignore SQL state 3B001 in HSQLDB exception message as well
Closes gh-35618
See gh-35564
2025-10-13 15:10:20 +02:00
Sam Brannen c2ef11e1fc Remove test prefixes and avoid warnings in JDBC and TX tests 2025-10-13 14:48:03 +02:00
Juergen Hoeller d216236aac Revise PersistenceUnitInfo management for compatibility with JPA 3.2/4.0
Closes gh-35622
2025-10-13 14:23:31 +02:00
Juergen Hoeller b4dcb36b21 Align currentStatelessSession() implementation with currentSession()
See gh-7184
2025-10-13 14:17:07 +02:00
Brian Clozel 252bb8dac7 Stop building against Jakarta Javadoc
The javadoc is missing right now, temporarily disabling linking to the
Jakarta Javadoc.
2025-10-13 13:48:35 +02:00
Brian Clozel 9975113879 Enable new build options for GraalVM 25 native image builds
Closes gh-35616
2025-10-13 11:02:20 +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
Sam Brannen 0389684429 Revise contribution
See gh-35352
2025-10-11 19:37:34 +02:00
yongjunhong 8edc7cd542 Reject effectively private handler methods on CGLIB proxied controllers
This commit rejects the invocation of an effectively private handler
method on a CGLIB proxied controller for both Spring MVC and Spring
WebFlux.

Closes gh-35352

Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
Signed-off-by: Yongjun Hong <kevin0928@naver.com>
Signed-off-by: yongjunhong <yongjunh@apache.org>
2025-10-11 19:27:06 +02:00
Sam Brannen a5d9bd64be Test package pattern support for CandidateComponentsIndex and restructure tests 2025-10-11 17:02:54 +02:00
Sam Brannen 0fc7c41ddc Improve Javadoc for CandidateComponentsIndex 2025-10-11 17:00:12 +02:00
Juergen Hoeller 8f29c71e0c Upgrade to Tomcat 11.0.12, Jetty 12.1.2, Jetty Reactive HttpClient 4.1, Hibernate ORM 7.2.0.CR1, EclipseLink 5.0.0-B11, Checkstyle 12.0 2025-10-11 16:14:09 +02:00
Juergen Hoeller fef5627329 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-core/src/main/java/org/springframework/core/task/SyncTaskExecutor.java
2025-10-11 16:09:47 +02:00
Sam Brannen b727dbb802 Introduce tests for CandidateComponentsIndex.hasScannedPackage()
This indirectly tests the implementation of matchPackage(), which was
fixed in the previous commit.

See gh-35497
See gh-35601
2025-10-11 16:00:38 +02:00
NeatGuyCoding 113b9d131c Fix non-pattern package prefix check in CandidateComponentsIndex
Prior to this commit, the non-pattern package prefix check used
packageName.startsWith(basePackage) which incorrectly treats
"com.example2.foo" as a subpackage of "com.example".

Closes gh-35601

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-10-11 15:45:14 +02:00
Sam Brannen 51d6e8beb0 Polishing 2025-10-11 15:19:28 +02:00
Juergen Hoeller 9f678ce698 Upgrade to Jetty 12.0.28, Undertow 2.3.20, RxJava 3.1.12, Aalto 1.3.4, Gson 2.13.2, Selenium 4.36, HtmlUnit 4.17, Mockito 5.20, AssertJ 3.27.6 2025-10-11 15:12:21 +02:00
Juergen Hoeller 467a484df6 Polishing
See gh-35460
2025-10-11 15:11:16 +02:00
Juergen Hoeller 83efe8cff4 Remove deprecation on CandidateComponentsIndex(Loader)
See gh-35472
2025-10-11 15:10:42 +02:00
Sam Brannen 5096db4e60 Polishing 2025-10-11 13:45:53 +02:00
Sam Brannen 3eef39e6ab Polish contribution
See gh-35603
2025-10-11 13:29:05 +02:00
Simone Conte 87a7507e3a Introduce queryParamPredicate in AbstractRequestLoggingFilter
Closes gh-35603

Signed-off-by: Simone Conte <conte@adobe.com>
2025-10-11 13:29:05 +02:00
Juergen Hoeller 080bca0b23 Deprecate TransactionCallbackWithoutResult
Closes gh-35606
2025-10-11 13:25:40 +02:00
Juergen Hoeller 8b36736344 Add concurrency throttle and flexible task callback to SyncTaskExecutor
Closes gh-35460
2025-10-11 13:25:30 +02:00
Sam Brannen 26c57cecd2 Fix copy-n-paste error in Javadoc 2025-10-10 18:45:32 +02:00
Sam Brannen 19b4021d26 Polish tests 2025-10-10 18:45:20 +02:00
rstoyanchev e21fa380b3 Merge branch '6.2.x' 2025-10-10 17:25:22 +01:00
rstoyanchev 2c83144946 Use getRemoteAddr in ServletServerHttpRequest
Closes gh-35589
2025-10-10 17:24:48 +01:00
rstoyanchev c165dd5e0e Update Javadoc of reactive WebSocketHandler
Replace suggestion to use zip with and operator.

Closes gh-35572
2025-10-10 17:23:03 +01:00
Juergen Hoeller 18c93a071c Remove deprecated method (plus JSpecify alignment)
See gh-35594
2025-10-10 17:08:19 +02:00
Juergen Hoeller 8792b395a7 Merge branch '6.2.x' 2025-10-10 17:04:47 +02:00
Juergen Hoeller 449b85f446 Avoid overhead for parsing plain values and simple placeholders
Closes gh-35594
2025-10-10 17:03:34 +02:00
Sébastien Deleuze 3819e2dc4c Refine StringUtils#splitArrayElementsIntoProperties nullability
Closes gh-35595
2025-10-10 11:22:08 +02:00
Juergen Hoeller edc14c2e15 Merge branch '6.2.x'
# Conflicts:
#	spring-context-indexer/src/main/java/org/springframework/context/index/processor/StandardStereotypesProvider.java
#	spring-context/src/main/java/org/springframework/context/annotation/ClassPathScanningCandidateComponentProvider.java
#	spring-context/src/test/java/org/springframework/context/annotation/ClassPathBeanDefinitionScannerTests.java
2025-10-09 20:37:49 +02:00
Juergen Hoeller c2a66e723f Polishing 2025-10-09 20:34:03 +02:00
Juergen Hoeller 2ee34a5632 Add MySQLTableMetaDataProvider for correct generated-keys support
Closes gh-35593
2025-10-09 20:30:25 +02:00
Juergen Hoeller 1bc82d241a Remove deprecation on CandidateComponentsIndex(Loader)
Closes gh-35472
2025-10-09 20:26:59 +02:00
Juergen Hoeller 7bc2a7f3f2 Add support for programmatic CandidateComponentsIndex setup
Closes gh-35497
See gh-35472
2025-10-09 20:11:11 +02:00
Sam Brannen 97ae5fde7c Match against exception causes in @⁠Retryable and RetryPolicy
Prior to this commit, our @⁠Retryable support as well as a RetryPolicy
created by the RetryPolicy.Builder only matched against top-level
exceptions when filtering included/excluded exceptions thrown by a
@⁠Retryable method or Retryable operation.

With this commit, we now match against not only top-level exceptions
but also nested causes within those top-level exceptions. This is
achieved via the new ExceptionTypeFilter.match(Throwable, boolean)
support.

See gh-35592
Closes gh-35583
2025-10-09 17:55:03 +02:00
Sam Brannen 58940794cf Polish resilience features 2025-10-09 17:45:17 +02:00
Sam Brannen 670effa02b Support matching against exception causes in ExceptionTypeFilter
Prior to this commit, ExceptionTypeFilter only provided support for
filtering based on exact matches against exception types; however, some
use cases require that filtering be applied to nested causes in a given
exception. For example, this functionality is a prerequisite for
gh-35583.

This commit introduces a new match(Throwable, boolean) method in
ExceptionTypeFilter, where the boolean flag enables matching against
nested exceptions.

See gh-35583
Closes gh-35592
2025-10-09 14:19:03 +02:00
Sam Brannen 6bc3ce4829 Polishing 2025-10-08 15:48:20 +02:00
Sam Brannen d404fdafa0 Prevent ReactorResourceFactory from participating in pause scenarios
Prior to this commit, ReactorResourceFactory was not restarted properly
when the ApplicationContext was resumed by the TestContext Framework
after a context pause. The reason is that the managed LoopResources
were disposed when ConfigurableApplicationContext.pause() was invoked
and reacquired when ConfigurableApplicationContext.restart() was
invoked.

To address that, this commit overrides isPauseable() in
ReactorResourceFactory to return false, thereby avoiding participation
in pause scenarios.

Closes gh-35585
2025-10-08 15:48:20 +02:00
rstoyanchev e0b8cb4fe2 Allow setting ApiVersionInserter to null
It should be possible to reset this, e.g. after call to mutate
a client or a test client.
2025-10-08 13:52:14 +01:00
rstoyanchev 03e379b070 Improve Javadoc for use of ApiVersionInserter
Closes gh-35565
2025-10-08 12:24:37 +01:00
rstoyanchev 00543becf8 Allow explicitly sending no API version
Closes gh-35566
2025-10-08 12:24:37 +01:00
Sébastien Deleuze 891c3e3a1f Fix FilterProvider handling in AbstractJacksonEncoder
Closes gh-35575
2025-10-08 11:29:02 +02:00
rstoyanchev e11cb2d856 Improve converter config in RestClient.Builder
Internally maintain a chain of HttpMessageConverters.ClientBuilder
consumers in addition to the List of converters.

List based methods apply to the list.
HttpMessageConverters based methods are composed into a Consumer.

At build() time prepare a single HttpMessageConverters.ClientBuilder.
Insert list based converters first.
Apply HttpMessageConverters consumers after that.

Deprecate both List methods. Eventually, HttpMessageConverters should
be the main mechanism. In the mean time we layer them as described.

Closes gh-35578
2025-10-08 06:34:53 +01:00
rstoyanchev d057eb2e5d Improve converter config in RestTestClient.Builder
Compose consumers and apply them together from the build method
to allow multiple parties to supply consumers that collaborate
on the same HttpMessageConverters.Builder.

See gh-35578
2025-10-08 06:34:53 +01:00
rstoyanchev 451f2b5a90 Polishing in MockMvcClientHttpRequestFactory
Replace anonymous subclass with inner.
Simplify methods to adapt client-server request and response.
2025-10-08 06:34:53 +01:00
Sam Brannen 7e6874ad80 Polish @⁠Autowired section of the reference manual 2025-10-07 17:17:27 +02:00
Sam Brannen 097463e3b7 Remove outdated reference to JSR 305 in the reference documentation
Closes gh-35580
2025-10-07 17:10:40 +02:00
Sam Brannen 30db2e4fb5 Support Bean Overrides for non-singletons
Prior to this commit, the BeanOverrideBeanFactoryPostProcessor rejected
any attempt to override a non-singleton bean; however, due to interest
from the community, we have decided to provide support for overriding
non-singleton beans via the Bean Override mechanism — for example, when
using @⁠MockitoBean, @⁠MockitoSpyBean, and @⁠TestBean.

With this commit, we now support Bean Overrides for non-singletons: for
standard JVM runtimes as well as AOT processing and AOT runtimes. This
commit also documents that non-singletons will effectively be converted
to singletons when overridden and logs a warning similar to the
following.

WARN: BeanOverrideBeanFactoryPostProcessor - Converting 'prototype' scoped bean definition 'myBean' to a singleton.

See gh-33602
See gh-32933
See gh-33800
Closes gh-35574
2025-10-07 15:33:18 +02:00
Sam Brannen ff9a349271 Introduce findAnnotatedBeans(ListableBeanFactory) in ControllerAdviceBean
This commit introduces a new findAnnotatedBeans(ListableBeanFactory)
override for the existing findAnnotatedBeans(ApplicationContext) method.

Closes gh-35571
2025-10-07 12:37:07 +02:00
NeatGuyCoding 6aeb9d16e8 Fix Javadoc link and remove unnecessary semicolon
Closes gh-35573

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-10-06 16:54:08 +02:00
Sam Brannen c6e5cfe03d Use consistent naming for Bean Override test classes 2025-10-06 15:26:51 +02:00
Juergen Hoeller 3a1a0e6e95 Merge branch '6.2.x' 2025-10-06 14:10:05 +02:00
Juergen Hoeller 80e7ee321e Mark bootstrap thread for entire finishBeanFactoryInitialization phase
Closes gh-35398
2025-10-06 14:08:03 +02:00
Wars a32d0b17d1 Remove unused application startup call
AbstractApplicationContext.applicationStartup can only be injected after the instance construction. This metrics point has no practical effect at present and can be removed safely.

Closes gh-35570
Signed-off-by: Wars <wars@wars.cat>
2025-10-06 09:29:29 +02:00
Sébastien Deleuze d6fbe257f5 Upgrade to Jackson 3.0.0
Closes gh-35521
2025-10-05 15:17:59 +02:00
Sam Brannen d81f1a55c2 Test SpEL Map access/indexing support for nonexistent keys
This commit introduces two tests to verify the status quo.

- mapAccessThroughIndexerForNonexistentKey(): demonstrates that map
  access via the built-in support in the Indexer returns `null` for a
  nonexistent key.

- nullAwareMapAccessor(): demonstrates that users can implement and
  register a custom extension of MapAccessor which reports that it can
  read any map (ignoring whether the map actually contains an entry for
  the given key) and returns `null` for a nonexistent key.

See gh-35534
2025-10-04 17:43:47 +02:00
Sam Brannen eb11070c19 Overhaul and simplify SpEL MapAccessTests 2025-10-04 17:41:39 +02:00
Juergen Hoeller 80f1d95404 Upgrade to Hibernate ORM 7.1.2 2025-10-03 18:05:41 +02:00
Juergen Hoeller e2168edc8f No synchronization (and no caching) for SmartFactoryBean invocations
See gh-35545
See gh-35101
2025-10-03 17:56:11 +02:00
Juergen Hoeller 2170b40213 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java
2025-10-03 17:34:42 +02:00
Juergen Hoeller ecd3dd8883 Consistent local synchronization in getObjectFromFactoryBean
Closes gh-35545
2025-10-03 17:29:14 +02:00
Juergen Hoeller 54b43d4a88 Merge branch '6.2.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLExceptionSubclassTranslator.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/support/SQLStateSQLExceptionTranslator.java
2025-10-03 14:54:04 +02:00
Juergen Hoeller 332953c9a4 Align BatchUpdateException handling among SQLExceptionTranslator variants
Closes gh-35547
2025-10-03 14:51:15 +02:00
Sam Brannen 4e2d5d4d64 Merge branch '6.2.x' 2025-10-03 14:18:24 +02:00
Sam Brannen 1cdd56bf02 Log multiple primary bean detection in DefaultListableBeanFactory
Prior to this commit, a NoUniqueBeanDefinitionException was thrown when
multiple primary beans were detected within a given set of beans, but
nothing was logged. For use cases where the exception is handled by
infrastructure code, it may not be obvious to the developer what the
problem is.

To address that, a TRACE message is now logged whenever multiple
competing primary beans are detected in DefaultListableBeanFactory.

Closes gh-35550
2025-10-03 14:09:52 +02:00
rstoyanchev 8a719117e3 Fix copy-paste error from recent change
See gh-35562
2025-10-03 09:21:55 +01:00
Juergen Hoeller 37319fc367 Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/cglib/core/CodeEmitter.java
2025-10-02 21:56:12 +02:00
Juergen Hoeller 3041071269 Consistently apply useCaches for single Resource lookup
Closes gh-35465
2025-10-02 21:53:47 +02:00
Juergen Hoeller 2da821389c Remove redundant object allocation in cglib proxy method calls
Reformatted with Spring patch markers and backported to 6.2.12

Closes gh-35543
2025-10-02 21:53:34 +02:00
Nurlan Turdaliev b4d501f888 Remove redundant object allocation in cglib proxy method calls
* Fixes gh-35542

Signed-off-by: Nurlan Turdaliev <nurlan0000@gmail.com>
2025-10-02 21:22:19 +02:00
rstoyanchev 8631345b71 Refine Jackson 3 vs 2 setup in CodecConfigurer
Closes gh-35562
2025-10-02 17:35:33 +01:00
Juergen Hoeller 1333669e2c Introduce SimpleDestinationResolver as new default for common setups
Closes gh-35456
2025-10-02 18:28:59 +02:00
Sam Brannen c5a79fdf99 Stop using javadoc.io for external Javadoc links
Since our build was failing intermittently, we have decided to stop
using javadoc.io for external Javadoc links for the time being.
2025-10-02 14:24:09 +02:00
Juergen Hoeller 7089bdcc3a Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/FactoryBeanRegistrySupport.java
2025-10-02 13:17:45 +02:00
Juergen Hoeller d484e4f3ff Ignore SQL state 3B001 in releaseSavepoint (for HSQLDB)
Closes gh-35564
2025-10-02 13:01:30 +02:00
Juergen Hoeller 74dc61b8c4 Fall back to local synchronization in getObjectFromFactoryBean
Closes gh-35545
2025-10-02 13:01:03 +02:00
Sam Brannen c08610ee58 Revert nullability changes in reactive transaction support
After further consideration, we have decided to revert the
nullability changes in the reactive TransactionCallback and
TransactionalOperator.

See gh-35561
2025-10-02 12:47:37 +02:00
Sam Brannen 1e83de072c Merge branch '6.2.x' 2025-10-02 11:45:43 +02:00
Sam Brannen 717358b56b Short circuit ClassUtils.findPubliclyAccessibleMethodIfPossible(...)
Once we find a publicly accessible method, there is no need to continue
traversing the type hierarchy.

See gh-35556
2025-10-02 11:44:54 +02:00
Sébastien Deleuze 1243f40ee6 Merge branch '6.2.x' 2025-10-02 10:20:09 +02:00
Sébastien Deleuze 836634c47f Upgrade CI workflow from Java 24 to Java 25 2025-10-02 10:19:42 +02:00
Stéphane Nicoll e91abd442a Simplify MockHttpServletRequestBuilders hierarchy
Closes gh-33231
2025-10-02 09:22:33 +02:00
Brian Clozel d98179e137 Enforce custom string converter in HttpMessageConverters
Prior to this commit, configuring a custom `StringHttpMessageConverter`
would be overwritten when the `registerDefaults()` option is enabled.

Fixes gh-35563
2025-10-01 20:18:39 +02:00
Juergen Hoeller 56b082dec7 Merge branch '6.2.x' 2025-10-01 19:58:49 +02:00
Juergen Hoeller a6f6ecfe6c Revise getPubliclyAccessibleMethodIfPossible to rely on Module#isExported
This avoids reflection and cache access for regular public and exported types.

Closes gh-35556
2025-10-01 19:56:23 +02:00
Juergen Hoeller e3da26ebbd Clarify event parameter type for multiple mapped classes
Closes gh-35506
2025-10-01 19:55:42 +02:00
Brian Clozel b59fec21d8 Merge branch '6.2.x' 2025-10-01 19:41:22 +02:00
Maziyar Bahramian e1c008f5a3 Fix URI Patterns docs for WebMVC and WebFlux
Closes gh-35551
Signed-off-by: Maziyar Bahramian <maziyar.bahramian@gmail.com>
2025-10-01 19:39:57 +02:00
Sébastien Deleuze acc3783509 Merge branch '6.2.x' 2025-10-01 19:26:06 +02:00
Sébastien Deleuze cb849a7071 Add a test for CGLIB Enhancer Kotlin refinements
This commit adds a reproducer for the change of behavior introduced via
https://youtrack.jetbrains.com/issue/KT-76667. The test is only broken
with Kotlin 2.2.20+ without the related fix (see previous commit).

Closes gh-35487
2025-10-01 19:21:40 +02:00
Juergen Hoeller 3e37279db6 Make CGLIB Enhancer compatible with Kotlin 2.2.20+
This commit refines Enhancer#emitMethods to support the changes
introduced by https://youtrack.jetbrains.com/issue/KT-76667.

See gh-35487
2025-10-01 19:14:14 +02:00
rstoyanchev c765b035e5 Merge branch '6.2.x' 2025-10-01 16:14:13 +01:00
rstoyanchev b3264ec2a8 Fix typo 2025-10-01 16:13:40 +01:00
Sam Brannen 563919befd Revise nullability of Transaction[Callback|Operations|Operator]
This commit revises the nullability declarations in TransactionCallback,
TransactionOperations, and TransactionalOperator.

Closes gh-35561
2025-10-01 16:58:33 +02:00
rstoyanchev f071f95899 Merge branch '6.2.x' 2025-10-01 14:46:47 +01:00
rstoyanchev df860fd3cd Polishing contribution
Closes gh-35493
2025-10-01 14:45:18 +01:00
Réda Housni Alaoui 636523a2f5 AbstractMockHttpServletRequestBuilder#buildRequest is not idempotent
See gh-35493

Signed-off-by: Réda Housni Alaoui <reda-alaoui@hey.com>
2025-10-01 14:44:23 +01:00
rstoyanchev a19b51b7e0 Handle invalid position in ResourceHttpMessageWriter
Closes gh-35536
2025-10-01 14:44:05 +01:00
rstoyanchev fbdece6759 Polishing in ResourceHttpMessageWriter
See gh-35536
2025-10-01 14:42:01 +01:00
Sam Brannen 96e90e10b9 Merge branch '6.2.x' 2025-10-01 13:21:05 +02:00
Sam Brannen 64d42fefda Fix idref example in reference manual
Closes gh-35560
2025-10-01 13:19:54 +02:00
Sam Brannen 447cfa18e9 Polishing 2025-10-01 13:19:25 +02:00
Sébastien Deleuze 5138305e0b Fix SingletonSupplier.ofNullable(T) nullability
See gh-35559
2025-10-01 12:01:17 +02:00
Sam Brannen 48ec990a17 Fix typos 2025-10-01 11:53:01 +02:00
Sébastien Deleuze 1e3f8651b8 Refine SingletonSupplier<T> static methods nullability
SingletonSupplier<T> supplier-based static methods nullability should
be refined to accept in a flexible way nullable or non-nullable T.

Closes gh-35559
2025-10-01 11:38:33 +02:00
Stéphane Nicoll a2c0e1cec8 Fix typos 2025-10-01 11:23:00 +02:00
Stéphane Nicoll 8cad5711f5 Add Kotlin extensions for RestTestClient
Closes gh-35558
2025-10-01 10:56:34 +02:00
Stéphane Nicoll 741107969a Always invoke ConfigurationBeanNameGenerator
Previously, if a ConfigurationBeanNameGenerator is used to parse
configuration classes, it is not invoked for `Bean` methods that provide
a specific bean name. This doesn't give a chance to an implementation to
tune such a bean, if required.

This commit updates the signature of ConfigurationBeanNameGenerator to
provide the identified bean name on the `@Bean` declaration,if any, and
to always invoke it.

Closes gh-35505
2025-10-01 10:34:38 +02:00
Sam Brannen 969517bce1 Upgrade to JUnit 6.0
Closes gh-35124
2025-09-30 13:27:47 +02:00
Sam Brannen 834755203e Merge branch '6.2.x' 2025-09-30 12:46:33 +02:00
Sam Brannen ec3d9d6253 Upgrade to JUnit 5.14
Closes gh-35555
2025-09-30 12:43:53 +02:00
Sam Brannen 2bd6422db9 Update @⁠ConcurrencyLimit documentation
This commit updates the reference manual in order to reflect recent
changes made to @⁠ConcurrencyLimit.

See gh-35461
See gh-35470
See gh-35523
2025-09-29 17:41:59 +02:00
Sam Brannen b9e0a48e95 Revise documentation for @⁠Retryable 2025-09-29 17:38:50 +02:00
Sam Brannen 8dd64602e8 Avoid warnings with AssertJ APIs 2025-09-29 17:11:42 +02:00
Sam Brannen 60673a0e32 Upgrade com.gradleup.shadow plugin to 9.2.2 2025-09-27 17:01:01 +02:00
rstoyanchev 7f03487875 Polishing contribution
Closes gh-35510
2025-09-26 17:44:42 +01:00
KNU-K e4a431e536 Refactor toString method in SockJsFrame
See gh-35510

Signed-off-by: KNU-K <knukang334@gmail.com>
2025-09-26 17:34:09 +01:00
rstoyanchev 2e915a3934 Provide access to API version in controller method
Closes gh-35424
2025-09-26 17:32:38 +01:00
Sam Brannen 7ba736dc06 Stop overriding default methods in TrackingTestNGTestListener
At some point, TestNG started implementing listener methods as interface
default methods, so we no longer need to override those methods with
empty implementations.
2025-09-26 14:56:03 +02:00
Sam Brannen 1b3aeba5ee Merge branch '6.2.x' 2025-09-25 17:55:22 +02:00
Sam Brannen 5cd2cb38e1 Make AbstractTestNGSpringContextTests thread-safe regarding tracked exceptions
Prior to this commit, AbstractTestNGSpringContextTests was not
thread-safe with regard to tracked exceptions.

To address that, AbstractTestNGSpringContextTests now tracks the test
exception via a ThreadLocal.

Closes gh-35528
2025-09-25 17:51:39 +02:00
rstoyanchev ba0de1edce Merge branch '6.2.x' 2025-09-25 12:22:29 +01:00
rstoyanchev e9fb5eb38a Respect forwarded path in UrlHandlerFilter
Closes gh-35509
2025-09-25 12:19:56 +01:00
Sam Brannen 34be8e266d Revise nullability for Core Retry after upgrade to NullAway 0.12.10
This commit revises the nullability declarations in Retryable,
RetryOperations, and RetryTemplate after the upgrade to NullAway 0.12.10.

See gh-35492
2025-09-25 11:38:33 +02:00
Sam Brannen 5df082132d Polish contribution
See gh-35535
2025-09-25 10:28:00 +02:00
Yanming Zhou 871076ef97 Add serialVersionUID in LinkedCaseInsensitiveMap
Closes gh-35535

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-09-25 10:27:19 +02:00
Manu Sridharan e834a3a80c Nullability fixes for AtomicReference variables
Closes gh-35514
Signed-off-by: Manu Sridharan <msridhar@gmail.com>
2025-09-25 07:39:44 +02:00
rstoyanchev 5a858915ea Revise parsed path handling in UrlHandlerFilter
Closes gh-35538
2025-09-24 19:08:55 +01:00
Sam Brannen 051adf267f Introduce MapAccessor in SpEL and deprecate existing implementation
Prior to this commit, the MapAccessor for SpEL resided in the
org.springframework.context.expression package in the spring-context
module; however, it arguably should reside in the spring-expression
module so that it can be used whenever SpEL is used (without requiring
spring-context).

This commit therefore officially deprecates the MapAccessor in
spring-context for removal in favor of a new copy of the implementation
in the org.springframework.expression.spel.support package in the
spring-expression module.

Closes gh-35537
2025-09-24 16:52:27 +02:00
Sam Brannen 27b2243b43 Test status quo for canRead() and read() in SpEL MapAccessor
See gh-35534
2025-09-24 16:06:37 +02:00
Brian Clozel 20aac6dd8d Add Gson codecs for WebFlux
This commit adds new `GsonEncoder` and `GsonDecoder` for serializing and
deserializing JSON in a reactive fashion.

Because `Gson` itslef does not support decoding JSON in a non-blocking
way, the `GsonDecoder` does not support decoding to `Flux<*>` types.

Closes gh-27131
2025-09-23 17:09:41 +02:00
Sam Brannen d84bf18408 Upgrade to JUnit 6.0 RC3
See gh-35124
2025-09-23 16:19:54 +02:00
Sébastien Deleuze 7edb0b3397 Upgrade the build to Java 25
See gh-35531
Closes gh-35530
2025-09-23 15:57:21 +02:00
Sébastien Deleuze aa272b4cd9 Upgrade to Dokka 2.1.0-Beta
Required for Java 25 support.

Closes gh-35532
2025-09-23 15:57:21 +02:00
Sébastien Deleuze c79e4e230b Reinstantiate checks for kotlin-reflect
This commit reinstantiates checks for kotlin-reflect (via static final
fields for faster Java code paths and better native code removal) which
were removed as part of gh-34275, which did not consider the
increasingly popular use cases where kotlin-stdlib is present in the
classpath as a transitive dependency in Java applications.

Closes gh-35511
2025-09-22 18:33:38 +02:00
Sébastien Deleuze 7635ac38f6 Use uppercase for classpath-related static final field names
Closes gh-35525
2025-09-22 18:32:14 +02:00
Sam Brannen 5ac3c40689 Prevent empty declaration of @⁠ConcurrencyLimit
As a follow-up to gh-35461 and a comment left on the Spring Blog, we
have decided to prevent empty declarations of @⁠ConcurrencyLimit,
thereby requiring users to explicitly declare the value for the limit.

Closes gh-35523
2025-09-22 18:18:53 +02:00
Sam Brannen 8b254ad25e Improve Javadoc for ConcurrencyThrottleSupport 2025-09-22 18:12:31 +02:00
Sam Brannen 73ad1ebffb Introduce @⁠ConcurrencyLimit(limit) and revise contribution
This commit introduces a new `limit` attribute in @⁠ConcurrencyLimit as
an alias for the existing `value` attribute. This commit also renames
the `valueString` attribute to `limitString`.

See gh-35461
See gh-35470
2025-09-22 16:09:58 +02:00
Hyunsang Han 91f112a918 Add placeholder resolution support for @⁠ConcurrencyLimit
See gh-35461
Closes gh-35470

Signed-off-by: Hyunsang Han <gustkd3@gmail.com>
2025-09-22 15:19:07 +02:00
Sam Brannen 23b8c61b99 Upgrade to ArchUnit 1.4.1 for Java 25 support
https://github.com/TNG/ArchUnit/releases/tag/v1.4.1
2025-09-22 14:37:46 +02:00
Sam Brannen 0c61ac956b Add missing @⁠Override annotations
... and suppress "serial" warnings
2025-09-22 13:20:37 +02:00
rstoyanchev f504d051ab Polishing in HTTP interface clients docs 2025-09-22 11:35:46 +01:00
rstoyanchev e9e19f5ed7 Update references to HTTP service clients in docs
Closes gh-35522
2025-09-22 11:35:46 +01:00
Sébastien Deleuze 79738d921a Upgrade to Jackson 3.0.0-rc10
See gh-35521
2025-09-22 11:16:25 +02:00
Brian Clozel 33897bb398 Merge branch '6.2.x' 2025-09-19 18:09:06 +02:00
Brian Clozel d85a020e4e Improve Task Javadoc about Runnable wrapping
Closes gh-35394
2025-09-19 18:05:02 +02:00
Brian Clozel c129e8a599 Merge branch '6.2.x' 2025-09-19 17:51:33 +02:00
Brian Clozel 0cc79ba366 Catch EOFException in IntrospectingClientHttpResponse
Prior to this commit, the `IntrospectingClientHttpResponse` would try
and read the HTTP response stream in order to check for the presence of
a non-empty message body.

Developers reported that in some cases, an `EOFException` is thrown
instead of returning -1 from the `read()` method. This commit ensures
that this case is taken into account and that we report the response as
an empty body in these cases.

Closes gh-35361
2025-09-19 17:49:12 +02:00
Sam Brannen d038269ec3 Upgrade to Gradle 9.1
This commit upgrades the build to use Gradle 9.1.

To achieve that, the following changes were necessary.

- Stop using Groovy safe-navigation operator (?.) in
  framework-api.gradle due to a NullPointerException.

- Switch from the io.github.goooler.shadow plugin to the
  com.gradleup.shadow plugin, since the former is no longer maintained
  and the latter is a fork that replaces it.

Closes gh-35508
2025-09-19 17:40:32 +02:00
Sam Brannen d82a578f31 Merge branch '6.2.x' 2025-09-19 11:24:32 +02:00
Sam Brannen 1e29911292 Upgrade to AssertJ 3.27.5 2025-09-19 11:23:08 +02:00
Sam Brannen 01c8f04d98 Improve Javadoc for ConfigurableApplicationContext 2025-09-18 18:31:29 +02:00
Sam Brannen cb485b666f Polishing 2025-09-18 18:31:29 +02:00
Sam Brannen abdc3200b2 Restructure and polish the classpath scanning chapter 2025-09-18 18:31:29 +02:00
Sam Brannen dbb9bf939c Revise contribution
See gh-35491
2025-09-18 18:00:11 +02:00
Byeong-Uk Park fe04bfcadb Document placeholder and pattern support for @⁠ComponentScan
- JavaDoc: clarify that basePackages/value resolve ${…} via Environment
  and accept Ant-style package patterns (e.g., com.example.**); note
  patterns don’t apply to basePackageClasses.

- Reference: add “Property placeholders and Ant-style patterns”
  subsection in classpath-scanning.adoc with Java/Kotlin + properties
  examples.

See gh-35288
Closes gh-35491

Signed-off-by: Byeong-Uk Park <114344042+Rockernun@users.noreply.github.com>
2025-09-18 18:00:11 +02:00
Juergen Hoeller 015edb33cd Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-09-17 18:27:04 +02:00
Juergen Hoeller 931686a5ee Upgrade to SnakeYAML 2.5, Protobuf 4.32.1, ActiveMQ 5.17.7 and Artemis 2.42, EasyMock 5.6, AssertJ 3.27.4, XMLUnit 2.10.4, Dom4J 2.2 2025-09-17 18:18:35 +02:00
Juergen Hoeller bf715ac23e Polishing 2025-09-17 18:10:19 +02:00
Brian Clozel b213344d25 Fix synchronization in ResponseBodyEmitter
See gh-35423
Fixes gh-35466

(cherry picked from commit 20e1149dde)
2025-09-17 18:07:45 +02:00
Juergen Hoeller fa5ebbc1a8 Upgrade to Hibernate 7.1.1, Groovy 5.0.1, Commons Pool 2.12.1, SnakeYAML 2.5, Protobuf 4.32.1, ActiveMQ 5.17.7 and Artemis 2.42, EasyMock 5.6, AssertJ 3.27.4, XMLUnit 2.10.4, Dom4J 2.2
Includes downgrade to Log4J 2.25.1 from 3.0.0 beta (for Spring Framework 7.0 RC1)
2025-09-17 17:37:36 +02:00
rstoyanchev 11dd0d6118 Provide access to raw content in RestTestClient
Closes gh-35399
2025-09-17 15:50:59 +01:00
Sébastien Deleuze 23d1b0e881 Polishing 2025-09-17 15:17:23 +02:00
Sébastien Deleuze da0a36bfd6 Upgrade to NullAway 0.12.10 and refine nullability
Closes gh-35492
2025-09-17 15:17:23 +02:00
rstoyanchev 8ac5cdb47e Fix typo
See gh-35494
2025-09-17 11:55:37 +01:00
rstoyanchev c7121d048c Replace X-API-Version with API-Version
Closes gh-35494
2025-09-17 11:48:49 +01:00
Stéphane Nicoll 88812edc35 Merge branch '6.2.x' 2025-09-16 16:11:08 +02:00
Stéphane Nicoll 0a48984fab Suppress deprecating warnings for getInstanceSupplier() method as well
This commit fixes code generation for a bean produced by a protected
factory method. Previously only the code generated for public methods,
i.e. without a dedicated instance supplier method, was handled.

Closes gh-35486
2025-09-16 16:08:15 +02:00
Sébastien Deleuze 84bd44e5de Use nullable body consistently in HttpClientErrorException
Closes gh-35482
2025-09-15 10:18:04 +02:00
Sébastien Deleuze 2faed3cdbb Refine PropagationContextElement
This commit apply several refinements to PropagationContextElement:
 - Capture the ThreadLocal when instantiating the
   PropagationContextElement in order to support dispatchers switching
   threads
 - Remove the constructor parameter which is not idiomatic and breaks
   the support when switching threads, and use instead the
   updateThreadContext(context: CoroutineContext) parameter
 - Make the kotlinx-coroutines-reactor dependency optional
 - Make the properties private

The Javadoc and tests are also updated to use the
`Dispatchers.IO + PropagationContextElement()` pattern performed
outside of the suspending lambda, which is the typical use case.

Closes gh-35469
2025-09-12 17:26:07 +02:00
Brian Clozel 20e1149dde Fix synchronization in ResponseBodyEmitter
See gh-35423
Fixes gh-35466
2025-09-12 09:12:33 +02:00
Sébastien Deleuze 7a5d3a55fe Refine EntityManagerRuntimeHints for Hibernate 7.1+
This commit adds support for Hibernate 7.1+ SqmQueryImpl class in
EntityManagerRuntimeHints, keeps the support for the former
QuerySqmImpl class for Hibernate 7.0 compatibility and adds a
related test.

Closes gh-35462
2025-09-11 15:24:55 +02:00
Brian Clozel e89056cd69 Merge branch '6.2.x' 2025-09-11 09:40:49 +02:00
Brian Clozel cbdd107799 Next development version (v6.2.12-SNAPSHOT) 2025-09-11 09:40:23 +02:00
Juergen Hoeller f2972d8b38 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-orm/src/main/java/org/springframework/orm/jpa/JpaTransactionManager.java
2025-09-10 18:39:50 +02:00
Juergen Hoeller d17601e01c Upgrade to Undertow 2.3.19, RxJava 3.1.11, Aalto 1.3.3 2025-09-10 18:38:20 +02:00
Juergen Hoeller 5b387615c6 Clarify intended nestedTransactionAllowed default in JpaTransactionManager
Closes gh-35212
2025-09-10 18:06:44 +02:00
Juergen Hoeller 59804ab396 Align JpaTransactionManager default for nestedTransactionAllowed flag
Closes gh-35457
2025-09-10 17:41:25 +02:00
rstoyanchev dd60fddaf0 Always process SSE "data:" line
ServerSentEventHttpMessageReader now always processes "data:"
lines, including empty lines, as per SSE spec.

Closes gh-35412
2025-09-10 16:22:23 +01:00
rstoyanchev 3702031f82 Improve docs on versioning by path segment
Closes gh-35421
2025-09-10 16:22:23 +01:00
Sam Brannen 15c5cf472b Merge branch '6.2.x' 2025-09-10 14:29:17 +02:00
Sam Brannen 0e3e34bee0 Find annotations on parameters in overridden non-public methods
Prior to this commit, annotations were not found on parameters in an
overridden method unless the method was public. Specifically, the
search algorithm in AnnotatedMethod did not consider a protected or
package-private method in a superclass to be a potential override
candidate. This affects parameter annotation searches in
spring-messaging, spring-webmvc, spring-webflux, and any other
components that use or extend AnnotatedMethod.

To address that, this commit revises the search algorithm in
AnnotatedMethod to consider all non-final declared methods as potential
override candidates, thereby aligning with the search logic in
AnnotationsScanner for the MergedAnnotations API.

Closes gh-35349
2025-09-10 14:24:24 +02:00
Sam Brannen 4745c7cf3c Name local variables consistently 2025-09-10 14:08:20 +02:00
Sébastien Deleuze 86fb62c059 Upgrade to Kotlin 2.2.20
Closes gh-35414
2025-09-10 14:03:30 +02:00
Brian Clozel ef2a403df6 Add PropagationContextElement Kotlin operator
Prior to this commit, the Micrometer context-propagation project would
help propagating information from `ThreadLocal`, Reactor `Context` and
other context objects. This is already well supported for Micrometer
Observations.

In the case of Kotlin suspending functions, the processing of tasks
would not necessarily update the `ThreadLocal` when the function is
scheduled on a different thread.

This commit introduces the `PropagationContextElement` operator that
connects the `ThreadLocal`, Reactor `Context` and Coroutine `Context`
for all libraries using the "context-propagation" project.

Applications must manually use this operator in suspending functions
like so:

```
suspend fun suspendingFunction() {
  return withContext(PropagationContextElement(currentCoroutineContext())) {
    logger.info("Suspending function with traceId")
  }
}
```

Closes gh-35185
2025-09-09 21:42:08 +02:00
Juergen Hoeller 21e52a4283 Upgrade to Tomcat 11.0.11 and EclipseLink 5.0.0-B10 2025-09-09 18:54:52 +02:00
Juergen Hoeller f7b0d44bfd Upgrade to Reactor 2025.0.0-M7 and Micrometer 1.16.0-M3
Closes gh-35452
Closes gh-35453
2025-09-09 18:50:10 +02:00
Juergen Hoeller 2c547e9051 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-09-09 18:48:30 +02:00
Juergen Hoeller 275fb52ad6 Upgrade to Reactor 2024.0.10 and Micrometer 1.14.11
Closes gh-35454
Closes gh-35455
2025-09-09 18:45:38 +02:00
Juergen Hoeller 7f9aa39748 Polishing 2025-09-09 18:45:04 +02:00
Brian Clozel 39db0e0af2 Merge branch '6.2.x' 2025-09-09 16:56:29 +02:00
Taeik Lim c788554b1d Avoid thread pinning in SseEmitter, ResponseBodyEmitter
Closes gh-35423

Signed-off-by: Taeik Lim <sibera21@gmail.com>
2025-09-09 16:38:10 +02:00
Sébastien Deleuze 563dccbbda Add debug logging when no CORS configuration
Closes gh-35314
2025-09-09 15:53:34 +02:00
Sébastien Deleuze f8823ddc11 Polish JSP documentation
This commit ensures consistency with the documentation of other view
resolvers.

See gh-35444
2025-09-09 13:36:10 +02:00
Sébastien Deleuze dff489d0cf Refine JSP documentation contribution
This commit refines the JSP view resolver documentation contribution
by using tabs for Java and XML configuration, with Java displayed by
default.

Closes gh-35444
2025-09-09 13:28:17 +02:00
DongNyoung Lee 1abd1d767d Update mvc-jsp.adoc
See gh-35444
Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com>
2025-09-09 11:55:19 +02:00
Sébastien Deleuze 7baf6d12b0 Merge branch '6.2.x' 2025-09-09 11:28:09 +02:00
Sébastien Deleuze 9e8c64011d Make JsonPathAssertions#isEqualTo parameter nullable
Closes gh-35445
2025-09-09 11:25:58 +02:00
Juergen Hoeller 1107a43b65 Upgrade to Jetty 12.1 onWebSocketClose signature
Includes switch to catching Throwable instead of Exception.

See gh-35345
2025-09-08 19:09:56 +02:00
Juergen Hoeller 3fb3b3d1b9 Upgrade to Jetty 12.1 onWebSocketClose signature
See gh-35345
2025-09-08 18:55:52 +02:00
Juergen Hoeller ad796fb1a8 Upgrade to Jetty 12.1.1, Netty 4.2.6, Checkstyle 11.0.1 2025-09-08 18:28:16 +02:00
Juergen Hoeller 5be5843cb7 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-09-08 18:23:37 +02:00
Juergen Hoeller ebb8e34570 Upgrade to Jetty 12.0.26, Jetty Reactive HttpClient 4.0.11, Netty 4.1.127, HtmlUnit 4.16 2025-09-08 18:11:27 +02:00
Juergen Hoeller 9ba954c330 Fix FileSystemUtils for Windows/Linux path difference
See gh-35443
2025-09-08 17:51:58 +02:00
Juergen Hoeller a053e6594c Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/io/Resource.java
#	spring-core/src/main/java/org/springframework/core/io/buffer/DataBufferUtils.java
#	spring-core/src/test/java/org/springframework/util/FileSystemUtilsTests.java
#	spring-web/src/main/java/org/springframework/http/codec/ResourceHttpMessageWriter.java
2025-09-08 17:30:43 +02:00
Juergen Hoeller ba52164373 Provide graceful fallback for non-default NIO file systems
Closes gh-35443
2025-09-08 17:28:45 +02:00
Juergen Hoeller b8f71b2321 Add DataFieldMaxValueIncrementer for SQLite (migrated from Spring Batch)
Closes gh-35440
2025-09-08 17:03:18 +02:00
Juergen Hoeller 27221581a1 Expose getFilePath() on Resource interface for consistent NIO support
Closes gh-35435
2025-09-08 17:03:07 +02:00
Sam Brannen 114c3f7c9c Avoid unnecessary imports for Javadoc 2025-09-08 15:04:33 +02:00
Sam Brannen 8f34a67024 Polish core retry internals 2025-09-08 15:03:50 +02:00
rstoyanchev 9849094586 Merge branch '6.2.x' 2025-09-08 13:56:19 +01:00
rstoyanchev 736383e6cb Remove HttpServiceClient annotation
Closes gh-35431
2025-09-08 13:56:07 +01:00
Sam Brannen e93a6a7230 Improve wording for retry exceptions 2025-09-08 14:39:46 +02:00
Sam Brannen 1786eb2901 Introduce RetryInterruptedException to address off-by-one error
Prior to this commit, a RetryException thrown for an
InterruptedException returned the wrong value from getRetryCount().
Specifically, the count was one more than it should have been, since the
suppressed exception list contains the initial exception as well as all
retry attempt exceptions.

To address that, this commit introduces an internal
RetryInterruptedException which accounts for this off-by-one error.

Closes gh-35434
2025-09-08 14:22:52 +02:00
Sam Brannen b2cdfbadf1 Introduce onRetryPolicyInterruption() callback in RetryListener
In RetryTemplate, if we encounter an InterruptedException while
sleeping for the configured back-off duration, we throw a
RetryException with the InterruptedException as the cause.

However, prior to this commit, that RetryException propagated to the
caller without notifying the registered RetryListener.

To address that, this commit introduces a new
onRetryPolicyInterruption() callback in RetryListener as a companion to
the existing onRetryPolicyExhaustion() callback.

Closes gh-35442
2025-09-08 13:47:23 +02:00
rstoyanchev 977582fced Document data binding for functional endpoints
Closes gh-35367
2025-09-08 10:12:20 +01:00
Sébastien Deleuze 13d36a51de Upgrade to Jackson 3.0.0-rc9 and 2.20.0
Closes gh-35439
2025-09-08 10:07:33 +02:00
Sam Brannen bce44b007d Document programmatic retry support in the reference manual
Closes gh-35436
2025-09-07 17:58:28 +02:00
Sam Brannen 7484b9c491 Consistently include exceptions for previous attempts in RetryException
In RetryTemplate, if we encounter an InterruptedException while
sleeping for the configured back-off duration, we throw a
RetryException with the InterruptedException as the cause.

However, in contrast to the specification for RetryException, we do not
currently include the exceptions for previous retry attempts as
suppressed exceptions in the RetryException which is thrown in such
scenarios.

In order to comply with the documented contract for RetryException,
this commit includes exceptions for previous attempts in the
RetryException thrown for an InterruptedException as well.

Closes gh-35434
2025-09-06 16:39:22 +02:00
Sam Brannen 7b2730c271 Include current exception in log message for failed retry attempt
Prior to this commit, we included the initial exception in the log
message for the initial invocation of a retryable operation; however,
we did not include the current exception in the log message for
subsequent attempts.

For consistency, we now include the current exception in log messages
for subsequent retry attempts as well.

Closes gh-35433
2025-09-06 16:16:38 +02:00
Sébastien Deleuze d218b0899a Invalid Nullness information for Kotlin properties
This commit adds support for Kotlin properties to Nullness
forMethodReturnType and forParameter methods.

Closes gh-35419
2025-09-05 17:43:08 +02:00
Sébastien Deleuze d2bdf11b39 Refine Nullness for Kotlin functions returning Unit
Should have unspecified nullness like for Java void/Void.

Closes gh-35420
2025-09-05 11:16:27 +02:00
Sam Brannen e5b58effa3 Deprecate put(MergedContextConfiguration, ApplicationContext) in ContextCache
Closes gh-35415
2025-09-04 15:04:41 +02:00
Sébastien Deleuze 02b3a2bf34 Upgrade to Kotlin 2.2.10
Closes gh-35414
2025-09-04 14:37:44 +02:00
Sam Brannen ca62119cb3 Evict context from ContextCache before loading a new context
Since Spring Framework 4.2, DefaultContextCache supported an LRU (least
recently used) eviction policy via a custom LruCache which extended
LinkedHashMap. The LruCache reacted to LinkedHashMap's
removeEldestEntry() callback to remove the LRU context if the maxSize
of the cache was exceeded.

Due to the nature of the implementation in LinkedHashMap, the
removeEldestEntry() callback is invoked after a new entry has been
stored to the map.

Consequently, a Spring ApplicationContext (C1) was evicted from the
cache after a new context (C2) was loaded and added to the cache,
leading to failure scenarios such as the following.

- C1 and C2 share an external resource -- for example, a database.
- C2 initializes the external resource with test data when C2 is loaded.
- C1 cleans up the external resource when C1 is closed.
- C1 is loaded and added to the cache.
- C2 is loaded and added to the cache before C1 is evicted.
- C1 is evicted and closed.
- C2 tests fail, because C1 removed test data required for C2.

To address such scenarios, this commit replaces the custom LruCache
with custom LRU eviction logic in DefaultContextCache and revises
the put(MergedContextConfiguration, ApplicationContext) method to
delegate to a new evictLruContextIfNecessary() method.

This commit also introduces a new put(MergedContextConfiguration,
LoadFunction) method in the ContextCache API which is overridden by
DefaultContextCache to ensure that an evicted context is removed and
closed before a new context is loaded to take its place in the cache.

In addition, DefaultCacheAwareContextLoaderDelegate has been revised to
make use of the new put(MergedContextConfiguration, LoadFunction) API.

Closes gh-21007
2025-09-04 14:13:10 +02:00
Sam Brannen 8eca3a3eaf Polishing 2025-09-04 14:10:17 +02:00
Sam Brannen 80a7371510 Merge branch '6.2.x' 2025-09-03 16:29:55 +02:00
Sam Brannen 64721b3bc0 Polish formatting 2025-09-03 16:24:56 +02:00
Sam Brannen 02f0f92a72 Polish contribution
See gh-35400
2025-09-03 16:22:55 +02:00
Lukáš Kvídera db9e938ec4 Detect Informix error codes as DuplicateKeyException
Closes gh-35400

Signed-off-by: Lukáš Kvídera <kvideral@qwsome.eu>
2025-09-03 16:20:19 +02:00
Juergen Hoeller 410eff641c Merge branch '6.2.x' 2025-09-03 15:46:13 +02:00
Juergen Hoeller 3a4315bf16 Keep mainThreadPrefix exposed until background init threads finished
Closes gh-35409
2025-09-03 15:45:12 +02:00
Sam Brannen e53e413a21 Merge branch '6.2.x' 2025-09-03 14:53:20 +02:00
Sam Brannen 33fe8d29c1 Document potential need to use Mockito.doXxx() to stub a @⁠MockitoSpyBean
Closes gh-35410
2025-09-03 14:52:58 +02:00
rstoyanchev 79151a0bc2 Spring MVC recognizes gRPC streams
For this to work, a compatible message converter is necessary,
but only available in spring-grpc.

See gh-35401
2025-09-02 20:38:59 +01:00
rstoyanchev 10a288c986 Polishing in StatusHandler
See gh-35391
2025-09-02 15:38:03 +01:00
Johnny Lim d32b7e9b4a Polish gh-35358
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-09-02 23:13:27 +09:00
Sam Brannen 6dc5bf7634 Clean up warnings related to deprecated HttpStatus values, etc. 2025-09-02 12:50:57 +02:00
Sam Brannen 521764e68b Fix links, @⁠since tags, formatting, etc. in RestTestClient 2025-09-02 12:31:17 +02:00
Brian Clozel 942fbf3032 Polishing contribution
Closes gh-34683
2025-09-01 11:50:22 +02:00
Mengqi Xu 7b3c4e5893 Add support for Forwarded By HTTP headers
See gh-34683

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-09-01 11:49:59 +02:00
Park Sung Jun 1653ec3b44 Add tests for applyRelativePath method in StringUtils
Closes gh-35397

Signed-off-by: Park Sung Jun <junstin119@gmail.com>
2025-09-01 09:25:55 +02:00
Sam Brannen 746fc335c2 Merge branch '6.2.x' 2025-08-29 17:25:56 +02:00
Sam Brannen b741632e99 Polish wording in web sections 2025-08-29 17:25:15 +02:00
Tran Ngoc Nhan cd208797e2 Fix links to Reactive Libraries and RestTemplate
Closes gh-35392

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-08-29 17:23:13 +02:00
Brian Clozel 9979de99fd Do not decompress HTTP responses when compression disabled
This commit refines changes made in gh-35225 so as to not decompress
HTTP responses if decompression support is not enabled.

Closes gh-35225
2025-08-29 16:47:58 +02:00
rstoyanchev 441b14b0c1 Handle error responses in RestClientAdapter
Closes gh-35375
2025-08-29 16:04:45 +03:00
rstoyanchev f22d1eab23 Add createException to ConvertibleClientHttpResponse
Closes gh-35391
2025-08-29 16:04:45 +03:00
rstoyanchev 21e6d7392d Re-order methods and polishing
In StatusHandler and DefaultConvertibleClientHttpResponse.

See gh-35391
2025-08-29 16:04:45 +03:00
Gustav a585beac49 Fix typo in websocket doc (#35393)
Signed-off-by: Gustav <69737612+gustaavv@users.noreply.github.com>
2025-08-29 13:17:18 +02:00
rstoyanchev 0c02443965 Consistently support no value params in query string
Closes gh-35329
2025-08-29 10:25:37 +03:00
rstoyanchev 268706abd2 Polishing in AbstractMockHttpServletRequestBuilder
See gh-35329
2025-08-29 10:22:43 +03:00
Johnny Lim 737f66d922 Restore mixed use of uri() and queryParam()
for query parameters in AbstractMockHttpServletRequestBuilder.

See gh-35329

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-08-29 09:13:51 +03:00
rstoyanchev 11cb062357 Assert versionRequired and defaultVersion
Closes gh-35387
2025-08-28 15:50:33 +03:00
rstoyanchev a7e3a438c9 Correctly apply required API version validation
Closes gh-35386
2025-08-28 15:50:33 +03:00
Brian Clozel 442a2d0ca2 Merge branch '6.2.x' 2025-08-27 13:40:41 +02:00
Brian Clozel 764336f0f2 Fix Jetty DataBufferFactory memory leak
Prior to this commit, gh-32097 added native support for Jetty for both
client and server integrations. The `JettyDataBufferFactory` was
promoted as a first class citizen, extracted from a private class in the
client support. To accomodate with server-side requirements, an extra
`buffer.retain()` call was performed.
While this is useful for server-side support, this introduced a bug in
the data buffer factory, as wrapping an existing chunk means that this
chunk is already retained.

This commit fixes the buffer factory implementation and moved existing
tests from mocks to actual pooled buffer implementations from Jetty.
The extra `buffer.retain()` is now done from the server support, right
before wrapping the buffer.

Fixes gh-35319
2025-08-27 13:36:34 +02:00
Brian Clozel 81b4020fc6 Do not load concrete types in annotation metadata
This change fixes a regression introduced in the previous commit.

Closes gh-35252
2025-08-26 21:58:15 +02:00
Brian Clozel 2b7f88ee44 Fix annotation arrays support in ClassFile metadata
As of gh-33616, Spring now supports metadata reading with the ClassFile
API on JDK 24+ runtimes. This commit fixes a bug where
`ArrayStoreException` were thrown when reading annotation attribute
values for arrays.

Fixes gh-35252
2025-08-26 18:40:35 +02:00
rstoyanchev d8804c798b RestTestClient correctly exposes the response body
Closes gh-35385
2025-08-26 18:22:32 +03:00
Sam Brannen 55c315eb12 Merge branch '6.2.x' 2025-08-26 11:06:24 +02:00
Sam Brannen 4903fee939 Permit @⁠Nullable value in ResponseCookie from*() factory methods
Closes gh-35377
2025-08-26 11:01:29 +02:00
Brian Clozel 18eb2a6073 Polishing contribution
Closes gh-35225
2025-08-25 19:12:24 +02:00
spicydev 4101714830 Add compression support in JdkClientHttpRequestFactory
This commit ensures that the "Accept-Encoding" header is present for HTTP
requests sent by the `JdkClientHttpRequestFactory`. Only "gzip" and
"deflate" encodings are supported.

This also adds a custom `BodyHandler` that decompresses HTTP response
bodies if the "Content-Encoding" header lists a supported variant.

This feature is enabled by default and can be disabled on the request
factory.

See gh-35225

Signed-off-by: spicydev <vivek@mirchi.dev>
[brian.clozel@broadcom.com: squash commits]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-08-25 19:11:38 +02:00
Sébastien Deleuze fdfd15b9b3 Refine null-safety tooling introduction
Closes gh-35383
2025-08-25 14:39:59 +02:00
Brian Clozel 7112efee1b Align HttpStatus with RFC9110
This commit updates the `HttpStatus` enum with the latest changes in
RFC9110:

* deprecate "413 Payload Too Large" in favor of "413 Content Too Large"
* deprecate "418 I'm a teapot" as it was meant as a joke and is now
  marked as unused
* Introduce new "421 Misdirected Request"
* deprecate "422 Unprocessable Entity" in favor of
  "422 Unprocessable Content"
* deprecate "509 Bandwidth Limit Exceeded" as it's now unassigned
* deprecate "510 Not Extended" as it's now marked as "historic"

The relevant exceptions, test matchers and more have been updated as a
result.

Closes gh-32870
2025-08-25 14:30:57 +02:00
Sam Brannen 606b689fb1 Merge branch '6.2.x' 2025-08-24 14:02:27 +02:00
Sam Brannen 6978f0a398 Document terms and units in DataSize.parse(...) methods
Closes gh-35298
2025-08-24 14:02:04 +02:00
Juergen Hoeller a1f5f6aa92 Merge branch '6.2.x' 2025-08-24 10:32:31 +02:00
Juergen Hoeller f62519bb55 Add cancelRemainingTasksOnClose flag for enforcing early interruption
Closes gh-35372
2025-08-24 10:31:01 +02:00
Juergen Hoeller 0e2af5d113 Avoid default AutoCloseable implementation in ExecutorService on JDK 19+
Consistently calls shutdown() unless a specific close() method has been provided in a subclass.

Closes gh-35316
2025-08-24 10:30:48 +02:00
Sam Brannen 9e9d716d7a Merge branch '6.2.x' 2025-08-23 13:46:25 +02:00
Daniel Garnier-Moiroux ed7c3d737c Fix broken link in WebDriver docs
Closes gh-35374

Signed-off-by: Daniel Garnier-Moiroux <git@garnier.wf>
2025-08-23 13:41:40 +02:00
Juergen Hoeller e6f2b6a2a3 Upgrade to Netty 4.2.4 2025-08-22 23:21:59 +02:00
Juergen Hoeller acd68261e5 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-08-22 23:07:29 +02:00
Juergen Hoeller 01b24f2644 Upgrade to Protobuf 4.32, HtmlUnit 4.15, Mockito 5.19 2025-08-22 23:05:13 +02:00
Juergen Hoeller 4a4cf8a787 Remove erroneous javadoc symbol 2025-08-22 22:38:34 +02:00
Juergen Hoeller 56269d76e5 Merge branch '6.2.x' 2025-08-22 22:02:24 +02:00
Juergen Hoeller 55181fa1c9 Polishing 2025-08-22 22:00:52 +02:00
Juergen Hoeller 300ae841ce Align setBeanResolver nullability with getBeanResolver
Includes consistent javadoc for all applicable methods.

Closes gh-35371
2025-08-22 22:00:22 +02:00
Juergen Hoeller c248f94e5a Cache bean type next to primary bean names (on singleton creation)
This avoids singleton access for type checks in hasPrimaryConflict.

Closes gh-35330
2025-08-22 21:59:38 +02:00
Juergen Hoeller a46023134a Polishing 2025-08-22 21:05:16 +02:00
Brian Clozel d128dd2616 Make StartupStep AutoCloseable
This commit mames `StartupStep` extend `AutoCloseable` in order to allow
the try/with resources syntax and making the `step.end()` call
transparent.

Closes gh-35277
2025-08-22 19:24:11 +02:00
Sébastien Deleuze dc26aaa0ec Use JsonMapper instead of ObjectMapper when relevant
This commit updates Jackson 3 JSON support to use JsonMapper
instead of ObjectMapper in converters, codecs and view constructors.

As a consequence, AbstractJacksonDecoder, AbstractJacksonEncoder,
AbstractJacksonHttpMessageConverter and JacksonCodecSupport are
now parameterized with <T extends ObjectMapper>.

Closes gh-35282
2025-08-22 18:39:23 +02:00
Juergen Hoeller 8f4107953d Perform retryable proceed() call on invocableClone()
Closes gh-35353
2025-08-21 17:38:07 +02:00
NeatGuyCoding 57fa52262e Fix @⁠HttpServiceClient example in reference manual
Closes gh-35363

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-08-21 12:09:34 +02:00
Juergen Hoeller f64ff2866a Expose RetryException to onRetryPolicyExhaustion (also in the signature)
Includes getRetryPolicy and getRetryListener accessors in RetryTemplate.

Closes gh-35334
2025-08-21 11:54:27 +02:00
Juergen Hoeller 2489cced0f Expose RetryException#getRetryCount() and accept maxAttempts(0)
Closes gh-35351
Closes gh-35362
2025-08-20 23:15:40 +02:00
Sam Brannen 472f844256 Merge branch '6.2.x' 2025-08-20 16:42:56 +02:00
Sam Brannen 19d5ec6781 Improve documentation for ApplicationEvents to clarify recommended usage
See gh-35335
2025-08-20 16:42:22 +02:00
khj68 c0b71f8999 Improve Javadoc of ApplicationEvents to clarify preferred usage
This commit reorders and clarifies the usage instructions for
ApplicationEvents to:

1. Recommend method parameter injection as the primary approach, since
   ApplicationEvents has a per-method lifecycle
2. Clarify that ApplicationEvents is not a general Spring bean and
   cannot be constructor-injected
3. Explicitly state that field injection is an alternative approach

This addresses confusion where developers expect ApplicationEvents to
behave like a regular Spring bean eligible for constructor injection.

See gh-35297
Closes gh-35335

Signed-off-by: khj68 <junthewise@gmail.com>
2025-08-20 16:31:41 +02:00
Sam Brannen 5d214c2624 Polishing 2025-08-20 16:31:41 +02:00
Brian Clozel 208bb48254 Document OpenTelemetry HTTP server convention
Closes gh-35358
2025-08-20 16:16:26 +02:00
Tommy Ludwig 7e45f609a2 Add test for OpenTelemetryServerRequestObservationConvention
See gh-35358
2025-08-20 16:16:23 +02:00
Tommy Ludwig 3269751887 OTel semantic conventions for HTTP server for Servlet-based instrumentation
Adds an ObservationDocumentation and ObservationConvention implementation
that follows the OpenTelemetry semantic convention for HTTP Server
metrics and spans.

See gh-35358
2025-08-20 16:16:01 +02:00
Sam Brannen c942b21dea Generate consistent validation error messages in RetryPolicy
Closes gh-35355
2025-08-20 14:38:36 +02:00
Brian Clozel fce7b3d420 Remove Undertow-specific support and testing
Undertow does not support Servlet 6.1, we need to remove compatibility
tests as well as Undertow-specific classes for WebSocket and reactive
support.

Closes gh-35354
2025-08-20 10:32:33 +02:00
Sam Brannen 887ef75700 Remove redundant declarations of JSpecify's @⁠NonNull annotation
Closes gh-35341
2025-08-19 17:30:47 +02:00
Sam Brannen bb2a259d85 Wrap exceptionally long lines 2025-08-19 17:28:11 +02:00
Sébastien Deleuze 7a2a167f34 Upgrade nullability plugin to 0.0.4
This commit also includes related refinements of
JdbcTemplate#getSingleColumnRowMapper and
ObjectUtils#addObjectToArray.

Closes gh-35340
2025-08-19 15:31:57 +02:00
Sam Brannen 5d325ca0fc Improve wording for transactional rollback rule semantics
Closes gh-35346
2025-08-19 13:32:35 +02:00
Sam Brannen 68762b5f86 Merge branch '6.2.x' 2025-08-19 12:34:42 +02:00
Sam Brannen 6d710d482a Find annotation on overridden method in type hierarchy with unresolved generics
Prior to this commit, the MergedAnnotations support (specifically
AnnotationsScanner) and AnnotatedMethod did not find annotations on
overridden methods in type hierarchies with unresolved generics.

The reason for this is that ResolvableType.resolve() returns null for
such an unresolved type, which prevents the search algorithms from
considering such methods as override candidates.

For example, given the following type hierarchy, the compiler does not
generate a method corresponding to processOneAndTwo(Long, String) for
GenericInterfaceImpl. Nonetheless, one would expect an invocation of
processOneAndTwo(Long, String) to be @⁠Transactional since it is
effectively an invocation of processOneAndTwo(Long, C) in
GenericAbstractSuperclass, which overrides/implements
processOneAndTwo(A, B) in GenericInterface, which is annotated with
@⁠Transactional.

However, the MergedAnnotations infrastructure currently does not
determine that processOneAndTwo(Long, C) is @⁠Transactional since it is
not able to determine that processOneAndTwo(Long, C) overrides
processOneAndTwo(A, B) because of the unresolved generic C.

interface GenericInterface<A, B> {

    @⁠Transactional
    void processOneAndTwo(A value1, B value2);
}

abstract class GenericAbstractSuperclass<C> implements GenericInterface<Long, C> {

    @⁠Override
    public void processOneAndTwo(Long value1, C value2) {
    }
}

static GenericInterfaceImpl extends GenericAbstractSuperclass<String> {
}

To address such issues, this commit changes the logic in
AnnotationsScanner.hasSameGenericTypeParameters() and
AnnotatedMethod.isOverrideFor() so that they use
ResolvableType.toClass() instead of ResolvableType.resolve(). The
former returns Object.class for an unresolved generic which in turn
allows the search algorithms to properly detect method overrides in
such type hierarchies.

Closes gh-35342
2025-08-19 12:28:12 +02:00
Brian Clozel 4791565630 Polishing
See gh-35345
2025-08-19 11:12:06 +02:00
Brian Clozel 3fba265b60 Upgrade to Jetty 12.1.0
Jetty 12.1 is Jakarta EE11 compliant.

Closes gh-35345
2025-08-19 09:36:16 +02:00
Sébastien Deleuze 3dc2aa79a4 Fix HttpEntity support with Kotlin Serialization
This commit adds HttpEntity type unwrapping logic to
KotlinRequestBodyAdvice and KotlinResponseBodyAdvice.

Closes gh-35281
2025-08-18 12:01:48 +02:00
Brian Clozel 0d2a0d7b9e Fix '**' parsing within a PathPattern segment
Prior to this commit, a regexp path segment ending with a double wilcard
(like "/path**") would be incorrectly parsed as a double wildcard
segment ("/**").

This commit fixes the incorrect parsing.

Fixes gh-35339
2025-08-18 10:44:15 +02:00
Sam Brannen a999dd13f5 Document semantics of RetryException regarding cause and suppressed exceptions
Closes gh-35337
2025-08-17 19:17:27 +02:00
Sam Brannen 9d57dabe2f Rename exception variables to clarify intent 2025-08-17 19:17:27 +02:00
Sam Brannen ed2fb61ce9 Remove duplicated word in Javadoc 2025-08-17 18:19:33 +02:00
Sam Brannen a803ecdf26 Test expected behavior for RetryTemplate with zero retries 2025-08-17 17:59:14 +02:00
Sam Brannen 72afc66507 Make RetryTemplateTests more robust 2025-08-17 17:57:07 +02:00
Sam Brannen c38606610c Supply correct exception to RetryListener.onRetryPolicyExhaustion()
Prior to this commit, RetryTemplate supplied the wrong exception to
RetryListener.onRetryPolicyExhaustion(). Specifically, the execute()
method in RetryTemplate supplied the final, composite RetryException to
onRetryPolicyExhaustion() instead of the last exception thrown by the
Retryable operation.

This commit fixes that bug by ensuring that the last exception thrown by
the Retryable operation is supplied to onRetryPolicyExhaustion().

Closes gh-35334
2025-08-16 16:07:37 +02:00
Sam Brannen 9982369982 Revise nullability in RetryException
See gh-35332
2025-08-16 15:01:24 +02:00
Stéphane Nicoll 532911eb93 Mark RetryException#getCause non null
This commit simplifies RetryException to always require a root cause
and mark it as not nullable. Such exception is the exception thrown by
the retryable operation and should always be available as it explains
why the invocation was a candidate for retrying in the first place.

Closes gh-35332
2025-08-16 09:20:02 +02:00
Sébastien Deleuze 498b0c231b Always provision Java 24 for the CI Gradle build
See gh-35007
2025-08-14 20:03:08 +02:00
Sébastien Deleuze 06386d561b Merge branch '6.2.x' 2025-08-14 16:15:26 +02:00
Stefano Cordio ed28390d24 Refine @Contract Javadoc
This commit removes references to the `pure` attribute.
Relates to gh-33820.

Closes gh-35285
Signed-off-by: Stefano Cordio <stefano.cordio@gmail.com>
2025-08-14 16:12:46 +02:00
Sébastien Deleuze c6f1f719c3 Formatting issue in RestTestClient documentation
Closes gh-35328
2025-08-14 15:59:28 +02:00
Stéphane Nicoll a23230b6c0 Merge branch '6.2.x' 2025-08-14 09:55:29 +02:00
Stéphane Nicoll e2085063f6 Next development version (v6.2.11-SNAPSHOT) 2025-08-14 09:55:02 +02:00
Stéphane Nicoll fcc092d77e Merge branch '6.2.x' 2025-08-14 09:07:15 +02:00
Stéphane Nicoll edda4731e1 Build against Java 24
Closes gh-35326
2025-08-14 09:06:18 +02:00
Stéphane Nicoll 367b229ff6 Merge branch '6.2.x' 2025-08-14 08:48:15 +02:00
Stéphane Nicoll 9fa2d7d190 Upgrade to Jackson 2.18.4.1
Closes gh-35322
2025-08-14 08:38:58 +02:00
Stéphane Nicoll c30427fd4e Upgrade to Netty 4.1.124.Final
Closes gh-35321
2025-08-14 08:38:34 +02:00
Sébastien Deleuze 1af95a0704 Upgrade to Jackson 3.0.0-rc8 and 2.20.0-rc1
Closes gh-35295
2025-08-13 23:03:40 +02:00
rstoyanchev 8ec0c21b0a MockMvc handles param without values
Closes gh-35210
2025-08-13 15:23:04 +01:00
Juergen Hoeller 9f9b33c2ac Upgrade to Reactor 2025.0.0-M6, Micrometer 1.16.0-M2, Jetty 12.1.0.beta3
Includes Checkstyle 11.0, Groovy 5.0 RC1, JRuby 10.0.2, MockK 1.14.5

Closes gh-35310
Closes gh-35311
Closes gh-35233
2025-08-13 00:48:37 +02:00
Juergen Hoeller 39de72a361 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-08-13 00:07:25 +02:00
Juergen Hoeller 1d908f1847 Upgrade to Reactor 2024.0.9 and Micrometer 1.14.10
Includes Groovy 4.0.28, JRuby 9.4.13, Jetty 12.0.25, Caffeine 3.2.2, Protobuf 4.31.1, Selenium 4.35, HtmlUnit 4.14

Closes gh-35312
Closes gh-35313
2025-08-13 00:04:31 +02:00
Sébastien Deleuze 0389e3e3af Revert "Use JsonMapper instead of ObjectMapper when relevant"
This reverts commit d115f36400.

See gh-35282
2025-08-12 15:21:20 +02:00
Sébastien Deleuze 49b28be1be Fix JacksonJsonSockJsMessageCodec imports
Closes gh-35309
2025-08-12 10:43:07 +02:00
Sébastien Deleuze d115f36400 Use JsonMapper instead of ObjectMapper when relevant
This commit updates Jackson 3 support to use JsonMapper instead
of ObjectMapper in converter, codec and view constructors.

Closes gh-35282
2025-08-12 10:36:37 +02:00
Sébastien Deleuze bde806b7fc Upgrade SDKMAN to Java 24.0.2 2025-08-12 10:26:30 +02:00
rstoyanchev 83b7bef572 Polishing contribution
Closes gh-35227
2025-08-12 06:57:28 +01:00
Fabrice Bibonne bfcf4ea818 Document HTTP range request constraints
See gh-35227

Signed-off-by: Fabrice Bibonne <fabrice.bibonne@gmail.com>
2025-08-12 06:57:28 +01:00
rstoyanchev 553f289ddb Polishing contribution
Closes gh-35307
2025-08-12 06:43:10 +01:00
Phillip Webb 169b7015d2 Only add httpServiceProxyRegistry bean when necessary
Update `AbstractHttpServiceRegistrar` so that the
`httpServiceProxyRegistry` bean  is only added when registrations
are found.
2025-08-12 06:31:24 +01:00
rstoyanchev fbe96a8112 Polishing contribution
Closes gh-35224
2025-08-12 06:30:08 +01:00
Songdoeon b89dcb1a1a Subscription.unsubscribe() returns Receiptable
See gh-35224

Signed-off-by: Songdoeon <ehdjs9583@naver.com>
2025-08-12 06:11:35 +01:00
Juergen Hoeller 876b7d4209 Upgrade to Hibernate ORM 7.1
Closes gh-35308
2025-08-11 22:43:02 +02:00
rstoyanchev 8f1ade55d9 Update contribution
Closes gh-35273
2025-08-11 16:32:23 +01:00
SRIRAM9487 4d6a921df5 Add HTTP method support to MappedInterceptor
This enhancement enables finer control over interceptor application
based on HTTP methods, aligning with modern Spring 7.x practices.

- Extend MappedInterceptor with include/exclude HTTP methods
- Add constructors for interceptor implementations
- Update InterceptorRegistration with fluent methods
- Keep existing constructors and methods for compatibility
- Update matches() to check HTTP method conditions

See gh-35273

Signed-off-by: SRIRAM9487 <sriram9487tk@gmail.com>
2025-08-11 16:32:23 +01:00
Sam Brannen 15d3692669 Update assertion in JdbcClientIntegrationTests 2025-08-11 17:53:05 +03:00
Sam Brannen 0efa04f32c Merge branch '6.2.x' 2025-08-11 17:49:36 +03:00
Sam Brannen 37b076be51 Support multiple result sets in ScriptUtils.executeSqlScript()
Prior to this commit, ScriptUtils.executeSqlScript() treated every
statement within the script as if it were a single insert/update/delete
statement. This disregarded the fact that the execution of a JDBC
Statement can result in multiple individual statements, some of which
result in a ResultSet and others that result in an update count.

For example, when executing a stored procedure on Sybase, ScriptUtils
did not execute all statements within the stored procedure.

To address that, this commit revises the implementation of
ScriptUtils.executeSqlScript() so that it handles multiple results and
differentiates between result sets and update counts.

Closes gh-35248
2025-08-11 17:44:39 +03:00
Juergen Hoeller 29203d7293 Merge branch '6.2.x' 2025-08-11 14:34:17 +02:00
Juergen Hoeller a9453a5959 Polishing 2025-08-11 14:32:45 +02:00
Juergen Hoeller 3781ba223e Optimize NIO path resolution in PathEditor
Closes gh-35304
2025-08-11 14:32:39 +02:00
Sam Brannen a65ebec3d8 Merge branch '6.2.x' 2025-08-11 11:29:03 +03:00
Sam Brannen f11a1e6f82 Polish tests 2025-08-11 11:27:10 +03:00
rstoyanchev 29521e2f8a Merge branch '6.2.x' 2025-08-08 12:31:28 +01:00
rstoyanchev ffc785471b Fix checkstyle error 2025-08-08 12:31:13 +01:00
rstoyanchev 89ba0fd6df Polishing contribution
Closes gh-35294
2025-08-08 12:08:22 +01:00
Christoph 96deb27211 Make type in ProblemDetail nullable
See gh-35294

Signed-off-by: Christoph Wagner <cwagner@dimedis.de>
Signed-off-by: Christoph <cwagner@dimedis.de>
2025-08-08 11:54:03 +01:00
rstoyanchev a0542f023c Merge branch '6.2.x' 2025-08-08 11:50:58 +01:00
rstoyanchev 6e2fbfe108 Polishing contribution
Closes gh-35232
2025-08-08 11:50:07 +01:00
秦利斌 968e037503 Add documentation of RequestMapping about SpEL
Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-08-08 11:37:25 +01:00
rstoyanchev f0a9f649c1 Allow null in ProblemDetail#type
See gh-35294
2025-08-08 11:36:53 +01:00
rstoyanchev 600d6c6fc0 Update contribution
Closes gh-34721
2025-08-08 11:31:21 +01:00
giampaolo 7a55ce48a9 Handle CancellationException in JdkClientHttpRequest
Handle CancellationException in order to throw an HttpTimeoutException
when the timeout handler caused the cancellation.

See gh-34721

Signed-off-by: giampaolo <giampaorr@gmail.com>

fix: use timeoutHandler with a flag isTimeout

    Closes gh-33973

    Signed-off-by: giampaolo <giampaorr@gmail.com>
2025-08-08 11:31:21 +01:00
Juergen Hoeller 2f262afc51 Add documentation section on proxy type defaults and @Proxyable
See gh-35286
See gh-35296
2025-08-06 21:11:07 +02:00
Juergen Hoeller 573c5d96b9 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/AbstractAdvisingBeanPostProcessor.java
2025-08-06 19:03:14 +02:00
Juergen Hoeller 5df9fd4eff Polishing (aligned with main) 2025-08-06 19:01:18 +02:00
Juergen Hoeller d5408c047d Introduce @Proxyable annotation for bean-specific proxy type
Closes gh-35296
See gh-35293
2025-08-06 18:32:01 +02:00
Juergen Hoeller df86a9973d Introduce @Proxyable annotation for bean-specific proxy type
Closes gh-35296
See gh-35293
2025-08-06 18:26:40 +02:00
Juergen Hoeller 9edb96ae57 Introduce default ProxyConfig bean and exposed interfaces attribute
Taken into account by all proxy processors, this enables consistent proxy type defaulting in Spring Boot as well as consistent opting out for specific bean definitions.

Closes gh-35286
Closes gh-35293
2025-08-06 14:51:13 +02:00
Juergen Hoeller 4ad9396b15 Update CountDownLatch for non-pauseable beans
See gh-35269
2025-08-04 15:27:56 +02:00
Sam Brannen 61df497785 Revise reference docs regarding new ApplicationContext pause() support
See gh-35269
2025-08-04 12:05:26 +03:00
Sam Brannen e590341ca7 Revise Javadoc regarding new ApplicationContext pause() support
See gh-35269
2025-08-04 11:50:47 +03:00
Juergen Hoeller 4bfc129f84 Merge branch '6.2.x' 2025-08-01 21:17:54 +02:00
Juergen Hoeller da13a24604 Allow any @Transactional propagation for listener with BEFORE_COMMIT phase
Closes gh-35150
2025-08-01 21:15:56 +02:00
Juergen Hoeller 67e88f3c20 Align task execution tracking and thread interruption on shutdown
Closes gh-35254
2025-08-01 21:15:25 +02:00
Juergen Hoeller 03a8933f58 Add transactional support for StatelessSession (next to regular Session)
Exposes JPA-style shared proxy instances through LocalSessionFactoryBean.

Closes gh-7184
2025-08-01 17:18:43 +02:00
Brian Clozel ec87d90c9b Post process outgoing messages in JMS clients
Prior to this commit, the `JmsTemplate` would use `MessagePostProcessor`
for mutating JMS messages before they are being sent, but only if the
method takes a post processor as an argument.
The main use case so far is to mutate messages after they've been
created by a `MessageConverter` from a payload.

This commit updates the `JmsClient` to use `MessagePostProcessor` more
broadly, for all outgoing messages (converted or not). This brings an
interception-like mechanism for clients to enrich the message before
being sent.

This change also updates the `JmsClient` static factories and
introduces a Builder, allowing for more configuration options: multiple
message converters and message post processors.

Closes gh-35271
2025-08-01 15:40:32 +02:00
Juergen Hoeller 149d468ce4 Introduce ConfigurableApplicationContext.pause() and SmartLifecycle.isPauseable()
Closes gh-35269
2025-08-01 15:08:15 +02:00
rstoyanchev 96bc1f50c7 Add interceptors and converters to RestTestClient.Builder
Closes gh-35268
2025-08-01 13:31:37 +01:00
rstoyanchev 2b1a815167 Add supportedVersionPredicate to ApiVersionConfigurer
Closes gh-35267
2025-08-01 12:35:18 +01:00
rstoyanchev 87838aa4c5 PathApiVersionResolver is not nullable
Closes gh-35265
2025-07-31 15:32:12 +01:00
rstoyanchev da361699a4 Add MediaType parameter to ApiVersionInserter
Closes gh-35259
2025-07-31 15:32:12 +01:00
rstoyanchev 08ccf46399 Rename request param version strategy to query param
Closes gh-35263
2025-07-31 15:32:12 +01:00
rstoyanchev 18ee8adaeb Check resolver set when API version config customized
Closes gh-35256
2025-07-31 15:32:12 +01:00
NeatGuyCoding 5a3bad6d61 fix remove useless "s"
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-31 11:42:02 +01:00
rstoyanchev d661550b48 Update docs for HttpServiceClient
Closes gh-35244
2025-07-31 05:22:49 +01:00
rstoyanchev c8b2a0f830 Rename HttpServiceClientRegistrarSupport
to AbstractClientHttpServiceRegistrar since it is a registrar and
an extension of Abstract[HttpServiceRegistrar]. Also, a more
friendly name for use in application configuration.

See gh-35244
2025-07-31 05:22:44 +01:00
rstoyanchev 9dbe304cf6 Revise method order in AbstractHttpServiceRegistrar
See gh-35244
2025-07-31 05:22:29 +01:00
rstoyanchev 0fc9e4ec1c Exclude HttpServiceClient from GroupRegistry scan
The detect methods in the GroupRegistry that find all interfaces
with HttpExchange annotations now exclude HttpServiceClient
interfaces that are instead supported by a dedicated registrar.

This ensures there is no overlap between the HttpServiceClient
registrar scan and the ImportHttpServices registrar scan or
the scan of any other custom registrar.

See gh-35244
2025-07-31 05:22:06 +01:00
rstoyanchev 09917fad7b Fix bean name for ApiVersionStrategy in WebFlux config 2025-07-30 13:55:00 +01:00
rstoyanchev 279bce7124 Add HttpServiceClient and registrar
See gh-35244
2025-07-30 13:27:12 +01:00
rstoyanchev da443020e0 Rename AnnotationHttpServiceRegistrar
Align with the name of the import annotation.
In preparation of adding a client annotation with another registrar.

See gh-35244
2025-07-30 13:27:12 +01:00
rstoyanchev 4ae5d0d1fe Polishing in RestTestClient reference docs
Closes gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev f57828708a Polishing in RestTestClient tests
See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev 88ddc9d45d Polishing in [Rest|Web]TestClient Assertions
See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev 6cc1310274 Add API versioning to RestTestClient
See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev 862ffee385 Update RestTestClient ExchangeResult
to expose request and URI template information and to have toString

See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev 34f259778e Further alignment of RestTestClient and WebTestClient
See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev 2732b603dc Update RestTestClient builder hierarchy
Add concrete classes with specified generics for each MockMvc setup
Ensure Builder methods return the concrete class

See gh-34428
2025-07-30 07:13:48 +01:00
rstoyanchev db4696ceae Align RestTestClient and WebTestClient structure
See gh-34428
2025-07-30 07:13:48 +01:00
Rob Worsnop 934b8fc799 Common base classes for WebTestClient/RestTestClient Assertions
Fixes gh-31275

Signed-off-by: Rob Worsnop <rworsnop@gmail.com>
2025-07-30 07:13:48 +01:00
Rob Worsnop 37dcca54d2 Add RestTestClient
See gh-34428

Signed-off-by: Rob Worsnop <rworsnop@gmail.com>
2025-07-30 07:13:48 +01:00
rstoyanchev 336a5d0ac8 Add container for MockMvcServerServerSpec hierarchy
See gh-34428
2025-07-30 07:13:48 +01:00
Brian Clozel e838444e81 Merge branch '6.2.x' 2025-07-29 21:49:24 +02:00
Patrick Strawderman 24e66b63d1 Refine StringUtils#uriDecode and update documentation
Refine the StringUtils#uriDecode method in the following ways:
- Use a StringBuilder instead of ByteArrayOutputStream, and only decode
  %-encoded sequences.
- Use HexFormat.fromHexDigits to decode hex sequences.
- Decode to a byte array that is only allocated if encoded sequences are
  encountered.

This commit adds another optimization mainly for the use case where
there is no encoded sequence, and updates the Javadoc of both
StringUtils#uriDecode and UriUtils#decode to match the implementation.

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
Co-Authored-by: Sebastien Deleuze <sebastien.deleuze@broadcom.com>

Closes gh-35253
2025-07-29 21:44:26 +02:00
Juergen Hoeller 321a804449 Merge branch '6.2.x' 2025-07-28 22:07:53 +02:00
Juergen Hoeller f3832c7262 Add note on SQL types with SqlBinaryValue/SqlCharacterValue
Closes gh-34786
2025-07-28 22:06:38 +02:00
Juergen Hoeller 16e99f289c Accept support for generated keys column name array on HSQLDB/Derby
Closes gh-34790
2025-07-28 22:04:18 +02:00
Juergen Hoeller dacaf7fd56 Align @Nullable annotation 2025-07-28 20:33:33 +02:00
Juergen Hoeller 2a0a1fa67a Merge branch '6.2.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/metadata/GenericTableMetaDataProvider.java
2025-07-28 20:32:30 +02:00
Juergen Hoeller 642e554c52 Process PostgreSQL-returned catalog/schema names in given case
Closes gh-35064
2025-07-28 20:28:45 +02:00
rstoyanchev 2c32c770d5 Polishing in VersionRequestCondition
See gh-35237
2025-07-28 09:06:19 +01:00
rstoyanchev 2238121350 Prefer mapping without version for unversioned request
Closes gh-35237
2025-07-28 08:48:05 +01:00
rstoyanchev 48506db996 Avoid IllegalStateException for unversioned request
Closes gh-35236
2025-07-28 08:47:57 +01:00
Juergen Hoeller c7fbf7809f Provide @WebSocketScope annotation and public SCOPE_WEBSOCKET constant
Closes gh-35235
2025-07-26 11:38:02 +02:00
Juergen Hoeller 7316aab048 Align @Nullable annotation 2025-07-25 22:43:57 +02:00
Juergen Hoeller eaccb56de9 Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/io/support/PathMatchingResourcePatternResolver.java
2025-07-25 22:42:14 +02:00
Juergen Hoeller 4f6304707d Polishing 2025-07-25 22:40:15 +02:00
Juergen Hoeller 3c112703d9 Introduce useCaches flag on UrlResource (for URLConnection access)
Propagated from PathMatchingResourcePatternResolver's setUseCaches.

Closes gh-35218
2025-07-25 22:40:09 +02:00
Juergen Hoeller 8c44a61033 Invalidate cache entries for matching types after singleton creation
Closes gh-35239
2025-07-25 22:38:57 +02:00
Brian Clozel 444573d4b5 Display original request URI in NoResourceFoundException message
This commit ensures that the original request URI is displayed in
`NoResourceFoundException` error messages when logged. Without this
change, it can be confusing to see only the attempted resource path.
There are cases where the original request was not meant for resource
handling and we want to understand why this wasn't processed by another
handler.

The Problem Detail attribute has not been changed as the "instance"
attribute already displays the request path.

Closes gh-34553
2025-07-25 15:04:59 +02:00
Brian Clozel d06255214e Support wildcard path elements at the start of path patterns
Prior to this commit, the `PathPattern` and `PathPatternParser` would
allow multiple-segments matching and capturing with the following:

* "/files/**" (matching 0-N segments until the end)
* "/files/{*path}" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This would be only allowed as the last path element in the pattern and
the parser would reject other combinations.

This commit expands the support and allows multiple segments matching at
the beginning of the path:

* "/**/index.html" (matching 0-N segments from the start)
* "/{*path}/index.html" (matching 0-N segments until the end and capturing
  the value as the "path" variable)

This does come with additional restrictions:

1. "/files/**/file.txt" and "/files/{*path}/file.txt" are invalid,
   as multiple segment matching is not allowed in the middle of the
   pattern.
2. "/{*path}/files/**" is not allowed, as a single "{*path}" or "/**"
   element is allowed in a pattern
3. "/{*path}/{folder}/file.txt"  "/**/{folder:[a-z]+}/file.txt" are
   invalid because only a literal pattern is allowed right after
   multiple segments path elements.

Closes gh-35213
2025-07-25 13:24:18 +02:00
Sébastien Deleuze ed2cad3af0 Merge branch '6.2.x' 2025-07-23 16:30:12 +02:00
Sébastien Deleuze 5e338ef1b8 Make MessageSource locale parameter nullable
Closes gh-35230
2025-07-23 16:02:38 +02:00
Brian Clozel 4bb191d51c Upgrade to Jetty 12.1.0.beta2
Closes gh-35233
2025-07-23 11:19:35 +02:00
Sam Brannen c6e46cf91f Merge branch '6.2.x' 2025-07-21 13:24:47 +03:00
Sam Brannen 445da24631 Upgrade to JUnit 5.13.4
Closes gh-35229
2025-07-21 13:17:38 +03:00
Sébastien Deleuze 1ef6c6398a Upgrade to Jackson 3.0.0-rc6 and 2.19.2
Closes gh-35228
2025-07-21 11:15:18 +02:00
Sam Brannen fbc5ff80f4 Implement AutoCloseable in GzippedFiles 2025-07-18 15:45:59 +03:00
Stéphane Nicoll dd8313f200 Migrate to Palentir's JavaPoet
Closes gh-35214
2025-07-17 16:25:46 +02:00
Sébastien Deleuze 200b3ea023 Restore Java 17 compatibility in KotlinConventions
See gh-35211
2025-07-17 12:13:19 +02:00
Sébastien Deleuze c2a162a48b Link to the right Framework version in the KDoc
See gh-35211
2025-07-17 09:59:00 +02:00
Brian Clozel 8b4ff8c56b Merge branch '6.2.x' 2025-07-17 09:55:35 +02:00
Brian Clozel 6d97791f5e Next development version (v6.2.10-SNAPSHOT) 2025-07-17 09:55:21 +02:00
Sébastien Deleuze adc64d5cbc Upgrade to Dokka 2.0.0
See https://kotlinlang.org/docs/dokka-migration.html

Closes gh-35211
2025-07-16 18:27:10 +02:00
Juergen Hoeller 6f725dc7aa Upgrade to MockK 1.14.4 2025-07-16 15:34:11 +02:00
Juergen Hoeller 75cb826b7b Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-07-16 15:33:50 +02:00
Juergen Hoeller a4ec25d9ec Upgrade to MockK 1.13.17 2025-07-16 15:31:46 +02:00
Juergen Hoeller 17382fe079 Re-initialize Quartz ConnectionProvider on context restart
Closes gh-35208
2025-07-16 15:21:49 +02:00
rstoyanchev 6f5a7eed76 Add section on Range requests to reference
Closes gh-35052
2025-07-16 13:50:41 +01:00
Brian Clozel 4bf048cfcf Configure ByteBuddy agent on test tasks
This commit replaces the Mockito agent configuration with a single
bytebuddy agent configuration that addresses both Mockito and mockk on
tests.

Closes gh-35207
2025-07-16 13:50:20 +02:00
Brian Clozel ebe1f65e21 Apply Mockito Java Agent to Kotlin tests too
See gh-35207
2025-07-15 21:58:53 +02:00
Juergen Hoeller 28471c33ae Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
#	spring-web/src/main/java/org/springframework/http/server/observation/DefaultServerRequestObservationConvention.java
#	spring-web/src/main/java/org/springframework/http/server/reactive/observation/DefaultServerRequestObservationConvention.java
2025-07-15 21:26:38 +02:00
Juergen Hoeller 0fc043f762 Upgrade to Netty 4.1.123, Selenium 4.34, XMLUnit 2.10.3 2025-07-15 21:15:16 +02:00
Brian Clozel bb88ec9ea5 Configure Mockito Java agent in Test tasks
Closes gh-35207
2025-07-15 21:00:20 +02:00
Juergen Hoeller 54732605a5 Backport nullability refinements for Micrometer
See gh-35170
2025-07-15 20:56:36 +02:00
Juergen Hoeller eac490d320 Upgrade to Reactor 2025.0.0-M5 and Micrometer 1.16.0-M1
Includes Netty 4.2.3

Closes gh-35169
Closes gh-35170
2025-07-15 20:40:59 +02:00
Sébastien Deleuze 20a1261574 Make rootObject parameter consistently nullable
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 4fdf40e39e Fix Checkstyle configuration for nullability annotations
While assessing #35195, I noticed the following issues with our
Checkstyle configuration regarding nullability annotations.

- "^(?!org\.jspecify|\.annotations).*(NonNull|Nullable)$" contains a "|".

- "^(?!org\.jspecify|\.annotations).*(NonNull|Nullable)$" matches against
  NonNull but not against Nonnull, and therefore incorrectly permits
  usage of javax.annotation.Nonnull.

- Some of the Checkstyle suppressions no longer apply.

This commit addresses all of the above issues and updates several tests
to use example annotations other than javax.annotation.Nonnull where
feasible.

See gh-35195
Closes gh-35205
2025-07-15 16:50:21 +02:00
Sam Brannen aac61b86c8 Revert "Disallow @org.jetbrains.annotations.Nullable imports"
This reverts commit 6e6280a42c.

See gh-35114
See gh-35195
2025-07-15 16:45:55 +02:00
rstoyanchev e3f1bc8422 Allow resolution of optional HandlerMethod
Closes gh-35067
2025-07-15 15:39:49 +01:00
Sébastien Deleuze 19086835a7 Upgrade tests to OkHttp 5.x
See https://square.github.io/okhttp/changelogs/changelog/#version-500.

Closes gh-35183
2025-07-15 16:20:07 +02:00
Juergen Hoeller b76e748ecf Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-07-15 16:01:21 +02:00
Juergen Hoeller 12a6098eae Upgrade to Reactor 2024.0.8 and Micrometer 1.14.9
Closes gh-35201
Closes gh-35202
2025-07-15 16:00:00 +02:00
Juergen Hoeller f86034b528 Drop final declaration from doFilter entry point (for CGLIB proxying)
Closes gh-35198
2025-07-15 15:59:23 +02:00
Brian Clozel ad007caebc Refine multipart converter registration in HttpMessageConverters
As of #33894, `HttpMessageConverters` auto-detects converters and use
custom-provided ones to configure a collection of converters for the
client or the server.
Right now the multipart converter is only configured if core converters
(JSON, XML...) are configured/detected. We do not reuse the base
converters (resource, string, byte array) for the multipart converter
as it applies different encoding defaults (ISO for the main ones, UTF-8
for multipart).

This commit refines the configuration to not only include the multipart
converter when core converters are present, but also if any other
converter was configured.

Closes gh-35203
2025-07-15 14:45:28 +02:00
Sam Brannen 2e0cc63616 Implement DisplayNameCustomizer properly 2025-07-15 10:46:48 +02:00
Sam Brannen 7d628b6298 Polish Resilience Features section of reference manual 2025-07-15 10:39:49 +02:00
Sam Brannen dbe89abd7b Pause unused application contexts in the TestContext framework
Since the introduction of the Spring TestContext Framework in 2007,
application contexts have always been stored in the context cache in a
"running" state. However, leaving a context running means that
components in the context may continue to run in the background. For
example, JMS listeners may continue to consume messages from a queue;
scheduled tasks may continue to perform active work, etc.; and this can
lead to issues within a test suite.

To address such issues, this commit introduces built-in support for
pausing application contexts when they are not in use and restarting
them if they are needed again.

Specifically, the TestContextManager now marks a test's application
context as "unused" after execution of the test class has ended, and
the underlying ContextCache then "stops" the application context if no
other test class is currently using the context. When a
TestExecutionListener later attempts to obtain a paused application
context -- for example, for a subsequent test class that shares the
same application context -- the ContextCache ensures that context is
restarted before returning it.

See https://github.com/spring-projects/spring-boot/issues/28312
See gh-35171
Closes gh-35168
2025-07-14 18:29:02 +02:00
Sam Brannen f3757cedb9 Polish context caching section 2025-07-14 18:27:01 +02:00
Sam Brannen 4107ddc5e2 Remove obsolete Checkstyle suppression
See commit 7606a929c9
See gh-35107
2025-07-14 18:26:54 +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'
# 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 21807832c8 Upgrade to Jetty 12.0.23, Netty 4.1.122, Gson 2.13.1, Caffeine 3.2.1 2025-07-13 16:33:52 +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
Brian Clozel b48f65aed6 Update milestone release action
See gh-35188
2025-07-12 19:09:27 +02:00
Brian Clozel 2ea17a2c43 Merge branch '6.2.x' 2025-07-12 18:42:42 +02:00
Brian Clozel 4063cb5b9a Publish releases using Central Portal
Closes gh-35188
2025-07-12 18:42:03 +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
Sam Brannen 8eedfdf66a Polishing 2025-07-12 17:18:33 +02:00
Juergen Hoeller 64de254b58 Merge branch '6.2.x' 2025-07-11 22:50:47 +02:00
Juergen Hoeller 4277682a5c Catch InaccessibleObjectException next to IllegalAccessException
Closes gh-35190
2025-07-11 22:44:11 +02:00
Juergen Hoeller ba6166a02d Prefer most abstract method in getPubliclyAccessibleMethodIfPossible
Closes gh-35189
2025-07-11 22:42:36 +02:00
Juergen Hoeller c754bfe7e6 Fall back to getPubliclyAccessibleMethodIfPossible on IllegalAccessException
Closes gh-34028
2025-07-11 22:41:50 +02:00
Brian Clozel b59dca9c7f Align HttpMessageConverters builder with WebFlux codecs variants
As of #33894, we introduced a new `HttpMessageConverters` API.
While this achieved our goal of focusing converters classpath detection
in a single place and avoiding waste, a single `HttpMessageConverters`
instance for both client and server added more complexity for developers.

This commit aligns the API here with the WebFlux `CodecsConfigurer` to
opt for a client/server flavor as the first step in the builder.
While this make the sharing of converter instances between server and
client impossible, this allows for a simpler API and separates concerns.

Closes gh-35187
2025-07-11 17:07:28 +02:00
Sam Brannen ddaf13b8ed Merge branch '6.2.x' 2025-07-11 15:52:54 +02:00
chenggwang 5aa15923cf Make targetBeanName field in AbstractBeanFactoryBasedTargetSource protected
Prior to this commit, subclasses of AbstractBeanFactoryBasedTargetSource
referenced the targetBeanName via getTargetBeanName() which throws an
IllegalStateException if the targetBeanName has not yet been set.

This commit changes the visibility of the targetBeanName field from
private to protected in order to facilitate direct access through
this.targetBeanName where no assertion is needed.

By doing so, we avoid exceptions in logging and toString()
implementations in subclasses.

Closes gh-35172

Signed-off-by: chenggwang <90715678+chenggwang@users.noreply.github.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-07-11 15:51:10 +02:00
Juergen Hoeller 22a23322f3 Polishing 2025-07-10 20:05:47 +02:00
Juergen Hoeller e9c402cd0f Upgrade to Hibernate ORM 7.0.5 and Caffeine 3.2.1 2025-07-10 20:05:13 +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 2025-07-10 19:33:51 +02:00
Juergen Hoeller a0c083619f Consistent line breaks in reference documentation 2025-07-10 19:33:34 +02:00
Juergen Hoeller 481a74a202 Add reference documentation for @Retryable and @ConcurrencyLimit
See gh-35133
See gh-34529
2025-07-10 17:14:08 +02:00
Juergen Hoeller 200934c673 Add reference documentation for JmsClient next to JmsTemplate
See gh-32501
2025-07-10 17:13:58 +02:00
Juergen Hoeller a3e9f0c16d Add bindSynchronizedResource with automatic unbinding after transaction completion
Closes gh-35182
2025-07-10 17:13:51 +02:00
Brian Clozel 0a705f467d Configure custom converters ahead in HttpMessageConverters
This commit aligns `HttpMessageConverters` with the WebFlux codecs
configuration by adding custom converters first, before the
auto-detected and well-known ones.

This is a general approach in Spring Framework, where custom
implementations are more likely to handle specific uses cases and should
be involved before considering the more general implementations.

Fixes gh-35177
2025-07-10 16:56:06 +02:00
Sam Brannen 440bf94cee Improve URLs in Validation chapter of the reference manual
In order to improve the user experience with URLs for sections of the
Validation chapter, this commit makes the following changes to page
names in the "validation" folder.

- beans-beans.html --> data-binding.html

- conversion.html --> error-code-resolution.html

Some of the section anchors in data-binding.html have also been
renamed. For example, #beans-beans is now #data-binding-property-binding.

Closes gh-35181
2025-07-10 14:03:28 +02:00
Sam Brannen cc59acb7ab Fix type conversion example 2025-07-10 12:16:50 +02:00
Sam Brannen 7d394a0564 Merge branch '6.2.x' 2025-07-10 11:53:38 +02:00
Sam Brannen 983fdebdbb Document how to register runtime hints for convention-based conversion
Closes gh-35178
2025-07-10 11:51:13 +02:00
Sam Brannen e3445b17a7 Improve Conversion section of ref docs 2025-07-10 11:51:13 +02:00
Sam Brannen 40f9ac58d2 Further polishing of AOT section 2025-07-10 11:51:13 +02:00
Sébastien Deleuze 197de07634 Document a NullAway limitation 2025-07-10 10:52:38 +02:00
Sébastien Deleuze b8015d87ef Use flexible generics nullness in RestClient ExchangeFunction
Closes gh-35180
2025-07-10 10:39:51 +02:00
Sam Brannen 78bf41ca83 Merge branch '6.2.x' 2025-07-09 17:41:53 +02:00
Sam Brannen 95ad25ebf2 Polish AOT section of the reference docs 2025-07-09 17:39:29 +02:00
rstoyanchev 47d9182f56 Merge branch '6.2.x' 2025-07-09 12:51:37 +01:00
rstoyanchev 9670388e0c Support conditional streaming with ResponseEntity<?>
Closes gh-35153
2025-07-09 12:44:12 +01:00
Sam Brannen 7ea619aefb Merge branch '6.2.x' 2025-07-09 12:56:33 +02:00
Sam Brannen 3dc22379a0 Register runtime hints for Instant-to-Timestamp conversion
If an application depends on automatic type conversion from
java.time.Instant to java.sql.Timestamp, the ObjectToObjectConverter
performs the conversion based on convention, by using reflection to
invoke Timestamp.from(Instant).

However, when running in a native image a user needs to explicitly
register runtime hints for that particular use of reflection.

To assist users who are running their applications in a native image,
this commit automatically registers the necessary runtime hints for
Timestamp.from(Instant) so that users do not have to.

See gh-35175
Closes gh-35156
2025-07-09 12:35:10 +02:00
Sam Brannen 7900315f23 Introduce Date-to-Instant and Instant-to-Date converters
In order to avoid unnecessary use of reflection and to simplify native
image deployments, this commit introduces explicit support for
automatic conversions from java.util.Date to java.time.Instant and vice
versa.

To achieve that, this commit introduces an InstantToDateConverter and a
DateToInstantConverter and registers them automatically in
DefaultConversionService.

See gh-35156
Closes gh-35175
2025-07-09 12:31:44 +02:00
rstoyanchev 99e4815d9e Merge branch '6.2.x' 2025-07-09 11:03:49 +01:00
rstoyanchev c23edae4db HttpRequestValues.Processor exposes MethodParameter[]
Closes gh-35148
2025-07-09 10:54:46 +01:00
rstoyanchev 6bd12e8680 Clear CONTENT_DISPOSITION before error handling
Closes gh-35116
2025-07-09 08:59:26 +01:00
Juergen Hoeller 523552ac2e Introduce ConfigurableApplicationContext.restart() method
Closes gh-35171
2025-07-08 18:50:05 +02:00
Sébastien Deleuze b48da4c0c2 Upgrade to Kotlin Serialization 1.9.0
See gh-34453
2025-07-08 12:33:04 +02:00
Sébastien Deleuze 2d7323bb7f Update Spring MVC message converters documentation
Closes gh-35166
2025-07-07 18:15:44 +02:00
Sébastien Deleuze a61b297967 Specify flexible generics nullness in spring-jdbc
This commit leverages flexible generics nullness at method and
type level when relevant in spring-jdbc.

Due to https://github.com/uber/NullAway/issues/1075, some related
`@SuppressWarnings("NullAway")` have been added.

JdbcOperations Kotlin extensions have been refined accordingly.

Closes gh-34911
2025-07-07 16:35:25 +02:00
Juergen Hoeller 2b56b759af Fix JmsClient visibility
See gh-32501
2025-07-07 16:06:28 +02:00
Sam Brannen 2f202ffcde Add compileOnly dependency on JSR-305 annotations for Reactor
After the upgrade to Selenium 4.33.0 in commit 1051592ae8, the
spring-test module began to fail as follows.

/home/runner/.gradle/caches/modules-2/files-2.1/io.projectreactor/reactor-core/3.8.0-M4/3195c7882f5833915a74ee18d58857cabc29b4c6/reactor-core-3.8.0-M4.jar(/reactor/util/annotation/Nullable.class):
  warning: Cannot find annotation method 'when()' in type 'Nonnull':
    class file for javax.annotation.Nonnull not found
warning: unknown enum constant When.MAYBE
  reason: class file for javax.annotation.meta.When not found
error: warnings found and -Werror specified
1 error
2 warnings

To address that, this commit introduces a compileOnly dependency on
"com.google.code.findbugs:jsr305".
2025-07-07 15:57:14 +02:00
Sam Brannen b1222ccab7 Polish contribution
See gh-35086
2025-07-07 15:37:24 +02:00
Renato Mameli b901afffd0 Fix consumes handling for interface @RequestBody
Previously, @RequestBody(required = false) annotations declared
on interface methods were ignored when resolving the consumes
condition. This caused mappings to incorrectly require a request
body with a Content-Type such as application/json, even when no
body was provided.

This change uses AnnotatedMethod to retrieve parameter annotations
from both the implementation and its interfaces, ensuring that the
required flag is respected and body presence is evaluated correctly.

Closes gh-35086

Signed-off-by: Renato Mameli <renatomamel410@gmail.com>
2025-07-07 15:34:40 +02:00
Juergen Hoeller a2d495de9f Merge branch '6.2.x'
# 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 1051592ae8 Upgrade to Selenium 4.33 and HtmlUnit 4.13 2025-07-07 14:36:01 +02:00
Juergen Hoeller 3bd96f72a6 Leniently tolerate null bean as aspect instance
Closes gh-35074
2025-07-07 14:26:19 +02:00
Juergen Hoeller 9406e7ee2a Add additional javadoc notes on 7.0
See gh-34709
See gh-34757
2025-07-07 14:08:43 +02:00
Juergen Hoeller 56f16a8817 Add usage examples to JmsClient javadoc
See gh-32501
2025-07-07 14:08:33 +02:00
Yanming Zhou 4969f6b742 Improve BeanFactoryExtensionsTests
Comparing to Java's `BeanFactory.getBean(Class<T> requiredType)`, Kotlin's `BeanFactory.getBean<T>()` supports generic type as `T`, this commit add test to cover that and add assertions.

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-07-07 13:38:02 +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
Yanming Zhou 88257f7dfd Discard further rows once maxRows has been reached
See https://github.com/spring-projects/spring-framework/issues/34666#issuecomment-2773151317

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-07-07 13:37:31 +02:00
NeatGuyCoding d957f8bb5d Fix copy-n-paste errors in JmsClient Javadoc
Closes gh-35163

Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-07 12:41:35 +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 a80305ee71 Skip initialization of a NullBean
Prior to this commit, AbstractAutowireCapableBeanFactory's
initializeBean() method always attempted to initialize a NullBean.

However, invokeInitMethods() (which is invoked by initializeBean())
skips processing of a NullBean, which is logical since a NullBean will
never contain init-methods.

In practice, initialization and post-processing of a NullBean should
not result in any change to the NullBean.

This commit therefore skips initialization of a NullBean altogether.

Closes gh-35165
2025-07-07 11:12:28 +02:00
rstoyanchev 1982c7e020 Support 404 handling for HttpExchange interfaces
Closes gh-32105
2025-07-07 09:12:22 +01:00
rstoyanchev 340468cf4b Use toString for WebFilter checkpoint
Closes gh-34702
2025-07-07 09:12:22 +01:00
Sam Brannen 19ce8c3d01 Merge branch '6.2.x' 2025-07-05 14:10:41 +02:00
Sam Brannen 75b7f5efcf Upgrade to Gradle 8.14.3
Closes gh-35162
2025-07-05 14:04:18 +02:00
Sam Brannen 32b56a35c6 Short-circuit matching algorithm in InstanceFilter
In commit 97522cfa36, I implemented a
short-circuiting matching algorithm in DefaultRetryPolicy for includes
and excludes, which was later copied to MethodRetrySpec.

After we switched to using ExceptionTypeFilter, I realized that the
matching algorithm in InstanceFilter (the superclass of
ExceptionTypeFilter) does not exhibit the same short-circuiting
characteristics.

In light of that, this commit revises the matching algorithm in
InstanceFilter to mirror the original short-circuiting algorithm in
DefaultRetryPolicy.

See gh-35058
See gh-35109
See gh-35160
Closes gh-35161
2025-07-05 13:13:52 +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 33f51b183d Add missing tests for ExceptionTypeFilter 2025-07-05 12:15:14 +02:00
Juergen Hoeller 0111329214 Consistently introspect constructor-provided JmsTemplate
See gh-32501
2025-07-04 21:50:20 +02:00
Juergen Hoeller 8cb901825b Merge branch '6.2.x'
# Conflicts:
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/JdbcTemplate.java
#	spring-jms/src/main/java/org/springframework/jms/core/JmsTemplate.java
#	spring-messaging/src/main/java/org/springframework/messaging/core/AbstractDestinationResolvingMessagingTemplate.java
#	spring-messaging/src/main/java/org/springframework/messaging/core/AbstractMessageReceivingTemplate.java
#	spring-messaging/src/main/java/org/springframework/messaging/core/AbstractMessagingTemplate.java
#	spring-messaging/src/main/java/org/springframework/messaging/core/MessageRequestReplyOperations.java
#	spring-messaging/src/main/java/org/springframework/messaging/core/MessageSendingOperations.java
2025-07-04 18:31:13 +02:00
Juergen Hoeller 65e5c14245 Polishing 2025-07-04 18:20:27 +02:00
Juergen Hoeller 9596b70b2a Consistent nullability and exception declarations
Closes gh-35159
2025-07-04 18:20:19 +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 46c40e7b96 Require explicit constraints in @⁠Contract
Prior to this commit, the value attribute in @⁠Contract was declared as
follows.

    String value() default "";

That allowed empty declarations such as @⁠Contract or @⁠Contract();
however, a contract is not useful without declared constraints.

To address that, this commit removes the `default ""` declaration in
order to force users to provide explicit constraints.

Although one could technically still declare the annotation without
constraints via @⁠Contract(""), it's unlikely that anyone would
intentionally do that.

Closes gh-35157
2025-07-04 18:16:52 +02:00
Juergen Hoeller 6dc3c11828 Introduce JmsClient with configurable settings per operation
Closes gh-32501
Closes gh-26840
2025-07-04 17:36:33 +02:00
Juergen Hoeller 842f582afc Specify fetchSize/maxRows/queryTimeout per statement in JdbcClient
Closes gh-35155
2025-07-04 17:36:18 +02:00
Sam Brannen c9a01051c9 Merge branch '6.2.x' 2025-07-04 17:19:14 +02:00
Sam Brannen 292ea1769f Upgrade to JUnit 5.13.3
Closes gh-35103
2025-07-04 17:17:39 +02:00
Sam Brannen cf06efece6 Merge branch '6.2.x' 2025-07-04 11:49:10 +02:00
Sam Brannen 5da8d5e795 Remove unnecessary final declarations in JmsTemplate
This commit removes unnecessary `final` declarations for parameters that
are "effectively final".
2025-07-04 11:38:30 +02:00
Sam Brannen 133f330850 Declare remaining messageSelector parameters in JmsOperations as @⁠Nullable
Closes gh-35151
2025-07-04 11:35:49 +02:00
Jiandong Ma b6675edb92 Declare messageSelector parameters in JmsOperations as @⁠Nullable
See gh-35151

Signed-off-by: Jiandong Ma <jiandong.ma.cn@gmail.com>
2025-07-03 19:17:49 +02:00
Sam Brannen 6865380f97 Fix "liver" typo 2025-07-03 18:56:30 +02:00
rstoyanchev ff707d0ccb Add UserWebTestClientConfigurer
Closes gh-35042
2025-07-03 17:11:11 +01:00
rstoyanchev 1b30b469c4 Make SslInfo nullable
This allows autowiring a MockServerSpec in test class and using a different
identity or none at all with each test.

Polishing in MockServerSpecTests.

See gh-35042
2025-07-03 17:11:11 +01: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 27072ccb87 Improve wording 2025-07-03 14:17:43 +02:00
rstoyanchev 26d413c521 Update router function docs for API versioning
Closes gh-35113
2025-07-02 15:09:32 +01:00
Sébastien Deleuze 701e034c0e Improve null-safety documentation related to TYPE_USE
This commit refines the null-safety documentation to document more
explicitly the code style guidelines related to
`@Target(ElementType.TYPE_USE)`.

Closes gh-35098
2025-07-02 15:28:51 +02:00
Sam Brannen 0f495d3b64 Remove obsolete Javadoc reference
See gh-35144
2025-07-02 11:47:12 +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 196b7ec275 Deprecate (Jdbc)DaoSupport classes (including JmsGatewaySupport)
Closes gh-35145
2025-07-02 11:12:57 +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
Sam Brannen 5cae769c2d Remove maxDuration/maxElapsedTime support from RetryPolicy
When the core retry functionality was introduced, it had a built-in
MaxRetryDurationPolicy. In #35058, that was migrated to a
withMaxDuration() factory method, and in #35110 that was renamed to
withMaxElapsedTime() (with a corresponding maxElapsedTime() method on
the builder) in order to align with the maxElapsedTime feature of
ExponentialBackOff. The latter also changed the semantics of the
feature in the context of the RetryPolicy.

However, @⁠Retryable does not provide maxElapsedTime support.

In addition, the maxElapsedTime feature is a bit misleading, since it
does not actually track CPU time or wall-clock time but rather only the
sum of individual, accumulated back-off intervals/delays, which is
likely not very useful. Furthermore, the maxElapsedTime will never
apply to a zero-valued delay/interval.

In light of the above, this commit removes the maxElapsedTime support
from the built-in RetryPolicy.

Users can still implement a custom BackOff strategy if they find they
need some form of "max elapsed time" or "max duration".

See gh-34716
See gh-35058
See gh-34529
See gh-35110
Closes gh-35144
2025-07-02 10:18:36 +02:00
Juergen Hoeller b256babad5 Polishing 2025-07-01 18:01:39 +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 2025-07-01 17:51:23 +02:00
Juergen Hoeller 978590161a Upgrade to Checkstyle 10.26.1 2025-07-01 17:51:14 +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
rstoyanchev 3ce7613195 Add version deprecation tests for router functions
Given the move of ApiVersionStrategy support to AbstractHandlerMapping,
deprecation should already work. We only need tests to show it.

See gh-35113
2025-07-01 11:37:34 +01:00
rstoyanchev 86f50b20f2 Move ApiVersionStrategy up to AbstractHandlerMapping
Similar to CorProcessor, ApiVersionStrategy is now supported at the
AbstractHandlerMapping level.

See gh-35113
2025-07-01 11:37:34 +01:00
Sam Brannen 93a9c9b8bf Merge branch '6.2.x' 2025-07-01 11:29:45 +02:00
Sam Brannen 0828fe8e1c Remove obsolete update_copyright_headers.sh script
Closes gh-35142
2025-07-01 11:29:21 +02:00
Sébastien Deleuze fb214bb74a Merge branch '6.2.x' 2025-07-01 11:02:54 +02:00
Sébastien Deleuze 9cb9a865c2 Upgrade SDKMAN to Java 24.0.1 2025-07-01 11:02:44 +02:00
Phillip Webb 89b8b1a468 Prevent cache pollution by storing only the factories
Update `SpringFactoriesLoader` so that the cache stores only the
factories and not the complete loader.

Prior to this commit, if a cache entry was added with the thread
context classloader, the loader instance would be added and the
classloader stored. If the thread context classloader subsequently
changes, and a call is made to `forDefaultResourceLocation` with
`null` for the classloader, the cached entry would be used which
contains the older classloader.

Closes gh-34732
2025-07-01 11:01:48 +02:00
NeatGuyCoding 009b880e92 Fix potentially loses precision and jitter is not well capped with unit tests
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-01 10:56:53 +02:00
NeatGuyCoding eeedeb3b10 Remove the duplicated “rss” assertion
Closes gh-35139
Signed-off-by: NeatGuyCoding <15627489+NeatGuyCoding@users.noreply.github.com>
2025-07-01 10:21:48 +02:00
Sam Brannen 60b19278c0 Merge branch '6.2.x' 2025-06-30 17:39:17 +02:00
Sam Brannen 900dd0c3eb Polish contribution
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' 2025-06-29 17:42:35 +02:00
Sam Brannen 1ad05db877 Simplify dependency management for JUnit artifacts
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
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
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
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
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
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
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
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
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
Juergen Hoeller 543314fcbb Polishing 2025-06-25 18:07:24 +02:00
Juergen Hoeller d47f1a1749 Migrate orm.hibernate5 to orm.jpa.hibernate package for Hibernate ORM 7.0
Closes gh-35111
2025-06-25 18:07:15 +02:00
Sam Brannen f3f05da39b Refer to Spring Retry project in Javadoc 2025-06-25 16:38:48 +02:00
rstoyanchev e508dea82d Merge branch '6.2.x' 2025-06-25 12:45:04 +01:00
rstoyanchev f84552a97e Polishing contribution
Closes gh-35102
2025-06-25 12:37:42 +01:00
Daniil Razorenov 8d6117e419 Support StreamingHttpOutputMessage in RestClient
This commit allows RestClient to handle StreamingHttpOutputMessage
properly by checking the type of the request and invoking setBody()
when appropriate. This improves interoperability with components that
expect streamed output.

A new integration test has been added to verify the functionality.

See gh-35102

Signed-off-by: Daniil Razorenov <daniltmb@gmail.com>
2025-06-25 12:36:32 +01:00
rstoyanchev 40eb9c2c81 Add docs for API version deprecation support
Closes gh-35049
2025-06-25 12:03:35 +01:00
rstoyanchev 482cfb0b18 Add detectSupportedVersions in spring-webmvc
Closes gh-35105
2025-06-25 12:03:35 +01:00
rstoyanchev 3cb8a833e4 Polishing API versioning ref docs 2025-06-25 12:03:35 +01:00
rstoyanchev 785aab8ad5 Rename ApiDeprecationHandler to insert "Version"
The name is a bit long, but it is necessary to indicate it's a handler
for a deprecation version, and the decision is based on the version,
not an individual endpoint.

See gh-35049
2025-06-25 12:03:35 +01:00
Sam Brannen 7606a929c9 Fail build for JUnit discovery issues
JUnit 5.13 introduced support for Discovery Issues which typically
indicate configuration errors in tests that may result in unexpected
behavior.

Furthermore, discovery issues that are currently reported at INFO level
may later be reported at WARNING or ERROR level -- for example, in
JUnit 6.

In order to ensure that our test suite does not suffer from such
potential errors, this commit sets the
junit.platform.discovery.issue.severity.critical JVM system property to
INFO (instead of leaving it with the default ERROR configuration).

Doing so aligns with our build configuration which fails the build for
selected warnings in Java source code and Javadoc.

If we later determine that INFO causes unnecessary issues for us, we
can switch to WARNING.

This commit also removes two "intentionally invalid" test cases from
AutowiredConfigurationErrorsIntegrationTests, since those test cases
are now reported as invalid as of JUnit 5.13.

Closes gh-35107
2025-06-25 11:25:29 +02:00
Sam Brannen ad2b7f4d01 Merge branch '6.2.x' 2025-06-25 10:23:28 +02:00
Sam Brannen 2477544a8f Polishing 2025-06-25 10:22:47 +02:00
Tran Ngoc Nhan abbd4ebcf6 Link to @⁠ContextConfiguration Javadoc from reference manual
Closes gh-35088

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-06-25 10:16:24 +02:00
Juergen Hoeller e828bbbb0a Invert order of suppressed exceptions (for common exception rendering)
See gh-35057
2025-06-24 22:22:45 +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 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
Juergen Hoeller 04f3975e0f Support for qualified EntityManager/EntityManagerFactory injection (JPA 3.2)
Closes gh-33414
2025-06-24 18:51:18 +02:00
Juergen Hoeller b0eacd22e0 Support for exposing additional object types in SmartFactoryBean
Closes gh-35101
2025-06-24 18:51:04 +02:00
Sam Brannen 3bf9b0de72 Merge branch '6.2.x' 2025-06-24 16:14:19 +02:00
Sam Brannen cdf4c61d08 Upgrade to JUnit 5.13.2
Closes gh-35103
2025-06-24 16:12:39 +02:00
Sébastien Deleuze 839d3a7d44 Refine nullability of PropertyResolver.getProperty(key: String)
Closes gh-35104
2025-06-24 16:06:32 +02:00
Sébastien Deleuze 294406dae9 Remove @Suppress("EXTENSION_SHADOWED_BY_MEMBER")
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
rstoyanchev 3dfb6a7c0b Fix failing test 2025-06-23 18:20:59 +01:00
rstoyanchev ffdf941219 Resolve API version in RequestMappingHandlerMapping
API version resolution and parsing is already applied as long as
an ApiVersionStrategy is configured and irrespective of whether
a given RequestMapping has a version or not.

RequestMappingHandlerMapping also needs to be aware of the API version
in order to apply deprecated version handling. So it is better to
resolve, parse, and validate the version in the beginning of
handler mapping rather than in the first call to any
VersionRequestCondition.

Closes gh-35049
2025-06-23 18:03:56 +01:00
rstoyanchev 492e51f3ba Add handling of deprecated API versions
See gh-35049
2025-06-23 18:03:56 +01:00
rstoyanchev 0eec1dc636 Consistently validate API version
Closes gh-35082
2025-06-23 18:03:56 +01:00
rstoyanchev a0f9872746 Refactor construction of VersionRequestCondition
The single constructor now supports all combinations of having a version
attribute set or not, and ApiVersionStrategy, configured or not.

In effective, ensure the configured ApiVersionStrategy is passed even
when the RequestMapping version attribute is not set.

See gh-35082
2025-06-23 18:03:56 +01:00
rstoyanchev 5d34f9c87e Support API versioning via MediaType parameter
Closes gh-35050
2025-06-23 18:03:55 +01:00
Sébastien Deleuze ba9bef6bbf Upgrade to Kotlin 2.2.0
Kotlin 2.2 is the new baseline for Spring Framework 7.0.

-Xannotation-default-target=param-property is specified to avoid
warnings when compiling tests or documentation snippets. It is
expected to become the default behavior in an upcoming version
of Kotlin, see https://youtrack.jetbrains.com/issue/KT-73255 for
more details.

Closes gh-34453
2025-06-23 18:11:06 +02:00
Sébastien Deleuze fee873d8d2 Update JUnit javadoc link
Otherwise the build is broken by a redirect.
2025-06-23 17:33:17 +02:00
Juergen Hoeller f36fec1651 Upgrade to Hibernate ORM 7.0.2 and Hibernate Validator 9.0.1
Includes missing upgrade for Jetty EE11 support 12.1.0.beta1

See gh-33750
See gh-35084
2025-06-23 11:15:33 +02:00
Sam Brannen 12146c4a1b Clean up warning in Gradle build 2025-06-20 16:43:36 +02:00
Sam Brannen 7ffd4e7cf8 Sync test fixture MockServerHttpRequest implementation with original 2025-06-20 16:33:28 +02:00
Brian Clozel 8448dc90a4 Upgrade to Jetty 12.1.0.beta1
Closes gh-35084
2025-06-20 09:45:53 +02:00
Sam Brannen c17b481939 Fix link in Javadoc
See gh-35042
See gh-35078
2025-06-19 13:58:29 +02:00
Sam Brannen f478f5cdc8 Introduce factory methods in SslInfo and remove MockSslInfo
After further consideration, we have decided to remove the recently
introduced MockSslInfo in favor of introducing the following static
factory methods directly in the SslInfo interface.

- SslInfo.from(String sessionId)

- SslInfo from(String sessionId, X509Certificate... peerCertificates)

See gh-35042
See gh-35078
2025-06-19 13:39:31 +02:00
Sam Brannen 1fb04cb83a Add support for configuring SslInfo in WebTestClient
Prior to this commit, there was no easy way to configure an SslInfo
instance for use with WebTestClient.

To address that, this commit introduces a new sslInfo(SslInfo) method
in WebTestClient.MockServerSpec, which can be used as follows.

var client = WebTestClient.bindToApplicationContext(context)
                          .sslInfo(new MockSslInfo("mock ID"))
                          // ...
                          .build();

Closes gh-35042
2025-06-19 12:48:03 +02:00
Sam Brannen 4375e59a28 Polish WebTestClient ApplicationContext tests
Prerequisite for gh-35042
2025-06-19 11:57:56 +02:00
Sam Brannen 9ca7b623aa Introduce MockSslInfo
Closes gh-35078
2025-06-19 11:54:12 +02:00
rstoyanchev a2b90d9e9a Add HttpExchangeAdapter decoration
Closes gh-35059
2025-06-18 15:32:40 +01:00
Sam Brannen 0e84761871 Return Builder from sslInfo() builder method for MockServerHttpRequest
Prior to this commit, the sslInfo() method in MockServerHttpRequest's
BaseBuilder returned void, which prevented it from being used with the
intended fluent Builder pattern.

This commit changes the return type to the builder (B) for proper method
chaining.

Closes gh-35075
2025-06-18 13:19:43 +02:00
WonYong Hwang 5d0fc72eb2 Document intention of toString() in HandlerMethod
Document that HandlerMethod.toString() is used in log and error messages,
and that the returned description should typically include the method
signature of the underlying handler method for clarity and debugging.

Closes gh-35055

Signed-off-by: WonYong Hwang <111210881+wonyongg@users.noreply.github.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-06-18 13:00:44 +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 aa525cc3cd Delegate to ReflectionUtils.accessibleConstructor 2025-06-18 12:20:30 +02:00
Juergen Hoeller 00399dc1b3 Reject null for returned CompletableFuture (avoiding subsequent NPE)
See gh-34708
2025-06-18 12:20:19 +02:00
Juergen Hoeller e33adadc62 Detect SQL state 57014 as QueryTimeoutException
Closes gh-35073
2025-06-18 12:20:09 +02:00
Brian Clozel 0202d79232 Merge branch '6.2.x' 2025-06-17 17:19:35 +02:00
Brian Clozel 45d887f973 Fix missing request body for GET and DELETE JdkClientHttpRequest
This commit fixes a regression introduced in gh-34971 where GET and
DELETE requests would not allow request bodies anymore for
`JdkClientHttpRequest`.
We are now using `builder.GET()` and `builder.DELETE()` methods only if
the provided body is null.

Fixes gh-35068
2025-06-17 17:19:21 +02:00
Sam Brannen c5fd57d92b Polish @⁠Retryable Javadoc and internals 2025-06-17 17:07:15 +02:00
Sébastien Deleuze f601bbb2ac Allow usage of @CheckReturnValue on types and ctors
Closes gh-34910
2025-06-17 16:53:12 +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 41f35ef6b3 Update configuration for copyright headers to use "<year>-present" pattern
Historically, we have used `<introduction year>-<modification year>` as
the pattern for copyright headers.

For example: `Copyright 2002-2025 the original author or authors.`

However, we have been encouraged to use `present` as the modification
year.

In light of that, this commit updates the following to enforce the new
pattern.

- The patterns in our SpringHeaderCheck Checkstyle rules
- The `Copyright 2002-${year}` template in org.eclipse.jdt.ui.prefs
- The update_copyright_headers.sh script

See gh-35070
2025-06-17 16:20:46 +02:00
Sam Brannen 485f0f82db Merge branch '6.2.x' 2025-06-17 16:10:46 +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
Sam Brannen 89140789b9 Update configuration for copyright headers to use "<year>-present" pattern
Historically, we have used `<introduction year>-<modification year>` as
the pattern for copyright headers.

For example: `Copyright 2002-2025 the original author or authors.`

However, we have been encouraged to use `present` as the modification
year.

In light of that, this commit updates the following to enforce the new
pattern.

- The patterns in our SpringHeaderCheck Checkstyle rules
- The `Copyright 2002-${year}` template in org.eclipse.jdt.ui.prefs
- The update_copyright_headers.sh script

See gh-35070
2025-06-17 15:54:36 +02:00
Juergen Hoeller f69df9b767 Introduce retry interceptor and annotation-based retry support
Based on RetryTemplate with ExponentialBackOff.
Includes optional jitter support in ExponentialBackOff.
Supports reactive methods through Reactor's RetryBackoffSpec.

Closes gh-34529
2025-06-17 12:49:29 +02:00
Johnny Lim cd5e4c2264 Fix typo in ProtobufHttpMessageConverterTests.canWrite()
See gh-34645
Closes gh-35062

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-16 18:40:32 +02:00
Sam Brannen cc7dc47c4c Simplify suppressed exception assertions
See https://github.com/assertj/assertj/issues/3858
2025-06-16 16:32:24 +02:00
Brian Clozel 764d35c072 Merge branch '6.2.x' 2025-06-16 15:54:43 +02:00
Brian Clozel 696692f1ed Do not attempt to decode wildcard content-types as form-data
Prior to this commit, the `DefaultServerWebExchange` would attempt to
decode request bodies as form-data or multipart of the request
content-type was compatible with the expected media types.

If requests are sent with an invalid wildcard content-type such as "*/*"
or "multipart/*", we should not attempt to decode here.

Fixes gh-34660
2025-06-16 15:51:47 +02:00
Sam Brannen 6bbfd56dce Remove duplication in RetryTemplateTests 2025-06-16 14:32:33 +02:00
Sam Brannen f41a568b1d Improve Javadoc for RetryPolicy.Builder 2025-06-16 14:31:50 +02:00
Sam Brannen 09372b72ae Add retryWithExceptionExcludes() test 2025-06-16 13:33:10 +02:00
Sam Brannen 97522cfa36 Introduce Builder API and factory methods for RetryPolicy
Prior to this commit, we had three concrete RetryPolicy implementations.

- MaxRetryAttemptsPolicy
- MaxDurationAttemptsPolicy
- PredicateRetryPolicy

However, there was no way to combine the behavior of those policies.
Furthermore, the PredicateRetryPolicy was practically useless as a
standalone policy, since it did not have a way to end an infinite loop
for a Retryable that continually throws an exception which matches the
predicate.

This commit therefore replaces the current built-in RetryPolicy
implementations with a fluent Builder API and dedicated factory methods
for common use cases.

In addition, this commit also introduces built-in support for
specifying include/exclude lists.

Examples:

new MaxRetryAttemptsPolicy(5) -->

    RetryPolicy.withMaxAttempts(5)

new MaxDurationAttemptsPolicy(Duration.ofSeconds(5)) -->

    RetryPolicy.withMaxDuration(Duration.ofSeconds(5))

new PredicateRetryPolicy(IOException.class::isInstance) -->

    RetryPolicy.builder()
        .maxAttempts(3)
        .predicate(IOException.class::isInstance)
        .build();

The following example demonstrates all supported features of the builder.

RetryPolicy.builder()
    .maxAttempts(5)
    .maxDuration(Duration.ofMillis(100))
    .includes(IOException.class)
    .excludes(FileNotFoundException.class)
    .predicate(t -> t.getMessage().contains("Unexpected failure"))
    .build();

Closes gh-35058
2025-06-16 13:15:38 +02:00
Juergen Hoeller 945f3fb5ac Revise RetryTemplate for alignment with Reactor
Exposes last exception as cause in RetryException.
Applies first back-off after the initial exception.
Breaks out of retry loop on BackOffExecution.STOP.
Expects null result in Retryable and RetryListener.

Closes gh-35057
2025-06-16 12:05:25 +02:00
Brian Clozel 2aa0bad432 Merge branch '6.2.x' 2025-06-15 18:50:58 +02:00
Brian Clozel faada70d59 Reset respone content-type for invalid range responses
Prior to this commit, the `ResourceHttpRequestHandler` would detect
invalid range requests and reply with a 416 response status and the
relevant range header. Because this was triggering an error dispatch,
the error handling would collect error metadata and produce an error
response with the original content-type.
This would most likely fail because the content-type is most likely a
file-related media type which cannot be used for error responses.

This commit resets the response content type in these cases and let the
error handling pick the most sensible media type for the error response.

Fixes gh- 34490
2025-06-15 18:42:45 +02:00
Brian Clozel af7758cbc7 Configure CheckStyle rule for empty catch blocks
This commit configures a new CheckStyle rule that fails for empty
"catch" blocks, unless the exception is named "ignored" or "expected".

This also fixes the remaining instances missed by the previous commit.

Closes gh-35047
2025-06-15 16:11:48 +02:00
Vincent Potucek 0d4dfb6c1f Rename exception variables in empty catch blocks
The Spring codebase sometimes ignores exceptions in catch blocks on
purpose. This is often called out by an inline comment.
We should make this more obvious by renaming the exception argument in
the catch block to declare whether the exception is "ignored" or
"expected".

See gh-35047

Signed-off-by: Vincent Potucek <vpotucek@me.com>
[brian.clozel@broadcom.com: rework commit message]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-06-15 16:11:42 +02:00
Sam Brannen cd3ac44fb0 Add test for CompositeRetryListener.addListener() 2025-06-15 15:23:43 +02:00
Sam Brannen 8dc9621ad7 Merge branch '6.2.x' 2025-06-14 15:35:09 +02:00
Sam Brannen 9f1aef16f9 Fix Javadoc for FixedBackOff 2025-06-14 15:33:04 +02:00
Brian Clozel 3da645f4b9 Merge branch '6.2.x' 2025-06-13 16:57:26 +02:00
rstoyanchev 00cc48dad4 Support repeatable multipart write
Closes gh-34859
2025-06-13 15:50:22 +01:00
Brian Clozel 8dee7d8fb6 Use concrete form-data type when reading request body
Prior to this commit, the WebFlux server support would try reading
form-data from the request by:

* first, checking that request content-type is compatible with a
  form-data content-type
* then by selecting a message reader that is compatible with the given
  request content-type

This approach is flawed because if the content-type provided by the
request is too broad, another message reader could be selected that's
not meant to be used for reading form-data. Typically, a JSON message
reader could be selected and would fail when reading the request.
This problem was previously hidden because message readers would not
support `MultiValueMap` as a target type. Now that some readers support
this type, this can lead to deserialization errors.

This commit now ensures that in all cases, we attempt to read form-data
with a message reader that supports the
"application/x-www-form-urlencoded" media type.

Fixes gh-34660
2025-06-13 16:45:46 +02:00
Yanming Zhou d8ac3ff31f Fix typo in WebMvc.fn document
Closes gh-35045

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-06-13 10:03:07 +02:00
Brian Clozel cd80ca0fe0 Merge branch '6.2.x' 2025-06-13 09:57:18 +02:00
Johnny Lim 722333f0f1 Polish DataBufferInputStream.skip()
See gh-34799
Closes gh-35030

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-13 09:57:02 +02:00
Brian Clozel f46a57f4f5 Merge branch '6.2.x' 2025-06-13 09:29:44 +02:00
Brian Clozel 26ae3ed8d4 Upgrade "setup-gradle" GitHub action 2025-06-13 09:29:14 +02:00
Brian Clozel 309f850dad Use Java 24 for running Gradle
As of Gradle 8.14, Gradle is now compatible with Java 24 for running
Gradle.
2025-06-13 00:50:11 +02:00
Brian Clozel f111858055 Relax Java 24 toolchain requirements
While we choose our GitHub action to use Bellsoft Liberica, we should
relax that vendor requirement and ensure that contributors can build the
project with any Java 24 distribution.

Closes gh-35043
2025-06-13 00:49:05 +02:00
Stéphane Nicoll 75c4bc8947 Merge pull request #35038 from OlgaMaciaszek
* pr/35038:
  Polish "Add hints to instantiate HttpService group adapters"
  Add hints to instantiate HttpService group adapters

Closes gh-35038
2025-06-12 21:28:09 +02:00
Stéphane Nicoll 8bf9e0cbff Polish "Add hints to instantiate HttpService group adapters"
See gh-35038
2025-06-12 21:24:58 +02:00
Olga Maciaszek-Sharma 8142f80581 Add hints to instantiate HttpService group adapters
See gh-35038

Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>
2025-06-12 21:23:35 +02:00
Sam Brannen 082eb607ec Overhaul tests for RetryTemplate 2025-06-12 17:34:54 +02:00
Sam Brannen ff167aafa2 Make built-in RetryPolicy implementations final
Closes gh-35040
2025-06-12 17:34:54 +02:00
Sébastien Deleuze fb0fb21b78 Merge branch '6.2.x' 2025-06-12 16:40:36 +02:00
Sébastien Deleuze e425504eac Revert "Disable Gradle auto-provisioning" on 6.2.x
This reverts commit 40058ef875.

Closes gh-35041
2025-06-12 16:37:59 +02:00
秦利斌 1a5cc87bb1 Remove unused field in ResourceHttpRequestHandler
Closes gh-35037

Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-06-12 14:57:26 +02:00
Brian Clozel 3a1c2f7064 Merge branch '6.2.x' 2025-06-12 11:44:40 +02:00
Brian Clozel 08d5af3d2a Next development version (v6.2.9-SNAPSHOT) 2025-06-12 11:44:16 +02:00
Patrick Strawderman fd2038c927 Use String.replace in MetadataEncoder
Use String.replace instead of replaceAll in MetadataEncoder; since Java 9, String.replace
no longer uses a regex, while replaceAll does. The use case here of replacing a single
character does not require a regex.

Closes gh-35025

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-06-12 09:01:11 +02:00
Brian Clozel f11235ee19 Merge branch '6.2.x' 2025-06-12 08:53:02 +02:00
Brian Clozel f0e7b42704 Encode non-printable character in Content-Disposition parameter
Prior to this commit, the "filename" parameter value for the
"Content-Disposition" header would contain non-printable characters,
causing parsing issues for HTTP clients.
This commit ensures that all non-printable characters are encoded.

Fixes gh-35034
2025-06-12 08:39:29 +02:00
Sam Brannen bfd3dc2676 Implement toString() in RetryPolicy and RetryExecution implementations
Closes gh-35029
2025-06-11 19:17:03 +02:00
Sam Brannen bc967842f6 Rename and polish ComposedRetryListenerTests 2025-06-11 19:04:48 +02:00
Sam Brannen b6680422db Change signature of RetryOperations.execute() regarding nullability
Due to lacking support in NullAway for the current arrangement, we are
(perhaps temporarily) changing the signature of the execute() method in
RetryOperations (and thus also in RetryTemplate)...

from: <R extends @Nullable Object> R execute(Retryable<R> retryable);

to:   <R> @Nullable R execute(Retryable<? extends @Nullable R> retryable);

Once https://github.com/uber/NullAway/issues/1075 has been resolved, we
will consider switching back to the original signature.

See gh-34716
2025-06-11 17:43:29 +02:00
Brian Clozel a462f5e853 Merge branch '6.2.x' 2025-06-11 17:41:53 +02:00
Johnny Lim e86dc9ad95 Apply gh-34856 to MockClientHttpRequest in testfixture package
Closes gh-35031

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-11 17:40:54 +02:00
rstoyanchev 84a4b44cf0 Polishing contribution
Closes gh-34807
2025-06-11 15:50:32 +01:00
hgh1472 9d3de4ff68 Remove duplicated setup
See gh-34807

Signed-off-by: hgh1472 <hgh1472@naver.com>
2025-06-11 15:50:32 +01:00
Sam Brannen 8f3ca49bc4 Rename Retryable.run() to Retryable.execute()
See gh-34716
2025-06-11 13:50:16 +02:00
Sam Brannen d74b863ae7 Polish Javadoc for core retry functionality
See gh-34716
2025-06-11 13:49:00 +02:00
Sam Brannen 8b9e620084 Allow FixedBackOff to be constructed with only a custom interval
This commit introduces two new constructors:

- FixedBackOff(long)

- FixedBackOff(Duration)

Closes gh-35028
2025-06-11 13:26:16 +02:00
Sam Brannen fcdd439ad0 Polish Javadoc for FixedBackOff 2025-06-11 13:06:55 +02:00
Sébastien Deleuze b901132192 Merge branch '6.2.x' 2025-06-11 10:15:36 +02:00
Sébastien Deleuze 05c3f56ec7 Rely on default retention in @Contract
Closes gh-35027
2025-06-11 10:14:59 +02:00
Brian Clozel 68df780c59 Upgrade to Micrometer 1.15.1
Closes gh-35019
2025-06-11 09:25:05 +02:00
Brian Clozel 3d63664ab0 Upgrade to Reactor 2025.0.0-M4
Closes gh-34997
2025-06-11 09:24:30 +02:00
Brian Clozel bdc5fafd0a Merge branch '6.2.x' 2025-06-11 09:23:52 +02:00
Brian Clozel dee80ab1da Upgrade to Reactor 2024.0.7
Closes gh-35021
2025-06-11 09:23:17 +02:00
Brian Clozel 07fd835ea9 Upgrade to Micrometer 1.14.8
Closes gh-35020
2025-06-11 09:22:50 +02:00
Brian Clozel dec0deb7dc Merge branch '6.2.x' 2025-06-11 09:21:38 +02:00
Brian Clozel 0d6c6eb2d5 Use Micrometer BOM for Context Propagation dependency
Closes gh-35026
2025-06-11 09:15:30 +02:00
Sam Brannen d42d3f1a6c Fix wording in Javadoc for RetryTemplate
See gh-34716
2025-06-10 18:34:56 +02:00
Sam Brannen 51b6e8cc9f Rename RetryCallback to Retryable
See gh-34716
2025-06-10 18:26:52 +02:00
Sam Brannen f927ff635a Revise @⁠Nullable declarations for contains*() in CollectionUtils
Closes gh-35023
2025-06-10 17:50:37 +02:00
Sam Brannen 2c0f01e8ed Merge branch '6.2.x' 2025-06-10 11:52:37 +02:00
Sam Brannen 4d2cc4ae97 Polish contribution
See gh-35013
2025-06-10 11:45:20 +02:00
Mohammad Saeed Nouri c04902fefb Allow update of existing WebSession after max sessions limit is reached
Previously, when saving a WebSession, the system did not check whether
the session ID already existed. As a result, even if the session being
saved was an update to an existing one, it was incorrectly treated as a
new session, and a "maximum sessions exceeded" error was triggered.

This fix ensures that if a WebSession with the same ID already exists,
it will be updated rather than counted as a new session, thereby
preventing unnecessary session limit violations.

Closes gh-35013

Signed-off-by: Mohammad Saeed Nouri <msnsaeed71@gmail.com>
2025-06-10 11:44:59 +02:00
Sam Brannen 3c265e1044 Fix InMemoryWebSessionStoreTests.startsSessionImplicitly() test 2025-06-10 11:44:00 +02:00
Sam Brannen 222702f750 Polish WebSession support and tests 2025-06-10 11:43:56 +02:00
Sébastien Deleuze be02d961fc Merge branch '6.2.x' 2025-06-09 16:55:33 +02:00
Sébastien Deleuze 7bb19fcde8 Refine Kotlin Serialization hint registration
This commit adds support for serializer methods with a parameter.

Closes gh-34979
2025-06-09 16:48:15 +02:00
Sam Brannen 077146d636 Merge branch '6.2.x' 2025-06-09 14:12:45 +02:00
Sam Brannen 18d6a55e3e Polishing and removal of "this." for method invocations 2025-06-09 14:10:30 +02:00
Sébastien Deleuze b6a121ed44 Merge branch '6.2.x' 2025-06-09 11:03:47 +02:00
秦利斌 99890b6147 Fix ResourceHttpRequestHandler#setHeaders JavaDoc
Closes gh-35004
Signed-off-by: 秦利斌 <68638598+Allan-QLB@users.noreply.github.com>
2025-06-09 10:55:21 +02:00
Sébastien Deleuze ef2495874d Upgrade to Kotlin 2.2.0-RC2
See gh-34946
2025-06-09 10:42:52 +02:00
Sam Brannen de7d50d39f Redeclare @⁠TestMethodOrder on @⁠Nested test class
Thanks to the new Discovery Issue Reporting mechanism introduced in JUnit 5.13, I became
aware of the fact that the @⁠Order annotations in NestedAfterTestClassSqlScriptsTests
were being silently ignored.

To address that, this commit redeclares @⁠TestMethodOrder on @⁠Nested test class.
2025-06-07 15:22:57 +02:00
Sam Brannen 5752585bb2 Clean up warnings in build 2025-06-07 12:37:27 +02:00
Sam Brannen 0b4f7f2f9d Remove obsolete code
The hasNullableAnnotation() method was made obsolete in commit
b5d153febf.

See gh-34952
See gh-34261
2025-06-07 12:23:56 +02:00
Sam Brannen 799a37602d Merge branch '6.2.x' 2025-06-07 12:15:02 +02:00
Sam Brannen 0afdb08099 Upgrade to JUnit 5.13.1
Closes gh-34969
2025-06-07 12:03:10 +02:00
Sam Brannen 315bbf3abe Consistently declare nullability @⁠Contract for core utilities
Closes gh-34934
2025-06-07 11:41:38 +02:00
Sébastien Deleuze 9505e768ae Merge branch '6.2.x' 2025-06-06 18:21:24 +02:00
Sébastien Deleuze 40058ef875 Disable Gradle auto-provisioning
Closes gh-35007
2025-06-06 18:18:52 +02:00
Sam Brannen 7a6f9bd3c3 Use @⁠TempDir in FileSystemUtilsTests 2025-06-06 16:34:56 +02:00
rstoyanchev 6c27dbc095 Merge branch '6.2.x' 2025-06-06 15:28:43 +01:00
rstoyanchev c769f43b3e Update docs on testing client code
Closes gh-34892
2025-06-06 15:28:28 +01:00
rstoyanchev 4782c697b8 Improve RestControllerAdvice documentation
Closes gh-34866
2025-06-06 15:28:28 +01:00
rstoyanchev de52090959 Polishing contribution
Closes gh-34554
2025-06-06 15:28:28 +01:00
Vedran Pavic 4d862b871d Improve Javadoc for @ExceptionHandler
This commit adds `ProblemDetail` and `ErrorResponse` to the list of
supported return types for `@ExceptionHandler` methods.

Closes gh-34554

Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
2025-06-06 15:28:28 +01:00
Jimmy Axenhus fa781c8390 Correct name of Selenium WebDriver artifact
The selenium-htmlunit3-driver artifact does not exist.

Closes gh-34840

Signed-off-by: Jimmy Axenhus <github@axenhus.com>
2025-06-06 15:28:28 +01:00
Sam Brannen 583612fd40 Merge branch '6.2.x' 2025-06-06 15:13:42 +02:00
Sam Brannen 88cd7addda Upgrade to Gradle 8.14.2
Closes gh-34937
2025-06-06 15:06:06 +02:00
Sam Brannen 87c0655e12 Polishing 2025-06-06 15:01:44 +02:00
Sam Brannen ad2931b51f Migrate away from AssertJ's catchThrowable()
Closes gh-35003
2025-06-06 15:01:26 +02:00
Sam Brannen 3aa3b81e1c Update copyright headers 2025-06-06 13:49:23 +02:00
Johnny Lim 7f6a7b806e Replace AssertionsForClassTypes with Assertions
Closes gh-34821

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-06 13:49:23 +02:00
Sébastien Deleuze 977792009d Introduce hints in RestClient API
This commit introduces hints in RestClient API for
SmartHttpMessageConverters supporting them.

Closes gh-34924
2025-06-06 13:10:12 +02:00
Brian Clozel 72601b6948 Merge branch '6.2.x' 2025-06-06 12:06:08 +02:00
Brian Clozel 332c7f770c Remove Link to AspectJ Javadoc
Closes gh-35000
2025-06-06 12:05:44 +02:00
Juergen Hoeller 8d17afc28b Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-06-06 09:25:25 +02:00
Juergen Hoeller 9f76ea13e3 Upgrade to Groovy 4.0.27, Mockito 5.18, Checkstyle 10.25 2025-06-06 09:21:37 +02:00
Juergen Hoeller d9c103b7ff Remove unnecessary fallback to DefaultConversionService
See gh-34936
2025-06-06 09:21:21 +02:00
Juergen Hoeller 167350d408 Merge branch '6.2.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/aspectj/AspectJExpressionPointcut.java
#	spring-aop/src/main/java/org/springframework/aop/aspectj/ShadowMatchUtils.java
2025-06-05 20:39:20 +02:00
Juergen Hoeller f1ddd051a3 Restore synchronization against AspectJ race condition behind PointcutExpression
Closes gh-34735
2025-06-05 20:36:10 +02:00
Juergen Hoeller a266e1b403 Close JarFile only in case of useCaches=false
Closes gh-34955
2025-06-05 20:20:47 +02:00
Sébastien Deleuze 826041d2f7 Add Kotlin body advices
This commit introduces KotlinRequestBodyAdvice and
KotlinResponseBodyAdvice in order to set a KType hint when relevant.

Closes gh-34923
2025-06-05 18:53:31 +02:00
rstoyanchev 9f7a321c44 Support streaming with HTTP interfaces + RestClient
Closes gh-32358
2025-06-05 17:07:01 +01:00
Sam Brannen 02af9e5cee Revise core retry support
This commit constitutes a first pass over the new core retry support.

- Fix code and Javadoc formatting

- Polish/fix Javadoc

- Fix default FixedBackOff configuration in RetryTemplate

- Consistent logging in RetryTemplate

- Fix listener handling in CompositeRetryListener, allowing addListener()
  to work

- Polish tests

- Ensure RetryTemplateTests do not take over 30 seconds to execute

See gh-34716
2025-06-05 14:56:25 +02:00
Mahmoud Ben Hassine 3fb4a75ae4 Introduce minimal retry functionality as a core framework feature
This commit introduces a minimal core retry feature. It is inspired
by Spring Retry, but redesigned and trimmed to the bare minimum to
cover most cases.

Closes gh-34716
2025-06-05 14:56:25 +02:00
Violeta Georgieva aefdda3490 Upgrade to Netty v4.2.2.Final and Reactor Netty 2025.0.0-SNAPSHOT
Closes gh-34996
See gh-34997

Signed-off-by: Violeta Georgieva <696661+violetagg@users.noreply.github.com>
2025-06-05 14:14:06 +02:00
Sébastien Deleuze 93ba10fa1a Merge branch '6.2.x' 2025-06-05 14:08:36 +02:00
Sébastien Deleuze 4d09eb569b Refine RequestResponseBodyMethodProcessorKotlinTests
Improve read tests and fix copyright.

See gh-34992
2025-06-05 14:07:27 +02:00
Sébastien Deleuze b89c48e714 Merge branch '6.2.x' 2025-06-05 12:12:23 +02:00
Sébastien Deleuze a439e9030f Fix collection support in AbstractKotlinSerializationHttpMessageConverter
AbstractKotlinSerializationHttpMessageConverter#getSupportedMediaTypes(Class<?>)
currently invokes transitively supports(Class<?>) which always return false
with generic types.

This commit adds an override that just invokes getSupportedMediaTypes().

Closes gh-34992
2025-06-05 12:02:22 +02:00
Brian Clozel 2d5d988ad4 Polishing contribution
Closes gh-34645
2025-06-05 11:34:34 +02:00
Kamil Doroszkiewicz c1839938ea Add support for "application/*+x-protobuf" media type
See gh-34645

Signed-off-by: Kamil Doroszkiewicz <kamil.doroszkiewicz@gmail.com>
2025-06-05 11:34:34 +02:00
Brian Clozel 79a793e44c Merge branch '6.2.x' 2025-06-05 10:58:57 +02:00
James Yuzawa aa5c0dcd72 Add caching headers to unmodified static resources
per https://www.rfc-editor.org/rfc/rfc7232#section-4.1

The server generating a 304 response MUST generate any of the
following header fields that would have been sent in a 200 (OK)
response to the same request: Cache-Control, Content-Location, Date,
ETag, Expires, and Vary.

Closes gh-34614

Signed-off-by: James Yuzawa <jtyuzawa@gmail.com>
2025-06-05 10:58:24 +02:00
Brian Clozel 5fbb81de10 Fix missing "since" attributes for Deprecated code
See gh-34989
2025-06-05 09:25:10 +02:00
Brian Clozel 1e9179a87c Enable SpringDeprecatedCheck Checkstyle rule
This rules checks that `@Deprecated` annotations have a "since"
attribute.

Closes gh-34989
2025-06-05 09:25:03 +02:00
Brian Clozel fa6e32940c Merge branch '6.2.x' 2025-06-04 20:23:39 +02:00
Brian Clozel 4a46d957f3 Fix out of bounds exception for PathPattern#combine
Prior to this commit, combining the "/*" and  "/x/y" path patterns
would result in a `StringIndexOutOfBoundsException`.

This commit fixes this problem and revisits the implementation for
better consistency:

* "/*" + "/x/y" is now "/x/y"
* "/x/*.html" + "/y/file.*" is now rejected because they don't share the
  same prefix.

This change also adds the relevant Javadoc to the `PathPattern#combine`
method.

Fixes gh-34986
2025-06-04 20:18:33 +02:00
Sam Brannen 7e035f5c50 Polish ImportTests 2025-06-04 17:00:10 +02:00
Sam Brannen 4581324038 Polish support for @⁠Import on interfaces
- Update @⁠Import Javadoc

- Move tests from ImportSelectorTests to ImportTests

See gh-34820
2025-06-04 16:59:46 +02:00
Daeho Kwon a4d5800a6c Support @⁠Import on interfaces
See gh-34805
Closes gh-34820

Signed-off-by: Daeho Kwon <trewq231@naver.com>
2025-06-04 16:47:50 +02:00
Sam Brannen 686705140e Polish Javadoc for @⁠Import 2025-06-04 16:47:50 +02:00
Sam Brannen af4fc0118c Update copyright header 2025-06-04 14:53:31 +02:00
ChanHyeongLee 4f5e2eefe9 Remove thenReturn that fetches unused values
Closes gh-34883

Signed-off-by: ChanHyeongLee <cksgud410@gmail.com>
2025-06-04 13:46:22 +01:00
rstoyanchev 263af04508 Polishing contribution
Closes gh-34877
2025-06-04 13:46:22 +01:00
kssumin 8b9ae2b11c Update Jetty on WebFlux bootstrap in reference docs
Replace deprecated JettyHttpHandlerAdapter with JettyCoreHttpHandlerAdapter
Update example to work with Jetty 12+
Add note about the deprecation

See gh-34877

Signed-off-by: kssumin <201566@jnu.ac.kr>
2025-06-04 13:46:22 +01:00
rstoyanchev 230540b6da Polishing contribution
Closes gh-34942
2025-06-04 13:46:22 +01:00
Yanming Zhou f9fa7cc93b Add missing "since" in @Deprecated
See gh-34942

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-06-04 13:46:22 +01:00
Sam Brannen b7dfd68d89 Merge branch '6.2.x' 2025-06-04 14:11:07 +02:00
Sam Brannen 4df93a825b Update copyright headers and fix test method name 2025-06-04 11:28:55 +02:00
rstoyanchev b699b65b40 Merge branch '6.2.x' 2025-06-03 19:11:52 +01:00
rstoyanchev be17315f63 Add mention of CompletionStage in "Async Requests"
Closes gh-34991
2025-06-03 19:10:03 +01:00
DongNyoung Lee 31903a9d92 Fix typo in MockClientHttpRequest Javadoc
Closes gh-34856

Signed-off-by: DongNyoung Lee <121621378+Dongnyoung@users.noreply.github.com>
2025-06-03 19:05:32 +01:00
rstoyanchev 06f69915cb Polishing contribution
Closes gh-34885
2025-06-03 19:04:17 +01:00
addoDev d9459bdc74 Improve mvc-ann-async.adoc
Added section for WebAsyncTask return type along with java and
kotlin example code

See gh-34885

Signed-off-by: addoDev <adityaraochokkadi@gmail.com>
2025-06-03 18:57:40 +01:00
Tran Ngoc Nhan 3f0892b42c Fix typos
Closes gh-34876

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-06-03 18:55:15 +01:00
rstoyanchev 72b42bbd55 Polishing in RestClientAdapterTests 2025-06-03 18:51:57 +01:00
Patrick Strawderman 9501bff1f0 Use HexFormat in CharacterEditor
Use HexFormat to perform conversion for unicode-prefixed Strings in CharacterEditor.

Closes gh-34798

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-06-03 18:20:19 +02:00
Patrick Strawderman 542eb6f305 Use HexFormat in ContentDisposition
Closes gh-34797

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-06-03 18:19:47 +02:00
Brian Clozel 7c82a62bfb Merge branch '6.2.x' 2025-06-03 18:07:22 +02:00
Patrick Strawderman 182d654fa8 Add optimized DataBufferInputStream overrides
Add optimized DataBufferInputStream overrides for readNBytes, skip, and transferTo; all of them
allocate byte buffers which we can either avoid (in the case of skip) or size more precisely since
the number of remaining bytes is known.

Closes gh-34799

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-06-03 18:06:43 +02:00
Johnny Lim bbae625850 Add Javadoc since for gh-34745
Closes gh-34940

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-06-03 18:06:24 +02:00
Sam Brannen 941b791669 Polish null-safety documentation 2025-06-03 13:44:35 +02:00
Sam Brannen 9782dfb620 Fix nullability @⁠Contract for SupplierUtils.resolve(Supplier)
Closes gh-34987
2025-06-03 13:15:58 +02:00
Sam Brannen b0a06b8607 Merge branch '6.2.x' 2025-06-03 13:07:56 +02:00
Sam Brannen f376d1b525 Remove @⁠Contract declaration for CodeFlow.isIntegerForNumericOp()
Since the Number parameter is not @⁠Nullable, the @⁠Contract declaration
is unnecessary.

Closes gh-34985
2025-06-03 12:58:45 +02:00
Sébastien Deleuze c41147aa35 Introduce JacksonJsonMessageConverter#getObjectMapper
In order to give access to the underlying ObjectMapper to
classes extending JacksonJsonMessageConverter.

Closes gh-34963
2025-06-03 09:58:02 +02:00
Sébastien Deleuze ebf8d4fb1c Use Gradle nullability plugin 0.0.1
This commit replaces manual Gradle configuration of Error Prone
and NullAway by
https://github.com/spring-gradle-plugins/nullability-plugin.

Closes gh-34983
2025-06-03 09:42:29 +02:00
Sébastien Deleuze 0b14d676cc Refine null-safety documentation terms
Closes gh-34982
2025-06-02 23:42:33 +02:00
Sam Brannen 45ba4ace39 Merge branch '6.2.x' 2025-06-02 17:00:50 +02:00
Sam Brannen 707b7698ce Consistent @⁠Contract expression formatting 2025-06-02 17:00:28 +02:00
Sam Brannen 0d39bb828a Merge branch '6.2.x' 2025-06-02 16:30:57 +02:00
Johannes Jank 5b9cb8291e Fix exception name in ModelAttribute docs
Closes gh-34980

Signed-off-by: Johannes Jank <johannes.wengert@googlemail.com>
2025-06-02 16:30:16 +02:00
Brian Clozel d75f20f65f Merge branch '6.2.x' 2025-06-02 15:48:19 +02:00
Brian Clozel 659472f9e3 Use HTTP methods in JdkClientHttpRequest when possible
Prior to this commit, we would use the
`java.net.http.HttpRequest.Builder#method(String, BodyPublisher)` to
create HTTP requests for the JDK HttpClient. This method requires a
non-null body publisher; providing an empty publisher writes a
"Content-Length: 0" header to all requests.

As of Java 19, this behavior changes for `HttpRequest.Builder#GET` and
similar methods, where the body publisher is considered as null and no
"Content-Length" header is written.

This commit aligns with this behavior and favors dedicated HTTP methods
whenever available.`

Closes gh-34971
2025-06-02 15:36:20 +02:00
rstoyanchev a16cdd2c41 Fix typo in reference docs 2025-06-02 12:38:19 +01:00
rstoyanchev d1e279f060 Add reference docs for HTTP Service config
Closes gh-34912
2025-06-02 10:40:09 +01:00
rstoyanchev 81626b0734 Polishing reference docs for HTTP Service clients
See gh-34912
2025-06-02 10:40:09 +01:00
Sam Brannen 05d59271d2 Merge branch '6.2.x' 2025-06-02 10:48:28 +02:00
Dmytro Nosan c2d678879f Fix AOT code generation for autowired inner class constructor
Prior to this commit, argument index handling in
AutowiredArgumentsCodeGenerator suffered from an off-by-one error when
generating code for an autowired inner class constructor.

Since the startIndex is already properly calculated for an inner class in
InstanceSupplierCodeGenerator.buildGetInstanceMethodForConstructor(...),
there is no need to adjust the argument indexes within
AutowiredArgumentsCodeGenerator.generateCode(...).

Closes gh-34974

Signed-off-by: Dmytro Nosan <dimanosan@gmail.com>
2025-06-02 10:43:21 +02:00
Sam Brannen a6b06a889d Merge branch '6.2.x' 2025-06-02 10:12:36 +02:00
Sam Brannen f207c0ed5c Polish contribution
See gh-34949
2025-06-02 10:10:46 +02:00
Mengqi Xu bbf61c74ab Fix REPLY_CHANNEL header check in MessageHeaderAccessor
Prior to this commit, the verifyType() method in MessageHeaderAccessor
checked if REPLY_CHANNEL ended with the given header name which does
not make much sense and is inconsistent with the ERROR_CHANNEL check.

This commit therefore checks if the REPLY_CHANNEL is equal to the given
header name, analogous to the ERROR_CHANNEL check.

See gh-34881
Closes gh-34949

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-06-02 10:00:01 +02:00
Sam Brannen 5e9f90f9bf Merge branch '6.2.x' 2025-05-31 12:17:47 +02:00
Aurh1l aea66265f7 Fix syntax in @⁠SqlGroup example
Closes gh-34972
2025-05-31 12:15:50 +02:00
Sam Brannen c5566c947c Merge branch '6.2.x' 2025-05-30 14:55:22 +02:00
Sam Brannen 016294b067 Avoid overriding methods deprecated in JUnit Jupiter 5.13
See gh-34969
2025-05-30 14:54:57 +02:00
Sam Brannen 24facbc002 Document that JUnit 4 is officially in maintenance mode (as of today) 2025-05-30 14:37:58 +02:00
Sam Brannen 0f9870b603 Stop referring to JUnit 5 in documentation
Closes gh-34970
2025-05-30 14:37:05 +02:00
Sam Brannen 1f1c24cb2a Merge branch '6.2.x' 2025-05-30 14:00:27 +02:00
Sam Brannen 8201193650 Upgrade to JUnit 5.13
Closes gh-34969
2025-05-30 13:57:18 +02:00
Scott Frederick 8c967bf76d Fix typos in API versioning
Closes gh-34961

Signed-off-by: Scott Frederick <scottyfred@gmail.com>
2025-05-28 17:06:24 +02:00
Sam Brannen 21f235c093 Merge branch '6.2.x' 2025-05-28 16:41:58 +02:00
Dhruv 562157d2c0 Update X-Forwarded-Proto doc to say "https / http"
Closes gh-34959

Signed-off-by: Dhruv <dhruv2015@hotmail.co.uk>
2025-05-28 16:41:16 +02:00
rstoyanchev 22c672a469 Revise names of callbacks in HttpServiceGroupConfigurer
Closes gh-34926
2025-05-28 14:54:27 +01:00
Johnny Lim ec49435a4d Polish HttpRequestValues
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-05-28 14:54:07 +01:00
Sébastien Deleuze 3290592f58 Remove Kotlin field handling in DependencyDescriptor
The KotlinDelegate#isNullable invocation is unnecessary since this check
is already done by the Nullness#forField one introduced by
b5d153febf.

See gh-34952
See gh-34261
2025-05-28 14:39:44 +02:00
rstoyanchev 26ee30ed8f Merge branch '6.2.x' 2025-05-28 11:10:06 +01:00
Dmitry Sulman 63db3d06ab Fix method links in Javadoc of WebClient
Closes gh-34938

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-05-28 11:05:00 +01:00
rstoyanchev dc52042b85 Polishing contribution
Closes gh-34939
2025-05-28 11:05:00 +01:00
dujiabao cff6e02162 Correct sample in multipart-forms.adoc
See gh-34939

Signed-off-by: dujiabao <42103826+WayneDu98@users.noreply.github.com>
2025-05-28 11:05:00 +01:00
rstoyanchev 983af78352 Configurable limit on HandlerMappingIntrospector
Closes gh-34918
2025-05-28 11:05:00 +01:00
Sébastien Deleuze 20ddd9f864 Polish KotlinReflectionParameterNameDiscoverer 2025-05-28 11:16:09 +02:00
Sébastien Deleuze a638828157 Merge branch '6.2.x' 2025-05-28 10:31:34 +02:00
Sébastien Deleuze 67ed64a41d Remove not null checks in BeanUtilsKotlinTests 2025-05-28 10:31:07 +02:00
Sébastien Deleuze d777b70889 Ignore DefaultConstructorMarker in BeanUtils#getParameterNames
Closes gh-34760
2025-05-28 10:12:09 +02:00
Juergen Hoeller 106e5c7554 Upgrade to Hibernate ORM 7.0.0.Final and Hibernate Validator 9.0.0.Final
See gh-33750
2025-05-27 16:05:27 +02:00
Sam Brannen eb59d911cd Merge branch '6.2.x' 2025-05-27 11:32:25 +02:00
Sam Brannen 472c4012ca Remove obsolete note from Javadoc for BeanDefinitionReader 2025-05-27 11:32:05 +02:00
Sam Brannen e03117c9d2 Merge branch '6.2.x' 2025-05-27 11:28:48 +02:00
Sam Brannen 90be94a4a5 Use ConversionService from Environment in PropertySourcesPlaceholderConfigurer
This commit fixes a regression in PropertySourcesPlaceholderConfigurer
that was introduced in Spring Framework 6.2.7.

Specifically, this commit reinstates automatic String-conversion of
values from PropertySources in the Environment using the
ConversionService configured in the Environment.

See gh-34861
Closes gh-34936
2025-05-27 11:20:09 +02:00
Juergen Hoeller b5d153febf Enforce consistent null check on injection points for pre-existing singleton beans
Includes consistent JSpecify nullness check on fields as optional injection points

Closes gh-34952
See gh-34261
2025-05-27 10:25:50 +02:00
Juergen Hoeller cdfe0895f9 Merge branch '6.2.x' 2025-05-27 09:57:01 +02:00
Juergen Hoeller d9e261aecd Enforce backwards compatibility for null bean in shortcut code path
Closes gh-34929
2025-05-27 09:47:39 +02:00
Juergen Hoeller 15d1455acb Check for package-visible constructor in case of ClassLoader mismatch
Closes gh-34950
2025-05-27 09:47:29 +02:00
Sébastien Deleuze 59299b9e15 Fix a typo in null-safety.adoc 2025-05-27 09:36:21 +02:00
Sam Brannen 5d166f4932 Merge branch '6.2.x' 2025-05-26 18:19:29 +02:00
Sam Brannen 53844b068c Test conversion support in PropertySourcesPlaceholderConfigurer
This commit introduces a @⁠Disabled "regression test" which demonstrates
that PropertySourcesPlaceholderConfigurer uses the ConversionService
from the Environment.

See gh-34936
2025-05-26 18:18:52 +02:00
Sam Brannen 62f1814d7c Remove [set|with]Property(String, String) variants from MockEnvironment
Since setProperty(String, Object) and withProperty(String, Object)
methods were introduced in MockEnvironment in 6.2.8, this commit removes
the obsolete variants with (String, String) signatures.

See gh-34947
Closes gh-34948
2025-05-26 17:45:51 +02:00
Sam Brannen 6f6e0d45a9 Merge branch '6.2.x' 2025-05-26 17:37:08 +02:00
Sam Brannen d78264756e Support only Object property values in MockEnvironment test fixture
The setProperty() and withProperty() methods in MockEnvironment were
originally introduced with (String, String) signatures; however, they
should have always had (String, Object) signatures in order to comply
with the MockPropertySource and PropertySource APIs.

To address that, this commit changes the signatures of these methods so
that they only accept Object values for properties.

NOTE: this commit only affects the internal MockEnvironment used as a
test fixture. This commit does not affect the official, public
MockEnvironment implementation in spring-test.

See gh-34947
See gh-34948
2025-05-26 17:29:16 +02:00
Sam Brannen d0efc2230c Support Object property values in MockEnvironment
The setProperty() and withProperty() methods in MockEnvironment were
originally introduced with (String, String) signatures; however, they
should have always had (String, Object) signatures in order to comply
with the MockPropertySource and PropertySource APIs.

To address that, this commit introduces variants of these methods that
accept Object values for properties.

Closes gh-34947
2025-05-26 17:22:52 +02:00
Sam Brannen 6a6abac003 Polish Javadoc for MockPropertySource 2025-05-26 17:21:31 +02:00
Sébastien Deleuze 3049e6d0ee Upgrade to Kotlin 2.2.0-RC
Closes gh-34946
2025-05-26 16:56:38 +02:00
Sébastien Deleuze eb65df027e Upgrade to Jackson 3.0.0-rc5
Closes gh-34945
2025-05-26 16:56:38 +02:00
Sébastien Deleuze 13be54a1d2 Make ProblemDetailJacksonXmlMixin compatible with Jackson 3
Closes gh-34925
2025-05-26 16:56:28 +02:00
Sébastien Deleuze eed0a3ff59 Allow access to env from SupplierContextDsl
Closes gh-34943
2025-05-26 11:55:34 +02:00
Sébastien Deleuze a8ac54120d Fix the build with Java 24 2025-05-26 10:43:20 +02:00
Sébastien Deleuze 2da1f8031d Merge branch '6.2.x' 2025-05-26 10:25:56 +02:00
Sébastien Deleuze 66f8eb02bd Upgrade to HttpComponents HttpClient 5.5
Closes gh-34941
2025-05-26 10:25:00 +02:00
Sam Brannen 3be3e4d28c Merge branch '6.2.x' 2025-05-23 17:39:21 +02:00
Sam Brannen 274b97ca14 Upgrade to Gradle 8.14.1
Closes gh-34937
2025-05-23 17:32:53 +02:00
Sam Brannen 6653cd86ea Merge branch '6.2.x' 2025-05-22 17:44:03 +02:00
Sam Brannen e4b4512bcb Update code due to change in nullability contract
See gh-34933
2025-05-22 17:43:38 +02:00
Sam Brannen e5a3c43fbc Merge branch '6.2.x' 2025-05-22 17:26:11 +02:00
Sam Brannen db5809f968 Remove obsolete @⁠Contract declaration for StreamUtils.drain()
Closes gh-34933
2025-05-22 17:23:35 +02:00
Sam Brannen efea28953d Improve Javadoc for getFilename() & getFilenameExtension() in StringUtils
Closes gh-34932
2025-05-22 17:03:09 +02:00
Brian Clozel 612dc573d1 Upgrade to Jetty 12.1.0.beta0
Closes gh-34930
2025-05-21 18:16:58 +02:00
Stéphane Nicoll 9d3779db49 Declare @⁠Contract for quote() & getFilename() in StringUtils
This commit declares nullability @⁠Contract annotations for quote() and
getFilename() in StringUtils.

Closes gh-34896


Signed-off-by: Stéphane Nicoll <stephane.nicoll@broadcom.com>
2025-05-21 17:43:23 +02:00
Sam Brannen 88ce11abc8 Merge branch '6.2.x' 2025-05-21 15:40:34 +02:00
Sam Brannen d890a38f3c Support registration of non-public BeanDefinitionReader via @⁠ImportResource
Prior to this commit, a BeanDefinitionReader registered via
@⁠ImportResource was required to be public and have a public
constructor that accepts a single BeanDefinitionRegistry. However, the
public visibility requirements are not necessary, and the requirements
for the constructor's formal parameter list is not documented.

To address those issues, this commit removes the public visibility
restrictions and documents that a BeanDefinitionReader registered via
@⁠ImportResource must declare a constructor that accepts a single
BeanDefinitionRegistry.

In addition, this commit includes the cause of the instantiation
failure in case the registered BeanDefinitionReader cannot be
instantiated.

Closes gh-34928
2025-05-21 15:37:04 +02:00
Sam Brannen 98cef503fb Remove obsolete TODO
See gh-10976
2025-05-21 15:37:04 +02:00
Sam Brannen 362fe12704 Polishing 2025-05-21 15:36:58 +02:00
rstoyanchev 2e086bd727 Refine HttpServiceGroupConfigurer API
Closes gh-34926
2025-05-19 18:08:53 +01:00
Brian Clozel 1ea8a91b85 Merge branch '6.2.x' 2025-05-19 17:10:49 +02:00
Brian Clozel 2af0323c21 Use Content-Type charset in JAXB message converters
Prior to this commit, the JAXB message converters would only rely on the
encoding declaration inside the XML document for reading the document.
This would then use the default UTF-8 encoding, even if the HTTP message
has the `"application/xml;charset=iso-8859-1"` Content-Type.

This commit ensures that both `Jaxb2CollectionHttpMessageConverter` and
`Jaxb2RootElementHttpMessageConverter` use the encoding declared in the
HTTP Content-Type, if present.

Fixes gh-34745
2025-05-19 16:57:57 +02:00
Sébastien Deleuze e02e67b39f Polish BeanRegistrarDsl Javadoc 2025-05-19 13:09:14 +02:00
Sébastien Deleuze aa9ab8e545 Add support for callable references to BeanRegistrarDsl
BeanDefinitionDsl is allowing to create a bean from a callable
reference with its parameters autowired by type,
BeanRegistrarDsl should allow that too. For example:

class SampleBeanRegistrar : BeanRegistrarDsl({
    registerBean<MyRepository>()
    registerBean(::myRouter)
})

fun myRouter(myRepository: MyRepository) = router {
    ...
}

Closes gh-34922
2025-05-19 13:09:04 +02:00
Brian Clozel 81ea754ac2 Merge branch '6.2.x' 2025-05-19 12:11:32 +02:00
Brian Clozel fdab8fabd2 Avoid duplicate Content-Type in MockHttpServletRequest
Fixes gh-34913
2025-05-19 12:04:46 +02:00
rstoyanchev 094e653746 Versioning support in WebTestClient controller setup
See gh-34919
2025-05-19 09:36:51 +01:00
rstoyanchev 3095219479 Support API versioning in MockMvc
See gh-34919
2025-05-19 09:36:51 +01:00
rstoyanchev a024e5985a Add defaultApiVersion to WebTestClient
See gh-34919
2025-05-19 09:36:51 +01:00
rstoyanchev 5b19f6249e Refactoring in ApiVersionInserter
Refine naming of static factory methods, and update them to be
shortcuts for instance creation.

See gh-34919
2025-05-19 09:36:51 +01:00
Sam Brannen f4f0e52003 Stop declaring parameters as final in JdbcTemplate
The affected parameters are "effectively final" and are therefore no
longer required to be declared as "final" on modern JDKs.
2025-05-16 14:46:40 +02:00
Sam Brannen d0bf8faf48 Implement PreparedStatementCallback as lambda expression 2025-05-16 14:45:52 +02:00
Brian Clozel bd83fb7021 Merge branch '6.2.x' 2025-05-15 11:07:53 +02:00
Brian Clozel ae8b45a290 Next development version (v6.2.8-SNAPSHOT) 2025-05-15 11:07:25 +02:00
rstoyanchev e41fe16d37 Merge branch '6.2.x' 2025-05-15 08:26:08 +01:00
rstoyanchev ee62701f56 Make use of PatternMatchUtils ignoreCase option
Closes gh-34801
2025-05-15 08:18:56 +01:00
Juergen Hoeller 1187bc2016 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/AbstractAutowireCapableBeanFactory.java
2025-05-15 01:48:01 +02:00
Juergen Hoeller fa168ca78a Revise FactoryBean locking behavior for strict/lenient consistency
After the bootstrap phase (and with spring.locking.strict=true during the bootstrap phase), getSingletonFactoryBeanForTypeCheck always locks. In a background bootstrap thread, it never locks. Otherwise, it tries locking and explicitly resolves the bean class for subsequent type-based resolution (even for a component-scanned class) when it fails to acquire the lock. Furthermore, getObjectFromFactoryBean follows the same locking algorithm for post-processing.

Closes gh-34902
2025-05-15 01:45:09 +02:00
Sam Brannen 01fea5e7ed Polish Jackson 3 support
- Improve Javadoc.

- Suppress warnings for "removal".

- Update copyright headers.

- Migrate several tests from:
  - MappingJackson2MessageConverter to JacksonJsonMessageConverter
  - Jackson2JsonEncoder to JacksonJsonEncoder
  - Jackson2JsonDecoder to JacksonJsonDecoder
  - Jackson2SmileEncoder to JacksonSmileEncoder
  - Jackson2ObjectMapperBuilder to JsonMapper and XmlMapper
  - MappingJackson2JsonView to JacksonJsonView
  - MappingJackson2HttpMessageConverter to JacksonJsonHttpMessageConverter
  - MappingJackson2XmlHttpMessageConverter to JacksonXmlHttpMessageConverter
2025-05-14 16:55:27 +02:00
rstoyanchev ea340fbe69 Merge branch '6.2.x' 2025-05-14 15:16:12 +01:00
rstoyanchev 807cf5e254 Add Consumer methods to HttpRequestValues.Builder
Closes: gh-34870
2025-05-14 15:16:05 +01:00
rstoyanchev 3c228a5c1d Add missing @since tags in PatternMatchUtils
See: gh-34801
2025-05-14 15:15:50 +01:00
Dmitry Sulman 3b5acc270f Upgrade to Kotlin 2.1.21
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-05-14 16:34:45 +03:00
Juergen Hoeller 88c92ab067 Upgrade to Reactor 2025.0.0-M3
Closes gh-34897
2025-05-14 15:22:19 +02:00
Juergen Hoeller 4956cb7b82 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-05-14 15:07:05 +02:00
Juergen Hoeller 9bf6b8cddf Upgrade to Reactor 2024.0.6
Closes gh-34898
2025-05-14 15:03:28 +02:00
rstoyanchev e04de95ef2 Update API versioning ref docs for client side
Closes: gh-34569
2025-05-14 13:01:30 +01:00
rstoyanchev 5cb3ea228e Polishing in RestClient reference docs 2025-05-14 13:01:30 +01:00
rstoyanchev cce2771639 Add API versioning reference documentation
See gh-34569
2025-05-14 13:01:30 +01:00
Brian Clozel bf78980925 Merge branch '6.2.x' 2025-05-14 09:58:54 +02:00
Patrick Strawderman 37ecdd1437 Forward more methods to underlying InputStream in NonClosingInputStream
NonClosingInputStream extends FilterInputStream, which does not forward some
newer InputStream methods such as transferTo and readAllBytes. Specific InputStream
implementations may have more optimized methods (e.g., FileInputStream).

Closes gh-34893

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
2025-05-14 09:58:23 +02:00
Sébastien Deleuze 2a29e16456 Deprecate for removal Jackson 2 support
This commit deprecate for removal (likely in a future 7.x release) the
Jackson 2 support in favor of the Jackson 3 one.

Closes gh-33798
2025-05-13 18:02:33 +02:00
Sébastien Deleuze 6ae89ea397 Introduce Jackson 3 support to MessageBrokerBeanDefinitionParser
See gh-33798
2025-05-13 17:53:29 +02:00
Sébastien Deleuze 7acd4aec38 Introduce Jackson 3 support to AnnotationDrivenBeanDefinitionParser
See gh-33798
2025-05-13 17:53:29 +02:00
Sébastien Deleuze 0ad4fcaeaf Update spring-test tests to use Jackson 3
See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze ac3c1b8762 Introduce Jackson 3 support for spring-websocket
This commit introduces a JacksonJsonSockJsMessageCodec Jackson 3 variant
of Jackson2SockJsMessageCodec.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze a0ed3f052e Introduce Jackson 3 support for spring-jms
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant
of MappingJackson2MessageConverter.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze 3a0a755144 Introduce Jackson 3 support for spring-messaging
This commit introduces a JacksonJsonMessageConverter Jackson 3 variant
of MappingJackson2MessageConverter.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze d0cd7af7e6 Introduce hints support in advices
This commit introduces RequestBodyAdvice#determineReadHints and
ResponseBodyAdvice#determineWriteHints in order to be able to support
SmartHttpMessageConverter hints, as well as related `@JsonView`
support.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze 71987a8713 Introduce Jackson 3 support for views
This commit introduces Jackson 3 based variants of the following
Jackson 2 classes (and related dependent classes).

MappingJackson2JsonView -> JacksonJsonView
MappingJackson2XmlView-> JacksonXmlView

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze d4e4a9ae06 Introduce Jackson 3 support for converters
This commit introduces Jackson 3 SmartHttpMessageConverter based
variants of the following Jackson 2 classes (and related dependent classes).

org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter ->
org.springframework.http.converter.AbstractJacksonHttpMessageConverter

MappingJackson2HttpMessageConverter -> JacksonJsonHttpMessageConverter
MappingJackson2SmileHttpMessageConverter -> JacksonSmileHttpMessageConverter
MappingJackson2CborHttpMessageConverter -> JacksonCborHttpMessageConverter
MappingJackson2XmlHttpMessageConverter -> JacksonXmlHttpMessageConverter
MappingJackson2YamlHttpMessageConverter -> JacksonYamlHttpMessageConverter

They use hints instead of MappingJacksonValue and MappingJacksonInputMessage
to support `@JsonView` and FilterProvider.

Jackson 3 support is configured if found in the classpath otherwise
fallback to Jackson 2.

JacksonHandlerInstantiator needs to be enabled explicitly if needed.

See gh-33798
2025-05-13 17:53:28 +02:00
Sébastien Deleuze 7a8db31dc3 Introduce Jackson 3 support for HandlerInstantiator
This commit introduces a
org.springframework.http.support.JacksonHandlerInstantiator Jackson 3
variant of org.springframework.http.converter.json.SpringHandlerInstantiator
Jackson 2 class.

See gh-33798
2025-05-13 17:51:04 +02:00
Sébastien Deleuze 5cb2f870d0 Introduce Jackson 3 support for codecs
This commit introduces Jackson 3 variants of the following Jackson 2
classes (and related dependent classes).

org.springframework.http.codec.json.Jackson2CodecSupport ->
org.springframework.http.codec.JacksonCodecSupport

org.springframework.http.codec.json.Jackson2Tokenizer ->
org.springframework.http.codec.JacksonTokenizer

org.springframework.http.codec.json.Jackson2SmileDecoder ->
org.springframework.http.codec.smile.JacksonSmileDecoder

org.springframework.http.codec.json.Jackson2SmileEncoder ->
org.springframework.http.codec.smile.JacksonSmileEncoder

Jackson2CborDecoder -> JacksonCborDecoder
Jackson2CborEncoder -> JacksonCborEncoder
Jackson2JsonDecoder -> JacksonJsonDecoder
Jackson2JsonEncoder -> JacksonJsonEncoder

Jackson 3 support is configured if found in the classpath otherwise
fallback to Jackson 2.

See gh-33798
2025-05-13 17:51:04 +02:00
Sébastien Deleuze 746679f7a7 Introduce Jackson 3 support in the Gradle build
This commit adds Jackson 3 BOM to Spring Framework platform dependencies
and related Javadoc link.

See gh-33798
2025-05-13 17:51:04 +02:00
Juergen Hoeller 46e6783593 Polishing 2025-05-13 16:42:57 +02:00
Juergen Hoeller 0f2fbd1983 Upgrade to Micrometer 1.15.0
Includes Tomcat 11.0.7

Closes gh-34888
2025-05-13 16:32:22 +02:00
Juergen Hoeller 254a55d217 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-05-13 16:31:05 +02:00
Brian Clozel 0df75ff75e Fix StringIndexOutOfBoundsException with Class-File metadata
Closes gh-34882
2025-05-13 16:15:00 +02:00
Juergen Hoeller 73f1c5a189 Polishing 2025-05-13 16:08:57 +02:00
Juergen Hoeller 4d296fb4ca Upgrade to Micrometer 1.14.7
Includes Jackson 2.18.4, Jetty 12.0.21, Netty 4.1.121, Apache HttpClient 5.4.4, Checkstyle 10.23.1

Closes gh-34889
2025-05-13 16:08:31 +02:00
Juergen Hoeller 6a9444473f Clarify CompositePropertySource behavior for EnumerablePropertySource contract
Closes gh-34886
2025-05-13 16:08:03 +02:00
Martin Mois 261862076c Use system properties in ReactorClientHttpRequestFactory
Closes gh-34850

Signed-off-by: Martin Mois <martin.mois@gmail.com>
2025-05-13 15:18:03 +02:00
Sam Brannen 680094d74e Merge branch '6.2.x' 2025-05-13 13:45:37 +02:00
Sam Brannen 03ae97b2eb Introduce Spring property for default escape character for placeholders
Spring Framework 6.2 introduced support for an escape character for
property placeholders (by default '\'). However, as of Spring Framework
6.2.6, there was no way to either escape the escape character or disable
escape character support.

For example, given a `username` property configured with the value of
`Jane.Smith` and a `DOMAIN\${username}` configuration string, property
placeholder replacement used to result in `DOMAIN\Jane.Smith` prior to
6.2 but now results in `DOMAIN${username}`. Similarly, an attempt to
escape the escape character via `DOMAIN\\${username}` results in
`DOMAIN\${username}`.

In theory, one should be able to disable use of an escape character
altogether, and that is currently possible by invoking
setEscapeCharacter(null) on AbstractPropertyResolver and
PlaceholderConfigurerSupport (the superclass of
PropertySourcesPlaceholderConfigurer).

However, in reality, there are two hurdles.

- As of 6.2.6, an invocation of setEscapeCharacter(null) on a
  PropertySourcesPlaceholderConfigurer applied to its internal
  top-level PropertySourcesPropertyResolver but not to any nested
  PropertySourcesPropertyResolver, which means that the `null` escape
  character could not be effectively applied.

- Users may not have an easy way to explicitly set the escape character
  to `null` for a PropertyResolver or
  PropertySourcesPlaceholderConfigurer. For example, Spring Boot
  auto-configures a PropertySourcesPlaceholderConfigurer with the
  default escape character enabled.

This first issue above has recently been addressed by gh-34861.

This commit therefore addresses the second issue as follows.

- To allow developers to easily revert to the pre-6.2 behavior without
  changes to code or configuration strings, this commit introduces a
  `spring.placeholder.escapeCharacter.default` property for use with
  SpringProperties which globally sets the default escape character that
  is automatically configured in AbstractPropertyResolver and
  PlaceholderConfigurerSupport.

- Setting the property to an empty string sets the default escape
  character to `null`, effectively disabling the default support for
  escape characters.

    spring.placeholder.escapeCharacter.default =

- Setting the property to any other character sets the default escape
  character to that specific character.

    spring.placeholder.escapeCharacter.default = ~

- Setting the property to a string containing more than one character
  results in an exception.

- Developers are still able to configure an explicit escape character
  in AbstractPropertyResolver and PlaceholderConfigurerSupport if they
  choose to do so.

- Third-party components that wish to rely on the same feature can
  invoke AbstractPropertyResolver.getDefaultEscapeCharacter() to obtain
  the globally configured default escape character.

See gh-9628
See gh-34315
See gh-34861
Closes gh-34865
2025-05-13 13:37:30 +02:00
Brian Clozel 233eb7f0aa Fix StringIndexOutOfBoundsException with Class-File metadata
Prior to this commit, the new `ClassFileAnnotationMetadata` would fail
when reading `Class<T>` annotation attributes when values are primitive
types.

This commit uses `java.lang.constant.ClassDesc` to better parse type
descriptors from the bytecode.

Fixes gh-24882
2025-05-12 18:14:33 +02:00
Sam Brannen 18756c0701 Merge branch '6.2.x' 2025-05-12 17:27:38 +02:00
Sam Brannen e34cdc2a55 Improve Javadoc for property placeholder support 2025-05-12 17:25:49 +02:00
Sam Brannen 8b1b9ef9e5 Stop redefining placeholder syntax constants in PlaceholderConfigurerSupport 2025-05-12 17:21:37 +02:00
Sam Brannen 33aeb6ee9c Deprecate [Property|Preferences]PlaceholderConfigurer for removal
PropertyPlaceholderConfigurer and PreferencesPlaceholderConfigurer have
been officially deprecated since Spring Framework 5.2.

Since we no longer expect applications to depend on these outdated
mechanisms, this commit deprecates these classes "for removal" in
Spring Framework 8.0.

Closes gh-34880
2025-05-11 17:03:42 +02:00
Sam Brannen c7787b8383 Merge branch '6.2.x' 2025-05-11 16:41:55 +02:00
Sam Brannen efdaae02e0 Add test for late binding from Environment property sources
This new test serves as a "regression test" for behavior tested in
Spring Boot.

See gh-34861
2025-05-11 16:41:19 +02:00
Sam Brannen dde69c96b0 Merge branch '6.2.x' 2025-05-11 15:55:07 +02:00
Sam Brannen 49ffb833a3 Sort methods to align with PropertySource declaration order
See gh-34861
2025-05-11 15:48:00 +02:00
Sam Brannen 065e50a444 Override containsProperty() in FallbackEnvironmentPropertySource
This commit overrides containsProperty() in
FallbackEnvironmentPropertySource for consistency with the
implementation of ConfigurableEnvironmentPropertySource.

See gh-34861
2025-05-11 15:44:51 +02:00
Sam Brannen 74f4a07eac Merge branch '6.2.x' 2025-05-11 15:37:07 +02:00
Sam Brannen 7135527765 Always obtain fresh PropertySources in ConfigurableEnvironmentPropertySource
Although it's unlikely that the implementation of getPropertySources()
in a ConfigurableEnvironment would be overridden to return a different
MutablePropertySources instance than the one that the
ConfigurableEnvironment typically acts on, it is in fact possible.

In light of that possibility, this commit refactors
ConfigurableEnvironmentPropertySource so that it always obtains a fresh
PropertySources reference.

See gh-34861
2025-05-11 15:30:09 +02:00
Sam Brannen c28b22b465 Merge branch '6.2.x' 2025-05-11 14:11:53 +02:00
Sam Brannen 65e30132f3 Revert "Introduce CompositePropertySource constructor that accepts Iterable<PropertySource>"
This reverts commit 0867dfca33.
2025-05-11 14:10:54 +02:00
Sam Brannen 958dab7c84 Merge branch '6.2.x' 2025-05-11 13:53:40 +02:00
Sam Brannen ebb44a8368 Restore support for non-EnumerablePropertySource in PropertySourcesPlaceholderConfigurer
Commit 3295289e17 fixed a number issues with placeholder resolution in
PropertySourcesPlaceholderConfigurer. However, in doing so, it replaced
a raw PropertySource with a CompositePropertySource which implements
EnumerablePropertySource.

Consequently, all property sources registered in the Environment must
now implement EnumerablePropertySource (which is not an actual
requirement). Otherwise, invocations of getPropertyNames() on the
CompositePropertySource result in an IllegalStateException, and that is
a breaking change which resulted in numerous build failures within the
Spring portfolio.

To address that regression, this commit introduces a private
ConfigurableEnvironmentPropertySource in
PropertySourcesPlaceholderConfigurer which is a "raw" PropertySource
that delegates directly to the PropertySources in a
ConfigurableEnvironment.

This commit also extracts the raw PropertySource for direct Environment
delegation into a new FallbackEnvironmentPropertySource.

See gh-17385
Closes gh-34861
2025-05-11 13:46:11 +02:00
Sam Brannen 3096bb6d0c Polishing 2025-05-11 13:24:40 +02:00
Sam Brannen 6878587a33 Merge branch '6.2.x' 2025-05-10 15:44:23 +02:00
Sam Brannen 2b2a57b4a3 Polish Javadoc 2025-05-10 15:44:08 +02:00
Sam Brannen 32e2c453b0 Merge branch '6.2.x' 2025-05-10 15:21:39 +02:00
Sam Brannen 3295289e17 Fix placeholder resolution in PropertySourcesPlaceholderConfigurer
Currently, the placeholder resolution algorithm in
PropertySourcesPlaceholderConfigurer fails in several scenarios, and
the root cause for this category of failures has actually existed since
PropertySourcesPlaceholderConfigurer was introduced in Spring Framework
3.1.

Specifically, PropertySourcesPlaceholderConfigurer creates its own
PropertySourcesPropertyResolver that indirectly delegates to another
"nested" PropertySourcesPropertyResolver to interact with
PropertySources from the Environment, which results in double
placeholder parsing and resolution attempts, and that behavior leads to
a whole category of bugs.

For example, #27947 was addressed in Spring Framework 5.3.16, and due
to #34315 and #34326 we have recently realized that additional bugs
exist with placeholder resolution: nested placeholder resolution can
fail when escape characters are used, and it is currently impossible
to disable the escape character support for nested resolution.

To address this category of bugs, we no longer indirectly use or
directly create a "nested" PropertySourcesPropertyResolver in
PropertySourcesPlaceholderConfigurer. Instead, properties from property
sources from the Environment are now accessed directly without
duplicate/nested placeholder resolution.

See gh-27947
See gh-34326
See gh-34862
Closes gh-34861
2025-05-10 15:14:50 +02:00
Sam Brannen 2018d933ac Merge branch '6.2.x' 2025-05-10 15:11:44 +02:00
Sam Brannen 457e876303 Polish reference manual regarding placeholders 2025-05-10 15:10:29 +02:00
Sam Brannen 3fb9c2b507 Merge branch '6.2.x' 2025-05-10 14:21:41 +02:00
Sam Brannen 021bf6e77d Add more tests for escape character support in PlaceholderParser 2025-05-10 14:19:41 +02:00
Sam Brannen 90453643cc Simplify and revise PlaceholderParserTests for consistency 2025-05-10 14:16:49 +02:00
Sam Brannen 5fbfdbc91c Merge branch '6.2.x' 2025-05-09 16:44:21 +02:00
Sam Brannen 5a2cbc1ab3 Polish PropertySourcesPropertyResolverTests 2025-05-09 16:43:04 +02:00
Sam Brannen 348b4cd067 Polish contribution
See gh-34720
2025-05-09 16:32:13 +02:00
Fawzi Essam 9b52cfd7d5 Test escape character support in PropertySourcesPropertyResolver
See gh-34326
See gh-34720
See gh-34861

Signed-off-by: Fawzi Essam <iifawzie@gmail.com>
2025-05-09 16:31:27 +02:00
Sam Brannen 4f38c5bdfa Merge branch '6.2.x' 2025-05-09 14:32:13 +02:00
Sam Brannen dd6eede243 Properly expand reused collection parameters in R2DBC NamedParameterUtils
Prior to this commit, NamedParameterUtils in spring-r2dbc did not
properly expand reused collection parameters. Specifically, values in a
supplied collection were only expanded in the resulting query once, for
the first occurrence of the named parameter.

To address that, this commit effectively reinstates the original logic
for ExpandedQuery from NamedParameterUtils in the Spring Data R2DBC
project.

https://github.com/spring-projects/spring-data-relational/blob/94958f5eb66cbe2e8e025155cd99abf36f6f91f4/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/core/NamedParameterUtils.java#L486

Closes gh-34768
2025-05-09 14:27:19 +02:00
Sam Brannen de97e35189 Polish Javadoc and internals of R2DBC support 2025-05-09 14:04:10 +02:00
Phillip Webb 13b09e6f3c Ensure only immediate member classes are only included
Update `ClassFileClassMetadata` so that member classes only include
immediate children. This aligns with the other `ClassMetadata`
implementations.

Closes gh-34869
2025-05-09 09:43:58 +02:00
Phillip Webb ead80ce2f5 Return null for getSuperClassName() with package-info classes
Update `ClassFileClassMetadata` to align the behavior of
`getSuperClassName()` with other readers in that it returns
`null` for `package-info` classes.

See gh-34869
2025-05-09 09:43:48 +02:00
Sam Brannen dbaba3d88a Merge branch '6.2.x' 2025-05-08 10:50:14 +02:00
Sam Brannen 45a2c51fe1 Polish Javadoc for Environment-related components 2025-05-08 10:49:44 +02:00
rstoyanchev 97d5f7f07d Fix filtering in HttpServiceProxyRegistryFactoryBean
Closes gh-34867
2025-05-07 22:53:33 +01:00
Sam Brannen 733e695e18 Merge branch '6.2.x' 2025-05-07 17:37:41 +02:00
Sam Brannen b98c3257af Introduce @⁠Disabled failing test for R2DBC NamedParameterUtils
The last assertion of the new test method currently fails since "foo"
is only bound once.

java.lang.AssertionError:
Expected size: 2 but was: 1 in:
{0="foo"}

See gh-34768
2025-05-07 17:30:07 +02:00
Sam Brannen ea8ae09cb7 Revise NamedParameterUtilsTests for consistency 2025-05-07 17:24:41 +02:00
Sam Brannen e673345102 Merge branch '6.2.x' 2025-05-07 16:15:15 +02:00
Sam Brannen 0abfad870c Polish class-level Javadoc for SpringProperties 2025-05-07 16:14:23 +02:00
Sam Brannen 5a9af9e024 Document AotDetector.AOT_ENABLED flag in SpringProperties
Prior to this commit, the AotDetector.AOT_ENABLED flag was documented
in the reference manual not in the Javadoc for SpringProperties.
2025-05-07 16:14:07 +02:00
Sam Brannen 6c4651925e Merge branch '6.2.x' 2025-05-07 14:29:35 +02:00
Sam Brannen 0867dfca33 Introduce CompositePropertySource constructor that accepts Iterable<PropertySource>
This commit introduces a new constructor for CompositePropertySource
that accepts a `String name` and an Iterable<PropertySource<?>>, which
allows a CompositePropertySource to be constructed from existing
property sources, such as an instance of MutablePropertySources.

Closes gh-34862
2025-05-07 14:25:13 +02:00
Sam Brannen b4355dc955 Polishing 2025-05-07 12:42:40 +02:00
rstoyanchev d8b506e09a Fix failing test 2025-05-06 21:43:12 +01:00
rstoyanchev e5d4d7c13c Refactor DefaultApiVersionInserter 2025-05-06 20:36:56 +01:00
rstoyanchev 22e7f24731 Add defaultApiVersion to RestClient and WebClient
Closes gh-34857
2025-05-06 19:07:58 +01:00
Sam Brannen fef969145d Merge branch '6.2.x' 2025-05-06 18:51:10 +02:00
Sam Brannen bc91e0ea96 Revise PropertyResolver Javadoc to highlight resolution semantics 2025-05-06 18:50:33 +02:00
Sam Brannen 964d67474c Merge branch '6.2.x' 2025-05-06 16:08:20 +02:00
Sam Brannen 8599ee6c2b Polish Javadoc 2025-05-06 16:07:46 +02:00
Sam Brannen bc466022b1 Fix typo in parameter name 2025-05-06 16:07:46 +02:00
Brian Clozel 4a99fa8846 Merge branch '6.2.x' 2025-05-05 14:51:34 +02:00
Brian Clozel 6f11711e27 Fix HttpClient 5.3.x request config compatibility
As of gh-33806, the HttpComponents client request factory is forward
compatible with the 5.4+ versions of that library for configuring HTTP
request configuration.

This change would not tkae into account configuration set at the Spring
level because it would consider the default `RequestConfig` instance as
a custom one. This commit ensures that Spring sets its own configuration
if no custom configuration was set for all supported HttpComponents
generations.

Fixes gh-34851
2025-05-05 14:38:30 +02:00
rstoyanchev ecdb63371e Merge branch '6.2.x' 2025-05-02 15:59:10 +01:00
rstoyanchev c067919173 Ensure Fragment can merge attributes
Use a new map when merging as the original may be immutable.

Closes gh-34848
2025-05-02 15:58:51 +01:00
rstoyanchev ac773d97e9 Polishing contribution
Closes gh-34828
2025-05-02 15:58:51 +01:00
Artur bd7007227c Provide a working example instead of unclear placeholders
See gh-34828

Signed-off-by: Artur <artur@vaadin.com>
2025-05-02 15:58:51 +01:00
Sam Brannen f8e7bf7825 Merge branch '6.2.x' 2025-05-02 11:39:09 +02:00
Sam Brannen e8f873a349 Ensure Bean Overrides are discovered once in hierarchies
Prior to this commit, bean overrides (such as @⁠MockitoBean, etc.) were
discovered multiple times if they were declared:

- at the type-level on an interface that is implemented at more than
  one level in the type hierarchy, the enclosing class hierarchy, or a
  combination of the type and enclosing class hierarchies.

or

- on a field declared in a class which can be reached multiple times
  while traversing the type and enclosing class hierarchies in
  scenarios such as the following: the class (X) in which the field is
  declared is a supertype of an enclosing type of the test class, and X
  is also an enclosing type of a supertype of the test class.

Such scenarios resulted in an IllegalStateException stating that a
duplicate BeanOverrideHandler was discovered.

To address that, this commit revises the search algorithm in
BeanOverrideHandler so that all types (superclasses, enclosing classes,
and implemented interfaces) are only visited once while traversing the
type and enclosing class hierarchies in search of bean override
handlers.

See gh-33925
See gh-34324
Closes gh-34844
2025-05-02 11:26:33 +02:00
rstoyanchev 67f3ff574f Polishing in HTTP service registry 2025-05-01 11:00:32 +01:00
Phillip Webb 42e854e5ff Polish AbstractHttpServiceRegistrar.DefaultGroupSpec
Remove `DefaultGroupRegistry` since it's not really needed and polish
`DefaultGroupSpec` a little.
2025-05-01 11:00:32 +01:00
Phillip Webb d2246162c3 Polish GroupsMetadata.Registration
Unify `Registration` and `DefualtRegistration` into a single
class since they are both package-private and the interface
isn't really needed.
2025-05-01 11:00:32 +01:00
Phillip Webb abbee1a050 Use bean class loader when creating interface clients
Update interface client code to replace `GroupsMetadata.loadClass` calls
with `ClassUtils.resolveClassName` passing in the bean class loader.

Since the bean class loader in injected after construction, some minor
refactoring has been applied to `HttpServiceProxyRegistryFactoryBean`.
The class now stores `GroupsMetadata` and only loads the types in
in `afterPropertiesSet`.

The `HttpServiceProxyFactory` class has also been updated to ensure
that the proxy is created using the class loader of the service
type, rather than the thread context class loader.

Fixes gh-34846
2025-05-01 11:00:32 +01:00
Sam Brannen 13f9fed4bc Merge branch '6.2.x' 2025-05-01 10:52:26 +02:00
Sam Brannen b943817f3e Close ApplicationContext after test AOT processing
See commit 1c108054ee
Closes gh-34841
2025-05-01 10:50:38 +02:00
Juergen Hoeller d0a1ba5092 Merge branch '6.2.x' 2025-04-30 17:56:36 +02:00
Juergen Hoeller 4466548f53 Align parameter javadoc with nullable signature
Closes gh-34845
2025-04-30 17:55:39 +02:00
Juergen Hoeller 9c183f9e77 Add explicit note on redeclaring in each application context
Closes gh-34843
2025-04-30 17:55:18 +02:00
Juergen Hoeller b98ef1309b Upgrade to Hibernate ORM 7.0.0.CR1
See gh-33750
2025-04-29 18:30:57 +02:00
Juergen Hoeller 4d15c136b1 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/test/java/org/springframework/context/aot/ContextAotProcessorTests.java
2025-04-29 11:51:24 +02:00
Juergen Hoeller 03620fc530 Polishing 2025-04-29 11:47:47 +02:00
Juergen Hoeller 1c108054ee Close ApplicationContext after AOT processing
Closes gh-34841
2025-04-29 11:47:09 +02:00
Juergen Hoeller bb513de224 Merge branch '6.2.x' 2025-04-28 16:14:34 +02:00
Juergen Hoeller d0b186a1c7 Polishing 2025-04-28 16:13:04 +02:00
Juergen Hoeller 4172581f1b Try loadClass on LinkageError in case of same ClassLoader as well
Closes gh-34824
2025-04-28 16:12:45 +02:00
rstoyanchev 86b5679516 Add remaining change from merge 2025-04-28 14:40:52 +01:00
rstoyanchev 8375962813 Merge branch '6.2.x' 2025-04-28 14:29:58 +01:00
rstoyanchev c88ba6c90e Polishing contribution
Closes gh-34812
2025-04-28 14:23:30 +01:00
Yanming Zhou d7c13d6518 HttpEntity.EMPTY should be immutable
See gh-34812

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-04-28 14:22:59 +01:00
rstoyanchev 6d6f657858 Add option to not use detected versions
Closes gh-34775
2025-04-28 13:35:01 +01:00
Sam Brannen 0c6a26a381 Merge branch '6.2.x' 2025-04-27 17:59:50 +02:00
Sam Brannen 5013d6d771 Fail Gradle build whenever a javadoc task fails
To ensure that failures in javadoc tasks do not result in documentation
silently not being generated/published, this commit sets
`failOnError = true` for all javadoc tasks.

See gh-27497
See gh-34774
Closes gh-34837
2025-04-27 17:59:41 +02:00
Sam Brannen d0af5146e0 Add note regarding aggregated Javadoc toolchain configuration
In commit 49ef150c5d, I stated that the common javadoc task used by all
spring-* modules would be addressed in a separate commit. However,
after further investigation I determined that the spring-test Javadoc
JAR was published successfully, including links to JUnit 5 Javadoc
(which was not previously the case).

https://repo1.maven.org/maven2/org/springframework/spring-test/7.0.0-M4/spring-test-7.0.0-M4-javadoc.jar

This commit therefore only adds a note in JavaConventions to remind us
that the aggregated Javadoc toolchain configuration needs to stay in
sync with the configuration in JavaConventions.

See gh-27497
Closes gh-34774
2025-04-27 17:41:42 +02:00
Sam Brannen 5d3170448a Import junit-bom in buildSrc 2025-04-27 17:22:03 +02:00
Sam Brannen d8c7c250e3 Upgrade to JUnit Jupiter 5.12.2 in buildSrc 2025-04-27 17:03:01 +02:00
Sam Brannen 5bdec756b9 Merge branch '6.2.x' 2025-04-27 16:55:39 +02:00
Sam Brannen 9cd7b6a91e Upgrade spring-javaformat-gradle-plugin to version 0.0.43 2025-04-27 16:51:47 +02:00
Sam Brannen 1234d29d78 Merge branch '6.2.x' 2025-04-27 16:30:08 +02:00
Sam Brannen e9dcd64068 Upgrade to Gradle 8.14
Closes gh-34836
2025-04-27 16:29:46 +02:00
Sam Brannen ce7f47c962 Upgrade io.freefair.aggregate-javadoc plugin to version 8.13.1 2025-04-27 16:23:22 +02:00
Sam Brannen c74fc7ec90 Deprecate JUnit 4 support in the TestContext framework
Closes gh-34794
2025-04-26 10:06:18 +02:00
Sam Brannen 2db1a63a92 Merge branch '6.2.x' 2025-04-26 09:41:09 +02:00
Sam Brannen ef34464c94 Restructure TestContext framework support sections
This commit moves the JUnit Jupiter section above the JUnit 4 section
and groups all JUnit 4 sections under a new "JUnit 4 Support" heading.
2025-04-26 09:38:10 +02:00
Sam Brannen ef11a00c0b Polishing 2025-04-26 09:37:34 +02:00
Sam Brannen 4bf8e2f366 Merge branch '6.2.x' 2025-04-26 07:55:00 +02:00
Sam Brannen 176b0b09bf Migrate remaining JUnit 4 tests to JUnit Jupiter where feasible
In 49e5c84928 I unfortunately overlooked
several JUnit 4 based tests in the `junit4` package that should be
migrated to JUnit Jupiter.

This commit address those remaining test classes.

See gh-23451
See gh-34794
Closes gh-34813
2025-04-26 07:51:24 +02:00
rstoyanchev d8503daa1f Revise how bodyType is set for 7.0 codebase
See gh-34793
2025-04-25 21:41:11 +01:00
rstoyanchev fed6e9b3c3 Merge branch '6.2.x' 2025-04-25 21:33:03 +01:00
rstoyanchev c48ff357dc HTTP Service proxy sets body type
Closes gh-34793
2025-04-25 21:03:00 +01:00
rstoyanchev 190dabb8e1 Polishing contribution
Closes gh-34789
2025-04-25 21:03:00 +01:00
blake_bauman d15abd58b4 Add option to set Principal in MockServerWebExchange
See gh-34789

Signed-off-by: blake_bauman <blake_bauman@apple.com>
2025-04-25 21:03:00 +01:00
Sam Brannen 98cdae6444 Merge branch '6.2.x' 2025-04-25 13:45:10 +02:00
Sam Brannen 44500cf868 Revise TestConventions to retain existing JUnit Platform options
This commit revises the implementation of TestConventions so that
existing JUnit Platform options from a pre-configured `test` task are
copied instead of overridden.

Closes gh-34827
2025-04-25 13:38:18 +02:00
Sam Brannen cdee5c5b79 Merge branch '6.2.x' 2025-04-25 12:13:37 +02:00
Sam Brannen e384389790 Reinstate the @⁠Inject Technology Compatibility Kit (TCK)
In commit 05ebca8677, the `public` modifier was removed from the
SpringAtInjectTckTests class, which prevents it from being run as a
JUnit 3 test class.

To address that, this commit adds the missing `public` modifier as well
as a a code comment to help prevent this from happening again.

In addition, this commit updates spring-context.gradle to ensure that
the JUnit Vintage test engine is always applied. However, that Gradle
configuration is unfortunately ignored due to how our TestConventions
class has been implemented. Thus, that issue will have to be addressed
separately.

Closes gh-34800
2025-04-25 12:08:39 +02:00
Sam Brannen 52265a5c65 Merge branch '6.2.x' 2025-04-24 16:30:45 +02:00
Sam Brannen 49e5c84928 Migrate remaining JUnit 4 tests to JUnit Jupiter where feasible
In Spring Framework 5.2, we migrated most of the test suite from JUnit
4 to JUnit Jupiter; however, prior to this commit, several tests in the
spring-test module were still based on JUnit 4 unnecessarily.

Since we are now planning to deprecate our JUnit 4 support in 7.0, this
commit migrates our remaining JUnit 4 based tests to JUnit Jupiter
whenever feasible. In the process, test classes that previously resided
under the "junit4" package have been moved to new packages directly
under the "org.springframework.text.context" package, and several
classes have been renamed for greater clarity of purpose.

Consequently, the only remaining tests based on JUnit 4 are those tests
that are required to run with JUnit 4 in order to test our JUnit 4
support.

This commit also greatly simplifies exclusions for Checkstyle rules
pertaining to JUnit usage.

See gh-23451
See gh-34794
Closes gh-34813
2025-04-24 16:20:39 +02:00
Sébastien Deleuze ead76b6317 Merge branch '6.2.x' 2025-04-24 10:39:39 +02:00
Sébastien Deleuze 56eb135608 Fix AbstractJackson2HttpMessageConverter nullness
This commit makes AbstractJackson2HttpMessageConverter#getObjectMappersForType
return value non nullable as an empty map is returned in case of no
registrations.

Closes gh-34811
2025-04-24 10:37:30 +02:00
rstoyanchev 838b4d67a5 Fix Nullable declaration in PatternMatchUtils 2025-04-23 12:20:32 +01:00
rstoyanchev 2a3e7ea3f9 Merge branch '6.2.x' 2025-04-23 12:11:28 +01:00
rstoyanchev 5c5cf73e11 Add ignoreCase variants to PatternMatchUtils
See gh-34801
2025-04-23 12:10:55 +01:00
rstoyanchev 858c2bd270 Polishing contribution
Closes gh-34783
2025-04-23 10:54:52 +01:00
whl 124582d910 Fix expansion of query param with same name
See gh-34783

Signed-off-by: whl <whlit.cola@gmail.com>
2025-04-23 10:54:52 +01:00
Juergen Hoeller 014a395aed Merge branch '6.2.x' 2025-04-23 10:21:52 +02:00
Juergen Hoeller 253f321e8b Early getJarFile() call for consistent jar file existence check
See gh-34796
2025-04-23 10:16:12 +02:00
Juergen Hoeller ffb32f4238 Merge branch '6.2.x' 2025-04-22 23:20:09 +02:00
Juergen Hoeller 0252e39409 Check for the existence of any actual jar entries in case of jar root
Closes gh-34796
2025-04-22 23:18:56 +02:00
Sam Brannen 61a517ea3b Merge branch '6.2.x' 2025-04-22 12:46:52 +02:00
Sam Brannen 2f60083cd5 Add integration tests for reused named parameters from bean properties
See gh-34768
2025-04-22 12:45:35 +02:00
Juergen Hoeller f2dd7b01cd Consistent final @Nullable declarations 2025-04-22 12:25:01 +02:00
Juergen Hoeller 78f901649e Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-04-22 12:18:44 +02:00
Juergen Hoeller b83e07ff8c Ignore NoSuchFileException from getJarFile() as well
Closes gh-34764
2025-04-22 12:17:18 +02:00
Juergen Hoeller 1841ad3472 Consistently use local copy of volatile mainThreadPrefix field
Closes gh-34746
2025-04-22 12:17:03 +02:00
Seonghun Jeong d3a5aefdff Improve handling of mainThreadPrefix and remove redundant null check (#34746) 2025-04-22 12:16:34 +02:00
Sam Brannen 0477ba4de4 Remove obsolete RmiInvocationWrapperRTD.xml file
Closes gh-34779

(cherry picked from commit e7402bc365)
2025-04-22 12:10:18 +02:00
Sam Brannen fc516cb39e Merge branch '6.2.x' 2025-04-22 11:55:39 +02:00
Sam Brannen 8c376e9cc5 Remove redundant parameter count check in AnnotationsScanner.hasSameParameterTypes()
The redundancy was reported by @TAKETODAY.

See gh-34717
2025-04-22 11:53:40 +02:00
Sam Brannen e7402bc365 Remove obsolete RmiInvocationWrapperRTD.xml file
Closes gh-34779
2025-04-18 16:59:37 +02:00
Sam Brannen 49ef150c5d Configure JDK 24 toolchain for aggregated Javadoc
Changes made in conjunction with #27497 now require that we generate
Javadoc with JDK 18 or higher in order to make use of the
"--link-modularity-mismatch" flag for the javadoc executable.

This commit sets the toolchain for the javadoc task in the
framework-api module to use JDK 24 for generating Javadoc.

The common javadoc task used by all spring-* modules will be addressed
in a separate commit.

See gh-27497
See gh-34774
2025-04-17 18:12:06 +02:00
Sam Brannen c5e865494e Merge branch '6.2.x' 2025-04-17 15:48:48 +02:00
Sam Brannen 018d3c9ef2 Add integration tests for reused named parameters
See gh-34768
2025-04-17 15:48:24 +02:00
Brian Clozel a185f15352 Upgrade to Gson 2.13.0
Closes gh-34772
2025-04-17 10:28:16 +02:00
Brian Clozel 7a4bf1dcb2 Upgrade to Reactor 2025.0.0-M2
Closes gh-34770
2025-04-17 10:10:32 +02:00
Brian Clozel 16bb91e2e1 Upgrade to Micrometer 1.15.0-RC1
Closes gh-34771
2025-04-17 10:08:58 +02:00
Brian Clozel cb76ebcf9d Merge branch '6.2.x' 2025-04-17 09:50:40 +02:00
Brian Clozel c70741f60d Next development version (v6.2.7-SNAPSHOT) 2025-04-17 09:50:20 +02:00
Sam Brannen 39e263fe5d Switch javadoc link-modularity-mismatch flag to info
We now invoke the javadoc tool with "--link-modularity-mismatch info"
in order not to fail the build when encountering warnings such as the
following.

> The code being documented uses packages in the unnamed module, but the
> packages defined in https://junit.org/junit5/docs/5.12.2/api/ are in
> named modules.

Closes gh-27497
2025-04-16 14:16:59 +02:00
Sam Brannen 3057de7746 Merge branch '6.2.x' 2025-04-16 14:04:38 +02:00
Sam Brannen f40d98668d Revise configuration for javadoc Gradle tasks
Closes gh-34766
2025-04-16 13:42:05 +02:00
rstoyanchev d8b05c7eba Merge branch '6.2.x' 2025-04-16 11:59:28 +01:00
rstoyanchev 9c13c6b695 Revert "Use optimistic locking where possible in ResponseBodyEmitter"
This reverts commit e67f892e44.

Closes gh-34762
2025-04-16 11:53:22 +01:00
rstoyanchev b49924ba37 Revert "Fix handling of timeout in SseEmitter"
This reverts commit f92f9c1d5b.

See gh-34762
2025-04-16 11:41:00 +01:00
Olga Maciaszek-Sharma b24f4edbec HttpServiceGroupConfigurer extends Ordered
Closes gh-34739

Signed-off-by: Olga Maciaszek-Sharma <olga.maciaszek-sharma@broadcom.com>
2025-04-15 17:33:34 +01:00
rstoyanchev 4599ad4168 HttpServiceProxyRegistry Javadoc updates
See gh-33992
2025-04-15 17:27:48 +01:00
rstoyanchev 40853825dc Add HttpRequestValues.Processor
Closes gh-34699
2025-04-15 17:25:34 +01:00
Stéphane Nicoll 88e773ae24 Add AOT support for Registry of HTTP Interface Proxies
This commit adds AOT support for restoring the state of the
HttpServiceProxyRegistry. This generates code for the groupsMetadata
as well as for the creation of the client proxies.

Closes gh-34750
2025-04-15 17:29:43 +02:00
Stéphane Nicoll e3e99ac8a0 Add a convenience method to create a ValueCodeGenerator
This commit makes BeanDefinitionPropertyValueCodeGeneratorDelegates
public and offer a convenience method to create a ValueCodeGenerator
that works will all core delegates.

Closes gh-34761
2025-04-15 17:17:45 +02:00
Sam Brannen 5fb37e3133 Polishing 2025-04-15 15:19:34 +02:00
Stéphane Nicoll aad742ded0 Merge branch '6.2.x' 2025-04-15 10:05:53 +02:00
Stéphane Nicoll 7b8c104077 Upgrade to github-changelog-generator 0.0.12
Closes gh-34755
2025-04-15 10:04:45 +02:00
rstoyanchev 76ba02ec3e Update HttpServiceProxyRegistry
See gh-33992
2025-04-14 17:45:49 +01:00
rstoyanchev fb94109c09 WebTestClient support for API versioning
Closes gh-34568
2025-04-14 17:45:49 +01:00
Stéphane Nicoll c55bebab21 Add dependency management for 'org.jboss.logging:jboss-logging'
This commit updates framework-platform to manage the dependency of JBoss
Logging. This leads to problem previously as Hibernate Validator
requires a recent version of JBoss Logging that other dependencies
haven't upgraded to yet.

Closes gh-34749
2025-04-14 16:38:02 +02:00
Sam Brannen af461fc0a6 Merge branch '6.2.x' 2025-04-14 14:27:27 +02:00
Sam Brannen 8f62a8f579 Suppress recently introduced warning 2025-04-14 14:25:48 +02:00
Sam Brannen d5baab2aed Merge branch '6.2.x' 2025-04-14 14:16:31 +02:00
Sam Brannen d0966dfb58 Revise contribution
See gh-34747
2025-04-14 14:15:50 +02:00
lituizi bb45a3ae69 Update AbstractAutowireCapableBeanFactory.ignoreDependencyInterface() Javadoc
Specifically, the documentation update reflects that:

- Initially, it was mentioned that only the `BeanFactoryAware`
  interface is ignored by default.

- The updated documentation now correctly states that `BeanNameAware`,
  `BeanFactoryAware`, and `BeanClassLoaderAware` interfaces are all
  ignored by default.

This change ensures a more accurate representation of the default
behavior regarding which dependency interfaces are automatically
ignored during autowiring in the context of Spring's bean factory
mechanism.

Closes gh-34747

Signed-off-by: lituizi <2811328244@qq.com>
2025-04-14 14:07:35 +02:00
Sam Brannen 7dfe0cc3bd Upgrade to AspectJ 1.9.24
This commit upgrades the build to use AspectJ 1.9.24 which provides
support for JDK 24.

Closes gh-34752
2025-04-14 13:57:12 +02:00
Sam Brannen 23aea5c402 Merge branch '6.2.x' 2025-04-14 11:32:48 +02:00
Sam Brannen 7095f4cb66 Use proper casing for parameter and variable names 2025-04-14 11:25:40 +02:00
Sam Brannen a22d204681 Remove duplicate words in Java source code
Discovered using regular expression: \b(\w+)\s+\1\b[^(}]
2025-04-14 11:24:55 +02:00
Sam Brannen f27382cfb6 Consistently indent code with tabs in reference manual 2025-04-14 11:22:08 +02:00
Sam Brannen 6bc196883a Fix heading for "Context Configuration with Context Customizers" 2025-04-14 11:22:08 +02:00
Juergen Hoeller 6ade8c5a41 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-04-12 06:02:42 +02:00
Juergen Hoeller c4f66b776f Use single volatile field for indicating pre-instantiation phase
See gh-34729
2025-04-12 06:00:18 +02:00
Sam Brannen 6ab4cf49a8 Merge branch '6.2.x' 2025-04-11 16:59:35 +02:00
Sam Brannen 87e04df983 Upgrade to JUnit 5.12.2 2025-04-11 16:58:23 +02:00
Sam Brannen 4d648f8b5d Clean up warnings in Gradle build 2025-04-11 16:57:57 +02:00
Juergen Hoeller 75ed4be446 Align JSpecify @Nullable annotation 2025-04-10 18:42:27 +02:00
Juergen Hoeller 7bb7456686 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
#	spring-jdbc/src/main/java/org/springframework/jdbc/core/StatementCreatorUtils.java
2025-04-10 18:37:07 +02:00
Juergen Hoeller 6ea9f66fd7 Remove superfluous DefaultParameterNameDiscoverer configuration 2025-04-10 18:33:39 +02:00
Juergen Hoeller eea6addd26 Avoid lenient locking for additional external bootstrap threads
Includes spring.locking.strict revision to differentiate between true, false, not set.
Includes checkFlag accessor on SpringProperties, also used in StatementCreatorUtils.

Closes gh-34729
See gh-34303
2025-04-10 18:33:21 +02:00
Juergen Hoeller 7f2c1f447f Try loadClass on LinkageError in case of ClassLoader mismatch
See gh-34677
2025-04-10 18:30:45 +02:00
Sam Brannen e35db3311f Merge branch '6.2.x' 2025-04-10 17:07:18 +02:00
Sam Brannen 26869b0e4c Polish Bean Override internals 2025-04-10 17:06:27 +02:00
Sam Brannen df4868bf83 Merge branch '6.2.x' 2025-04-10 16:49:43 +02:00
Sam Brannen cd987fc104 Update Javadoc to stop mentioning 5.3.x as the status quo
Closes gh-34740
2025-04-10 16:40:04 +02:00
Sam Brannen 3f9402a56b Update testing documentation to reflect status quo 2025-04-10 15:06:52 +02:00
Sam Brannen 1795b234e4 Merge branch '6.2.x' 2025-04-10 14:52:22 +02:00
Sam Brannen c168e1c297 Provide first-class support for Bean Overrides with @⁠ContextHierarchy
This commit provides first-class support for Bean Overrides
(@⁠MockitoBean, @⁠MockitoSpyBean, @⁠TestBean, etc.) with
@⁠ContextHierarchy.

Specifically, bean overrides can now specify which ApplicationContext
they target within the context hierarchy by configuring the
`contextName` attribute in the annotation. The `contextName` must match
a corresponding `name` configured via @⁠ContextConfiguration.

For example, the following test class configures the name of the second
hierarchy level to be "child" and simultaneously specifies that the
ExampleService should be wrapped in a Mockito spy in the context named
"child". Consequently, Spring will only attempt to create the spy in
the "child" context and will not attempt to create the spy in the
parent context.

@⁠ExtendWith(SpringExtension.class)
@⁠ContextHierarchy({
    @⁠ContextConfiguration(classes = Config1.class),
    @⁠ContextConfiguration(classes = Config2.class, name = "child")
})
class MockitoSpyBeanContextHierarchyTests {

    @⁠MockitoSpyBean(contextName = "child")
    ExampleService service;

    // ...
}

See gh-33293
See gh-34597
See gh-34726
Closes gh-34723

Signed-off-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-04-10 14:46:50 +02:00
Juergen Hoeller 24c44019a0 Merge branch '6.2.x' 2025-04-07 23:55:00 +02:00
Juergen Hoeller 3afd551174 Add rejectTasksWhenLimitReached option for concurrency limit
Closes gh-34727
2025-04-07 23:54:05 +02:00
Juergen Hoeller 8bc99fa662 Merge branch '6.2.x' 2025-04-07 22:42:52 +02:00
Juergen Hoeller ffd15155ee Upgrade to Mockito 5.17 and Checkstyle 10.23 2025-04-07 22:41:45 +02:00
Juergen Hoeller 74ab5e4e25 Enforce circular reference exception between more than two threads as well
See gh-34672
2025-04-07 22:37:19 +02:00
Juergen Hoeller 4283a34fa4 Merge branch '6.2.x' 2025-04-07 17:09:36 +02:00
Juergen Hoeller 463541967a Enforce circular reference exception between all thread variations
Closes gh-34672
2025-04-07 17:08:47 +02:00
Sam Brannen 65cdbf7c07 Merge branch '6.2.x' 2025-04-07 15:57:41 +02:00
Sam Brannen 4510b78dfd Include @⁠ContextCustomizerFactories in @⁠NestedTestConfiguration Javadoc 2025-04-07 15:57:20 +02:00
Sam Brannen 024f421170 Switch to JSpecify @⁠Nullable annotation on main
See gh-34726
2025-04-07 14:19:51 +02:00
Sam Brannen 48df362dfc Merge branch '6.2.x' 2025-04-07 14:11:38 +02:00
Sam Brannen 63f4ba4b2a Move field injection logic to BeanOverrideTestExecutionListener
For bean override support (@⁠MockitoBean, @⁠TestBean, etc.), the logic
for field injection previously resided in the BeanOverrideRegistry
which resulted in a strange mixture of concerns.

To address that, this commit moves the field injection logic to the
BeanOverrideTestExecutionListener, and the BeanOverrideRegistry now
serves a single role, namely the role of a registry.

Closes gh-34726
2025-04-07 14:05:58 +02:00
Sam Brannen 0c7bc232d6 Redesign BeanOverrideRegistry internals 2025-04-07 13:42:11 +02:00
Sam Brannen 63daa7a0e4 Merge branch '6.2.x' 2025-04-06 18:18:39 +02:00
Sam Brannen 470bf3b0bb Add missing Javadoc for BeanOverrideHandler constructor 2025-04-06 18:18:07 +02:00
Sam Brannen 343f613f7c Indent with tabs instead of spaces in Gradle build scripts 2025-04-06 17:41:32 +02:00
Sam Brannen cfb7888044 Merge branch '6.2.x' 2025-04-06 17:40:51 +02:00
Sam Brannen 2ca9f6f064 Indent with tabs instead of spaces in Gradle build scripts 2025-04-06 17:39:23 +02:00
Sam Brannen 555d17df14 Merge branch '6.2.x' 2025-04-06 17:34:44 +02:00
Johnny Lim ecd8cd797e Use implementation Gradle configuration for framework-docs module
Closes gh-34719

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-04-06 17:28:34 +02:00
Juergen Hoeller 8d48a1e34b Merge branch '6.2.x' 2025-04-05 16:14:06 +02:00
Juergen Hoeller cc5ae23915 Suppress rollback attempt in case of timeout (connection closed)
Closes gh-34714
2025-04-05 16:03:31 +02:00
Sébastien Deleuze eee45c3583 Refine CORS preflight requests handling with no configuration
This commit makes CORS preflight requests handling more flexible
by just skipping setting CORS response headers when no
configuration is defined instead of rejecting them.

That will have the same effect on user agent side (the preflight
request will be considered as not authorized and the actual
request not performed) but is more flexible and more efficient.

Closes gh-31839
2025-04-04 21:32:38 +02:00
Sam Brannen 76d335aa41 Remove default value for @⁠ManagedOperationParameters container 2025-04-04 18:17:43 +02:00
Sam Brannen 5b4511fbf7 Merge branch '6.2.x' 2025-04-04 15:54:29 +02:00
Sam Brannen dbd47ff4f9 Implement additional micro performance optimizations
See gh-34717
2025-04-04 15:51:37 +02:00
Sam Brannen 381bc4c405 Polish contribution
See gh-34717
2025-04-04 15:29:10 +02:00
Olivier Bourgain 0f2308e85f Implement micro performance optimizations
- ClassUtils.isAssignable(): Avoid Map lookup when the type is not a
  primitive.

- AnnotationsScanner: Perform low cost array length check before String
  comparisons.

- BeanFactoryUtils: Use char comparison instead of String comparison.
  The bean factory prefix is '&', so we can use a char comparison
  instead of more heavyweight String.startsWith("&").

- AbstractBeanFactory.getMergedBeanDefinition(): Perform the low cost
  check first. Map lookup, while cheap, is still more expensive than
  instanceof.

Closes gh-34717

Signed-off-by: Olivier Bourgain <olivierbourgain02@gmail.com>
2025-04-04 14:34:55 +02:00
Juergen Hoeller 907c1db7a6 Merge branch '6.2.x'
# Conflicts:
#	spring-context/src/main/java/org/springframework/cache/interceptor/CacheAspectSupport.java
2025-04-04 00:28:50 +02:00
Juergen Hoeller ee804ee8fb Avoid throwing of plain RuntimeException 2025-04-04 00:22:24 +02:00
Juergen Hoeller 4e5979c75a Consistent CacheErrorHandler processing for @Cacheable(sync=true)
Closes gh-34708
2025-04-04 00:22:12 +02:00
Sébastien Deleuze 98de16bc50 Turn CDS documentation into a JVM AOT cache one
This commit evolves the CDS documentation to a JVM AOT cache
one for Java 24+, while still documenting how to use CDS for
Java 17 to Java 23.

Closes gh-34700
2025-04-03 17:55:42 +02:00
Sam Brannen d6e35cf1f0 Introduce queryParamCount() in MockRestRequestMatchers
Closes gh-34703
2025-04-03 14:50:58 +02:00
Juergen Hoeller 18989123ac Merge branch '6.2.x' 2025-04-03 12:04:38 +02:00
Juergen Hoeller e7db15b325 Perform type check before singleton check for early FactoryBean matching
Closes gh-34710
2025-04-03 11:59:22 +02:00
Sam Brannen a9cab2a3f1 Polishing 2025-04-03 11:19:53 +02:00
Sam Brannen d10d8e98c2 Remove default value for Container annotation 2025-04-03 10:59:33 +02:00
Sam Brannen 6576c52ed3 Remove unused code 2025-04-03 10:58:51 +02:00
Sam Brannen 71b6dcfa7e Merge branch '6.2.x' 2025-04-03 10:48:28 +02:00
Sam Brannen 8f9cbcd86d Add @⁠since tags
See gh-34692
2025-04-03 10:33:19 +02:00
Juergen Hoeller 5b1c55252e Merge branch '6.2.x' 2025-04-02 23:43:06 +02:00
Juergen Hoeller 6bb964e2d0 Explicitly use original ClassLoader in case of package visibility
Closes gh-34684
2025-04-02 23:41:43 +02:00
Sébastien Deleuze e9c4665a80 Merge branch '6.2.x' 2025-04-02 18:05:04 +02:00
Taeik Lim a946fe2bf8 Fix broken link for Server-Sent Events
Signed-off-by: Taeik Lim <sibera21@gmail.com>
Closes gh-34705
2025-04-02 17:43:42 +02:00
Sébastien Deleuze b94ab90eb2 Merge branch '6.2.x' 2025-04-02 17:10:56 +02:00
Sébastien Deleuze 671d972454 Add RestClient.RequestHeadersSpec#exchangeForRequiredValue
This commit adds a variant to RestClient.RequestHeadersSpec#exchange
suitable for functions returning non-null values.

Closes gh-34692
2025-04-02 17:10:01 +02:00
Sébastien Deleuze d9047d39e6 Refine ExchangeFunction Javadoc
See gh-34692
2025-04-02 17:10:01 +02:00
Sébastien Deleuze 4db12806d1 Revert "Add a requiredExchange extension to RestClient"
This reverts commit dcb9383ba1.

See gh-34692
2025-04-02 17:10:01 +02:00
Sébastien Deleuze dd888ed813 Refine StringUtils#uriDecode and update documentation
This commit adds another optimization mainly for the use case where
there is no encoded sequence, and updates the Javadoc of both
StringUtils#uriDecode and UriUtils#decode to match the implementation.

Closes gh-34673
2025-04-02 14:46:10 +02:00
Patrick Strawderman 7f1bc20688 Refine StringUtils#uriDecode
Refine the StringUtils#uriDecode method in the following ways:

- Use a StringBuilder instead of ByteArrayOutputStream, and only decode
  %-encoded sequences.
- Use HexFormat.fromHexDigits to decode hex sequences.
- Decode to a byte array that is only allocated if encoded sequences are
  encountered.

Signed-off-by: Patrick Strawderman <pstrawderman@netflix.com>
See gh-34673
2025-04-02 14:33:51 +02:00
Brian Clozel 0b92a51650 Reinstate failing tests after Tomcat upgrade
Closes gh-33917
2025-04-02 11:05:56 +02:00
rstoyanchev c35aac0c52 Merge branch '6.2.x' 2025-04-02 09:06:06 +01:00
rstoyanchev 290c9c4a19 Use form charset in ServletServerHttpRequest
Closes gh-34675
2025-04-02 09:05:52 +01:00
rstoyanchev e01ad5a08d Polishing in ServletServerHttpRequest
See gh-34675
2025-04-02 09:05:52 +01:00
Brian Clozel a787088df2 Merge branch '6.2.x' 2025-04-02 09:40:05 +02:00
Brian Clozel b8158df3d6 Create new observation context for WebClient retries
Prior to this commit, the `DefaultWebClient` observability
instrumentation would create the observation context before the reactive
pipeline is fully materialized. In case of errors and retries (with the
`retry(long)` operator), the observation context would be reused for
separate observations, which is incorrect.

This commit ensures that a new observation context is created for each
subscription.

Fixes gh-34671
2025-04-02 09:37:16 +02:00
Juergen Hoeller 533283a23e Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-04-01 23:44:04 +02:00
Juergen Hoeller c4e25a1162 Upgrade to Jetty 12.0.18, Apache HttpClient 5.4.3, Protobuf 4.30.2, Checkstyle 10.22 2025-04-01 23:24:25 +02:00
Juergen Hoeller 7970046f17 Upgrade to Commons Logging 1.3.5, Tomcat 11.0.5, Jetty 12.1.0.alpha2, Hibernate ORM 7.0.0.Beta5 2025-04-01 22:54:51 +02:00
Juergen Hoeller d06b47818b Align JSpecify @Nullable annotation 2025-04-01 22:23:46 +02:00
Juergen Hoeller 5e2c16c30c Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/CglibSubclassingInstantiationStrategy.java
2025-04-01 22:21:56 +02:00
Juergen Hoeller 48009c8534 Introduce support for concurrent startup phases with timeouts
Closes gh-34634
2025-04-01 22:18:26 +02:00
Juergen Hoeller 203ca30a64 Include cause in MethodInvocationException message
Closes gh-34691
2025-04-01 22:12:17 +02:00
Juergen Hoeller 34ea0461c7 Polishing 2025-04-01 22:12:09 +02:00
rstoyanchev 7bf628c827 Client support for API versioning
Closes gh-34567
2025-04-01 17:04:15 +01:00
rstoyanchev 483abd96a4 Polishing in client adapter tests 2025-04-01 17:02:48 +01:00
Sébastien Deleuze 5c93bb38c4 Merge branch '6.2.x' 2025-04-01 09:53:42 +02:00
Dmitry Sulman fbaeaf12bd Recursively boxing Kotlin nested value classes
This commit is a follow-up to gh-34592. It introduces
recursive boxing of Kotlin nested value classes in CoroutinesUtils.

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
Closes gh-34682
2025-04-01 09:53:23 +02:00
rstoyanchev 10e32c92e6 Make container annotation for ImportHttpServices nested
See gh-33992
2025-03-31 18:29:24 +01:00
Juergen Hoeller a122dda596 Merge branch '6.2.x' 2025-03-31 16:42:29 +02:00
Juergen Hoeller 7b08feeb6d Make jar caching configurable through setUseCaches
Closes gh-34678
2025-03-31 16:41:16 +02:00
Juergen Hoeller 743f32675d Only attempt load for CGLIB classes in AOT mode
Closes gh-34677
2025-03-31 16:39:18 +02:00
Juergen Hoeller 3ddc607b3e Add spring.locking.strict property to common appendix
See gh-34303
2025-03-31 16:38:28 +02:00
rstoyanchev ebdebbbd06 Rename HttpServiceGroups to ImportHttpServiceGroups
See gh-33992
2025-03-31 15:21:00 +01:00
rstoyanchev 779f1b080e Merge branch '6.2.x' 2025-03-31 11:36:44 +01:00
rstoyanchev f68fb97e7e Remove outdated notes on forwarded headers.
Closes gh-34625
2025-03-31 11:36:15 +01:00
Sam Brannen b2af1af50f Merge branch '6.2.x' 2025-03-31 12:19:43 +02:00
Sam Brannen 044258f085 Support abstract @⁠Configuration classes without @⁠Bean methods again
Historically, @⁠Configuration classes that did not declare @⁠Bean
methods were allowed to be abstract. However, the changes made in
76a6b9ea79 introduced a regression that prevents such classes from
being abstract, resulting in a BeanInstantiationException. This change
in behavior is caused by the fact that such a @⁠Configuration class is
no longer replaced by a concrete subclass created dynamically by CGLIB.

This commit restores support for abstract @⁠Configuration classes
without @⁠Bean methods by modifying the "no enhancement required" check
in ConfigurationClassParser.

See gh-34486
Closes gh-34663
2025-03-31 12:18:55 +02:00
Sam Brannen 18645022e9 Merge branch '6.2.x' 2025-03-31 12:13:23 +02:00
Sam Brannen 36d9357f94 Fix Kotlin compilation errors 2025-03-31 12:02:51 +02:00
Sébastien Deleuze dcb9383ba1 Add a requiredExchange extension to RestClient
Closes gh-34692
2025-03-31 11:55:41 +02:00
Tobias Hänel f8a3077da9 Fix typo in Bean Validation section of reference manual
This commit fixes a minor typo in  the "Java Bean Validation - Customizing
Validation Errors" section of the reference manual.

Closes gh-34686

Signed-off-by: Tobias Hänel <contact@tobias-haenel.de>
2025-03-31 11:55:30 +02:00
rstoyanchev 87fa9a5acb Polishing in GroupsMetadata
See gh-33992
2025-03-31 10:23:57 +01:00
Sébastien Deleuze 85bc6350ce Merge branch '6.2.x' 2025-03-31 11:16:01 +02:00
Sébastien Deleuze d771d02119 Add a requiredExchange extension to RestClient
Closes gh-34692
2025-03-31 11:15:40 +02:00
rstoyanchev 302f04ecf3 Replace Map argument with GroupsMetadata
In preparation for HTTP Service registry AOT support.

See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev 1c0bcba587 Add HTTP Service registrar tests
Closes gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev 42409e21fa Lazy loading of HTTP Service classes
To help with AOT support, update AbstractHttpServiceRegistrar to store
HTTP Service types by name, and avoid loading classes during the bean
definition registration phase.

See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev 49e24b7dfa Add author tags to HTTP Service registry
See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev 9721cbad5c Further simplify GroupAdapter initialization
See gh-33992
2025-03-31 10:11:42 +01:00
Phillip Webb 39c4cc537d Apply HTTP Service group configurers in order
See gh-33992
2025-03-31 10:11:42 +01:00
Phillip Webb 7c3618de7c Fixup checkstyle violations
See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev 92b0eb7f8b Add HTTP Service registry support
See gh-33992
2025-03-31 10:11:42 +01:00
Tobias Hänel a63c5ad305 Fix typo in Bean Validation section of reference manual
This commit fixes a minor typo in  the "Java Bean Validation - Customizing
Validation Errors" section of the reference manual.

Closes gh-34686

Signed-off-by: Tobias Hänel <contact@tobias-haenel.de>
2025-03-30 20:28:12 +02:00
Sam Brannen 551f6c0c66 Polishing 2025-03-29 13:27:32 +01:00
Sam Brannen 9956cc11bb Merge branch '6.2.x' 2025-03-29 12:57:49 +01:00
Sam Brannen 9fd1d0c6a3 Polish Javadoc
This commit also reverts the change to ASM's SymbolTable class.

See gh-34679
2025-03-29 12:57:08 +01:00
Tran Ngoc Nhan 30fcaef813 Remove unnecessary closing curly brackets in Javadoc
Closes gh-34679

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-03-29 12:37:48 +01:00
Sam Brannen 8379ac772a Introduce OptionalToObjectConverter
We have had an ObjectToOptionalConverter since Spring Framework 4.1;
however, prior to this commit we did not have a standard Converter for
the inverse (Optional to Object).

To address that, this commit introduces an OptionalToObjectConverter
that unwraps an Optional, using the ConversionService to convert the
object contained in the Optional (potentially null) to the target type.

This allows for conversions such as the following.

- Optional.empty()                             -> null
- Optional.of(42) with Integer target          -> 42
- Optional.of(42) with String target           -> "42"
- Optional.of(42) with Optional<String> target -> Optional.of("42")

The OptionalToObjectConverter is also registered by default in
DefaultConversionService, alongside the existing
ObjectToOptionalConverter.

See gh-20433
Closes gh-34544
2025-03-29 12:15:46 +01:00
Sam Brannen b8c2780bfe Simplify SpEL ExpressionWithConversionTests 2025-03-29 12:15:46 +01:00
Juergen Hoeller ac7c7ff5b2 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-03-28 20:47:57 +01:00
Juergen Hoeller 75e5a75da5 Enforce circular reference exception within non-managed thread
Closes gh-34672
2025-03-28 20:46:09 +01:00
Juergen Hoeller 9bf01df230 Evaluate lenientLockingAllowed flag per DefaultListableBeanFactory instance
See gh-34303
2025-03-28 20:45:06 +01:00
Sam Brannen 51c084ffb6 Polishing 2025-03-28 14:54:43 +01:00
Yanming Zhou 5be83e9223 Stop calling deprecated JdbcOperations methods
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-28 14:40:51 +01:00
Sam Brannen e41487492d Merge branch '6.2.x' 2025-03-27 16:06:11 +01:00
Sam Brannen 8d2166139f Update SpringCoreTestSuite to include AOT 2025-03-27 16:04:51 +01:00
Sam Brannen 8edda5c768 Remove java24 classpath entries in Eclipse for the time being 2025-03-27 16:03:39 +01:00
Sam Brannen 2fa7b30831 Merge branch '6.2.x' 2025-03-27 15:32:42 +01:00
Sam Brannen 374c3b4545 Provide complete support for qualifier annotations with Bean Overrides
Prior to this commit, the Test Bean Override feature provided support
for overriding beans based on qualifier annotations in several
scenarios; however, qualifier annotations got lost if they were
declared on the return type of the @⁠Bean method for the bean being
overridden and the @⁠BeanOverride (such as @⁠MockitoBean) was based on
a supertype of that return type.

To address that, this commit sets the @⁠BeanOverride field as the
"qualified element" in the RootBeanDefinition to ensure that qualifier
annotations are available for subsequent autowiring candidate
resolution.

Closes gh-34646
2025-03-27 15:29:14 +01:00
Sam Brannen d7e470d3e0 Polishing 2025-03-27 14:05:25 +01:00
Stéphane Nicoll 7ab108a321 Merge branch '6.2.x' 2025-03-27 12:12:54 +01:00
Stéphane Nicoll 2862c87601 Make sure the generated values are available from a static context
This commit updates the tests of property values code generated to
invoke the generated code from a `static` context. This ensures that
the test fails if that's not the case.

This commit also updated LinkedHashMap handling that did suffer from
that problem.

Closes gh-34659
2025-03-27 12:06:18 +01:00
Juergen Hoeller f55ca3058b Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-03-26 23:49:54 +01:00
Juergen Hoeller aa56b5001a Detect late-set primary markers for autowiring shortcut algorithm
Closes gh-34658
2025-03-26 23:47:42 +01:00
Sébastien Deleuze 7e9c33f50e Polishing
See gh-34555
2025-03-26 10:56:34 +01:00
Dmitry Sulman 00b88ec76f Propagate CoroutineContext to WebClient filter
This commit introduces a new ResponseSpec.awaitEntityOrNull() extension
function to replace ResponseSpec.toEntity(...).awaitFirstOrNull() and
pass the CoroutineContext to the CoExchangeFilterFunction.

CoroutineContext propagation is implemented via ReactorContext and
ClientRequest attribute.

Closes gh-34555
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-26 10:54:53 +01:00
Juergen Hoeller 3872c1a762 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
#	spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerContainerFactory.java
#	spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java
2025-03-25 17:13:02 +01:00
Juergen Hoeller 84430a8db2 Polishing 2025-03-25 17:09:24 +01:00
Juergen Hoeller 6905dff660 Introduce spring.locking.strict=true flag for 6.1.x style bean creation locking
Closes gh-34303
2025-03-25 17:08:55 +01:00
Juergen Hoeller 20736bd06f Introduce acknowledgeAfterListener flag for custom acknowledge handling
Closes gh-34635
2025-03-25 17:06:28 +01:00
Brian Clozel fb423d66e3 Add ClassFile variant for class metadata reading
Prior to this commit, Spring Framework would use its own ASM fork to
read class/method/annotation metadata from bytecode. This is typically
used in configuration class parsing to build bean definitions without
actually loading classes at runtime at that step.

This commit adds support for a new metadata reading implementation that
uses the ClassFile API available as of Java 24. For now, this is turned
on by default for Java 24+.

Closes gh-33616
2025-03-25 15:33:53 +01:00
Brian Clozel 20b35f068a Add visibility and return type to SimpleMethodMetadata toString
Closes gh-34649
2025-03-25 15:32:42 +01:00
Juergen Hoeller 7d0cc6c83a Merge branch '6.2.x' 2025-03-25 00:11:30 +01:00
Juergen Hoeller 37fb79e8ff Fix qualifier resolution for aliased name against parent factory
Closes gh-34644
2025-03-25 00:08:42 +01:00
Sam Brannen d1a1364231 Reinstate links to JUnit 5 Javadoc APIs
Now that we are using JDK 18+ (currently JDK 24 -- see JavaConventions
in buildSrc for details), we can reinstate links to JUnit 5 Javadoc APIs.

Closes gh-27497
2025-03-24 16:58:53 +01:00
Sam Brannen 02c7719eef Update Javadoc regarding convention-based annotation attribute overrides
This commit updates the Javadoc in various places to reflect the fact
that support for convention-based annotation attribute overrides has
been removed.

See gh-28761
2025-03-24 14:13:45 +01:00
Sam Brannen d5bfd7ff8b Polishing 2025-03-24 14:13:45 +01:00
Sam Brannen 065692237c Document that @⁠AliasFor(attribute) is optional in override use cases
This commit documents that `attribute` is optional in @⁠AliasFor for
meta-annotation attribute overrides with the same name.

Closes gh-34641
2025-03-24 14:13:31 +01:00
Brian Clozel 603e559397 Update Java runtime in SDKMan! env file
See gh-34639
2025-03-24 10:17:08 +01:00
Brian Clozel b8b279d3e0 Use Java 24 to build Spring Framework
This commit also adapts tests for a Java 24 runtime.

Closes gh-34639
2025-03-24 09:51:19 +01:00
Sam Brannen 274a689a10 Revise RepeatableContainers API to better guide developers
Historically, the Spring Framework first had support for repeatable
annotations based on convention and later added explicit support for
Java 8's @⁠Repeatable facility. Consequently, the support for both
types of repeatable annotations has grown a bit intertwined over the
years. However, modern Java applications typically make use of
@⁠Repeatable, and convention-based repeatable annotations have become
more of a niche.

The RepeatableContainers API supports both types of repeatable
annotations with @⁠Repeatable support being the default. However,
RepeatableContainers.of() makes it very easy to enable support for
convention-based repeatable annotations while accidentally disabling
support for @⁠Repeatable, which can lead to subtle bugs – for example,
if convention-based annotations are combined with @⁠Repeatable
annotations. In addition, it is not readily clear how to combine
@⁠Repeatable support with convention-based repeatable annotations.

In light of the above, this commit revises the RepeatableContainers API
to better guide developers to use @⁠Repeatable support for almost all
use cases while still supporting convention-based repeatable
annotations for special use cases.

Specifically:

- RepeatableContainers.of() is now deprecated in favor of the new
  RepeatableContainers.explicitRepeatable() method.

- RepeatableContainers.and() is now deprecated in favor of the new
  RepeatableContainers.plus() method which declares the repeatable and
  container arguments in the same order as the rest of Spring
  Framework's repeated annotation APIs.

For example, instead of the following confusing mixture of
repeatable/container and container/repeatable:

RepeatableContainers.of(A.class, A.Container.class)
    .and(B.Container.class, B.class)

Developers are now be able to use:

RepeatableContainers.explicitRepeatable(A.class, A.Container.class)
    .plus(B.class, B.Container.class)

This commit also overhauls the Javadoc for RepeatableContainers and
explicitly points out that the following is the recommended approach to
support convention-based repeatable annotations while retaining support
for @⁠Repeatable.

RepeatableContainers.standardRepeatables()
    .plus(MyRepeatable1.class, MyContainer1.class)
    .plus(MyRepeatable2.class, MyContainer2.class)

See gh-20279
Closes gh-34637
2025-03-23 18:38:45 +01:00
Juergen Hoeller 7d5b3892c4 Add since 7.0 tags for stream methods
See gh-34623
2025-03-21 18:44:57 +01:00
Yanming Zhou 8819c749ce Introduce Stream variant methods for SqlQuery
Closes GH-34474

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-21 18:38:28 +01:00
Sam Brannen b7a9bee020 Polishing 2025-03-21 17:43:26 +01:00
Juergen Hoeller 58246ec5ec Merge branch '6.2.x' 2025-03-21 15:54:43 +01:00
Juergen Hoeller d8f8e76791 Check potentially more specific HibernateException cause as well
Closes gh-34633
2025-03-21 15:53:24 +01:00
Juergen Hoeller dc41ff569e Add javadoc notes on potential exception suppression in getBeansOfType
Closes gh-34629
2025-03-21 15:52:42 +01:00
Sébastien Deleuze 07ae1853ff Upgrade to Kotlin 2.1.20
Closes gh-34632
2025-03-21 15:01:17 +01:00
Sébastien Deleuze 5ce64f47b2 Add support for ImportAware in BeanRegistrar
Closes gh-34627
2025-03-21 11:49:15 +01:00
Sam Brannen 3e788e4ca1 Consistent parameter declaration order 2025-03-21 11:31:43 +01:00
Juergen Hoeller 66c94bb4a2 Merge branch '6.2.x' 2025-03-21 11:06:59 +01:00
Juergen Hoeller 47651350f3 Polishing 2025-03-21 10:58:40 +01:00
Juergen Hoeller 0e1422820f JdbcClient holds ConversionService for queries with mapped classes
Closes gh-33467
2025-03-21 10:43:37 +01:00
rstoyanchev a145f6205e Merge branch '6.2.x' 2025-03-21 09:05:58 +00:00
rstoyanchev 15c20c3e65 Fix regression with opaque URI determination
Before RfcUriParser we expected opaque URI's to not have ":/"
after the scheme while the new parser expect opaque URI's to
not have a slash anywhere after the scheme. This commit
restores the previous behavior.

Closes gh-34588
2025-03-21 09:05:41 +00:00
Juergen Hoeller d710f73c47 Log public final method at warn level for non-interface case as well
Closes gh-33939
2025-03-21 09:40:52 +01:00
Sam Brannen 6505c4b839 Refine use of isArray() and componentType() 2025-03-20 17:28:37 +01:00
Sam Brannen cc9b39b53f Extract AnnotatedElementAdapter to public type
This commit extracts AnnotatedElementAdapter from TypeDescriptor and
introduces it as a public, top-level type in the
org.springframework.core.annotation package, and
AnnotatedElementUtils.forAnnotations() now returns an instance of
AnnotatedElementAdapter instead of AnnotatedElementForAnnotations which
has been removed.

In addition, this commit adds missing Javadoc for
AnnotatedElementAdapter and refines some of the implementation.

Closes gh-34628
2025-03-20 16:20:47 +01:00
Sam Brannen a376ef36e4 Merge branch '6.2.x' 2025-03-20 10:24:39 +01:00
Dmitry Sulman 5455c645f0 Update deprecated Gradle task creation
This commit replaces use of the deprecated Gradle `task` method with
the new `tasks.register` method.

Closes gh-34617

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-20 10:22:55 +01:00
Brian Clozel cacc63da20 Merge branch '6.2.x' 2025-03-19 18:19:12 +01:00
Brian Clozel adb4b675fc Next development version (v6.2.6-SNAPSHOT) 2025-03-19 18:18:50 +01:00
Sam Brannen 92ee20c896 Adhere to new Checkstyle rule 2025-03-19 16:29:03 +01:00
Sam Brannen 8db1340263 Merge branch '6.2.x' 2025-03-19 16:24:18 +01:00
Sam Brannen 208d52d852 Introduce Checkstyle rule for separator symbol location 2025-03-19 15:35:44 +01:00
Sébastien Deleuze 2f8c5a580a Polishing 2025-03-19 15:11:43 +01:00
Sébastien Deleuze 2bc213d703 Allow registering aliases with BeanRegistry
Closes gh-34599
2025-03-19 15:11:32 +01:00
rstoyanchev 087d239148 Merge branch '6.2.x' 2025-03-19 12:34:58 +00:00
rstoyanchev 18c3b637e4 Fix dated Javadoc in MvcUriComponentsBuilder
related to forwarded headers

Closes gh-34615
2025-03-19 12:33:01 +00:00
rstoyanchev 34c69bfc67 Allow empty comment in ServerResponse.SseBuilder
Closes gh-34608
2025-03-19 12:14:37 +00:00
rstoyanchev 37d7af42ac Allow setting ApplicationContext on MockServerWebExchange
Closes gh-34601
2025-03-19 11:06:38 +00:00
Juergen Hoeller 73c4b46ed7 Merge branch '6.2.x' 2025-03-19 11:00:39 +01:00
Juergen Hoeller cc986cd2e8 Defer triggerAfterCompletion invocation in doRollbackOnCommitException
Closes gh-34595
2025-03-19 10:59:46 +01:00
Sébastien Deleuze 6ab87477ea Merge branch '6.2.x' 2025-03-18 17:58:38 +01:00
Sébastien Deleuze 0141725638 Polishing
Closes gh-34592
2025-03-18 17:50:28 +01:00
Dmitry Sulman 0c2ba4e38e Recursively box/unbox nested inline value classes
See gh-34592
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-18 17:50:28 +01:00
Sam Brannen 84ba6b4b26 Add package to Javadoc link 2025-03-18 16:52:12 +01:00
Sam Brannen e05d4f2f18 Merge branch '6.2.x' 2025-03-18 16:42:37 +01:00
Sam Brannen c6a9aa59a3 Remove BDDMockito Checkstyle rule
This commit removes the BDDMockito Checkstyle rule, since it did not
actually enforce the use of BDDMockito.

This commit also updates static imports to use Mockito instead of
BDDMockito where appropriate (automated via the Eclipse IDE Organize
Imports clean-up task).

Closes gh-34616
2025-03-18 16:35:57 +01:00
Juergen Hoeller 69ed984a81 Merge branch '6.2.x' 2025-03-18 16:11:38 +01:00
Juergen Hoeller ad949a7450 Add includeNonSingletons flag for ObjectProvider stream access
Closes gh-34591
2025-03-18 16:10:30 +01:00
Sam Brannen ce815006d2 Generate compiled SpEL expressions using Java 17 byte code level
Closes gh-34602
2025-03-18 12:44:01 +01:00
Sam Brannen d6a7aefd1d Add comments regarding Java 1.8 byte code level for CGLIB
Unfortunately, it is not possible to raise the byte code level beyond
Java 1.8 for classes generated using CGLIB due to the fact that CGLIB
generates STATICHOOK methods which set static final fields outside the
initializer method <clinit> (i.e., a static initialization block).

Attempting to raise the level to Java 17 (or even Java 9) results in
exceptions like the following.

Caused by: java.lang.IllegalAccessError: Update to static final field
  org.example.MyBean$$SpringCGLIB$$0.CGLIB$THREAD_CALLBACKS attempted from
  a different method (CGLIB$STATICHOOK1) than the initializer method <clinit>
    at org.example.MyBean$$SpringCGLIB$$0.CGLIB$STATICHOOK1(<generated>)
    at org.example.MyBean$$SpringCGLIB$$0.<clinit>(<generated>)

This commit therefore introduces inline comments pointing out why we
stay with Java 1.8 byte code level with CGLIB.

See gh-34602
2025-03-18 12:40:28 +01:00
Juergen Hoeller a0763d13c5 Merge branch '6.2.x' 2025-03-17 19:24:30 +01:00
Juergen Hoeller 86b2617c7f Suggest compilation with -parameters in case of ambiguity
Closes gh-34609
2025-03-17 19:22:56 +01:00
Juergen Hoeller 760376c318 Restore check for jar root existence (now via getEntryName/getJarEntry)
Closes gh-34607
2025-03-17 19:20:41 +01:00
Juergen Hoeller 5b6abe4c13 Upgrade to ASM 9.8 (for early Java 25 support)
Closes gh-34600
2025-03-17 19:16:42 +01:00
Sam Brannen 30a7f7be28 Merge branch '6.2.x' 2025-03-17 18:13:04 +01:00
Sam Brannen 7a839e988a Make dependencies on AssertJ and JUnit in spring-core-test optional
This commit also removes unnecessary dependencies in
spring-core-test.gradle and updates framework-docs.gradle accordingly.

Closes gh-34612
2025-03-17 18:11:25 +01:00
ChanHyeongLee 8ee09e5766 Separate commonly used DepositionTypeCheck into methods
Closes gh-34573

Signed-off-by: ChanHyeongLee <cksgud410@gmail.com>
[brian.clozel@broadcom.com: apply code conventions]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-03-17 11:52:18 +01:00
Sébastien Deleuze de75b6e1a2 Merge branch '6.2.x' 2025-03-17 11:42:06 +01:00
Sébastien Deleuze 46859d6391 Polishing
Closes gh-34594
2025-03-17 11:39:15 +01:00
Russell Bolles 573e74b8bd Refine FormHttpMessageConverter exception handling
FormHttpMessageConverter could throw a more specific
HttpMessageNotReadableException instead of an IllegalArgumentException
when the http form data is invalid.

See gh-34594
Signed-off-by: Russell Bolles <rbolles@netflix.com>
2025-03-17 11:37:42 +01:00
Sam Brannen b660d8c553 Merge branch '6.2.x' 2025-03-16 16:15:24 +01:00
Sam Brannen 6c231804a0 Upgrade to Mockito 5.16.1 2025-03-16 15:33:33 +01:00
Sam Brannen 892a5cdca6 Upgrade to AspectJ 1.9.23
This commit upgrades the build to use AspectJ 1.9.23 which provides
support for JDK 23.

Closes gh-34598
2025-03-15 17:13:02 +01:00
Sam Brannen 37a135447c Rely on standard @Repeatable support in AnnotationJmxAttributeSource
This commit removes the use of RepeatableContainers.of() in
AnnotationJmxAttributeSource since that is unnecessary when using the
MergedAnnotations API with @⁠Repeatable annotations such as
@⁠ManagedOperationParameter and @⁠ManagedNotification.

Closes gh-34606
2025-03-15 16:56:56 +01:00
Sam Brannen 13efc2205b Test status quo for @⁠Repeatable annotation support in AnnotationJmxAttributeSource 2025-03-15 16:42:40 +01:00
Sam Brannen 6e1706a8a4 Polish [Annotation]JmxAttributeSource 2025-03-15 15:15:45 +01:00
Sam Brannen f678af4626 Merge branch '6.2.x' 2025-03-15 13:51:56 +01:00
Tran Ngoc Nhan 7c3913050a Fix formatting and update links to scripting libraries and HDIV
Closes gh-34603

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
(cherry picked from commit 666e2df0f3)
2025-03-15 13:51:28 +01:00
Tran Ngoc Nhan 666e2df0f3 Fix formatting and update links to scripting libraries and HDIV
Closes gh-34603

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
Co-authored-by: Sam Brannen <104798+sbrannen@users.noreply.github.com>
2025-03-15 13:49:32 +01:00
Sam Brannen ae13eac86b Merge branch '6.2.x' 2025-03-14 18:06:14 +01:00
Sam Brannen ec488282a8 Upgrade to JUnit 5.12.1 2025-03-14 18:03:23 +01:00
Juergen Hoeller d2a8b56742 Merge branch '6.2.x' 2025-03-13 18:49:30 +01:00
Juergen Hoeller 911cdb2ad0 Add resolveAutowireCandidates variant with includeNonSingletons and allowEagerInit
Closes gh-34591
2025-03-13 18:48:43 +01:00
Brian Clozel 4724020174 Merge branch '6.2.x' 2025-03-13 15:26:47 +01:00
Brian Clozel 0f83c483bb Remove invalid link from reference documentation
Closes gh-34593
2025-03-13 15:26:09 +01:00
Sébastien Deleuze 90e32cadeb Merge branch '6.2.x' 2025-03-13 12:58:04 +01:00
Sébastien Deleuze c9050607bc Fix StringUtils#uriDecode Javadoc
Closes gh-34590
2025-03-13 12:57:44 +01:00
Brian Clozel d9bd168d54 Merge branch '6.2.x' 2025-03-13 09:50:21 +01:00
Brian Clozel 5e82ee6bd7 Next development version (v6.2.5-SNAPSHOT) 2025-03-13 09:44:23 +01:00
Sam Brannen 68fce29ae9 Support Optional with null-safe and Elvis operators in SpEL expressions
This commit introduces null-safe support for java.util.Optional in the
following SpEL operators:

- PropertyOrFieldReference
- MethodReference
- Indexer
- Projection
- Selection
- Elvis

Specifically, when a null-safe operator is applied to an empty
`Optional`, it will be treated as if the `Optional` were `null`, and
the subsequent operation will evaluate to `null`. However, if a
null-safe operator is applied to a non-empty `Optional`, the subsequent
operation will be applied to the object contained in the `Optional`,
thereby effectively unwrapping the `Optional`.

For example, if `user` is of type `Optional<User>`, the expression
`user?.name` will evaluate to `null` if `user` is either `null` or an
empty `Optional` and will otherwise evaluate to the `name` of the
`user`, effectively `user.get().getName()` for property access.

Note, however, that invocations of methods defined in the `Optional`
API are still supported on an empty `Optional`. For example, if `name`
is of type `Optional<String>`, the expression `name?.orElse('Unknown')`
will evaluate to "Unknown" if `name` is an empty `Optional` and will
otherwise evaluate to the `String` contained in the `Optional` if
`name` is a non-empty `Optional`, effectively `name.get()`.

Closes gh-20433
2025-03-12 14:53:06 +01:00
Sam Brannen 1780e30a43 Polish documentation for SpEL Elvis operator 2025-03-12 14:52:57 +01:00
Sam Brannen c7b0550e43 Test status quo for Optional support in SpEL expressions
This is a prerequisite for null-safe Optional support.

See gh-20433
2025-03-12 14:02:17 +01:00
Sam Brannen 71716e848d Cache capitalized name in SpEL's ReflectivePropertyAccessor 2025-03-12 14:01:19 +01:00
Sam Brannen 2c05e991b5 Revise SpEL internals and documentation
This is a prerequisite for null-safe Optional support.

See gh-20433
2025-03-12 13:59:26 +01:00
Sam Brannen d3d951e44b Improve documentation for SpEL Elvis operator 2025-03-12 13:35:41 +01:00
rstoyanchev f8a82b46c1 Fix WebSocketHandlerMapping match for "/*"
Closes gh-34503
2025-03-12 12:29:35 +00:00
Juergen Hoeller 057742f27a Remove Netty 5 support
See gh-34345
2025-03-12 12:55:31 +01:00
Juergen Hoeller ea551cd9b3 Merge branch '6.2.x'
# Conflicts:
#	build.gradle
#	framework-platform/framework-platform.gradle
2025-03-12 12:52:34 +01:00
Juergen Hoeller 387677eae8 Upgrade to JUnit 5.12
Closes gh-34416
2025-03-12 12:46:34 +01:00
Sébastien Deleuze 1eec0382d7 Polishing
See gh-34557
2025-03-12 12:35:30 +01:00
Sébastien Deleuze 762831e742 Add BeanRegistrarDsl.register
See gh-34557
2025-03-12 12:34:04 +01:00
Juergen Hoeller 641b809d4b Upgrade to Reactor 2025.0.0-M1
Closes gh-34577
2025-03-12 12:21:00 +01:00
Juergen Hoeller 0d3f07fdd6 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-03-12 11:54:31 +01:00
Juergen Hoeller 4a314867d7 Upgrade to Reactor 2024.0.4 and Micrometer 1.14.5
Closes gh-34578
Closes gh-34580
2025-03-12 11:51:33 +01:00
Sam Brannen eb7b26db24 Merge branch '6.2.x' 2025-03-12 11:20:05 +01:00
Sam Brannen 020f556841 Support custom attribute with a value in MockCookie.parse()
Prior to this commit, MockCookie.parse() failed with an
IllegalArgumentException when attempting to parse a custom attribute
with a value, such as "Version=1". This is a regression that was
inadvertently introduced in 7fc4937199
when adding support for the "Partitioned" attribute which does not
support a value.

This commit addresses this regression by parsing both the name and the
value from an optional, custom attribute.

See gh-31454
Closes gh-34575
2025-03-12 11:19:38 +01:00
Juergen Hoeller 86b21d9b5c Add support for BeanRegistrar registration on GenericApplicationContext
Closes gh-34574
2025-03-11 21:18:20 +01:00
Juergen Hoeller beb3a91847 Upgrade to Hibernate ORM 7.0.0.Beta4
Includes Hamcrest 3.0

See gh-33750
2025-03-11 19:17:00 +01:00
rstoyanchev 4d955f9ed8 Merge branch '6.2.x' 2025-03-10 20:59:55 +00:00
rstoyanchev 6ea3b5a0e8 Fix Javadoc failure
See gh-34549
2025-03-10 20:59:33 +00:00
rstoyanchev f8f712dff8 Merge branch '6.2.x' 2025-03-10 18:18:05 +00:00
rstoyanchev d764087dbf Correct since tag
See gh-34549
2025-03-10 18:17:47 +00:00
rstoyanchev bb2174c260 Merge branch '6.2.x' 2025-03-10 18:12:57 +00:00
rstoyanchev 9ab43b138a Enhancement in HandlerMethodValidationException
Add dedicated method to Visitor for constraints directly on a
RequestBody method parameter (rather than nested).

Closes gh-34549
2025-03-10 18:01:55 +00:00
rstoyanchev 09ae080b99 isDisconnectedClientException protected for null
Closes gh-34533
2025-03-10 17:19:13 +00:00
rstoyanchev e73dc37513 API versioning support for Spring WebFlux
Closes gh-34566
2025-03-10 13:53:12 +00:00
rstoyanchev 51d34fff64 API versioning support for Spring MVC
See gh-34566
2025-03-10 13:53:12 +00:00
Sébastien Deleuze e9701a9ce3 Remove support for Aware interfaces in BeanRegistrar
Closes gh-34562
2025-03-10 12:14:11 +01:00
Juergen Hoeller 15b251dcd6 Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-03-10 11:04:14 +01:00
Juergen Hoeller 70a1b2fae3 Upgrade to Checkstyle 10.21.4 2025-03-10 11:00:53 +01:00
Juergen Hoeller 90ddb40d7a Upgrade to Jetty 12.0.17 and Jetty Reactive HttpClient 4.0.9
Includes Apache HttpClient 5.4.1, Netty 4.1.119, Jackson 2.18.3, Gson 2.12.1, FreeMarker 2.3.34, Protobuf 4.30, Groovy 4.0.26, Jython 2.7.4, JRuby 9.4.12, Caffeine 3.2, QDox 2.2, Awaitility 4.3, EasyMock 5.5, HtmlUnit 4.10

Closes gh-34561
2025-03-10 11:00:35 +01:00
Sébastien Deleuze 91d0ebe327 Refine BeanRegistryAdapterTests
Closes gh-34557
2025-03-10 10:39:21 +01:00
Phillip Webb 789791e186 Allow chained BeanRegistry registration
Add a `register(BeanRegistry registry)` method to `BeanRegistry`
to allow registration chaining.

See gh-34557
2025-03-10 10:38:50 +01:00
Sébastien Deleuze a0e2d3a221 Add support for target type to BeanRegistry
Closes gh-34560
2025-03-10 10:14:28 +01:00
Juergen Hoeller c74f897fac Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/test/java/org/springframework/beans/factory/DefaultListableBeanFactoryTests.java
2025-03-08 12:23:43 +01:00
Juergen Hoeller 143985e862 Add tests for primary/fallback/defaultCandidate precedence
Closes gh-34449
2025-03-08 12:22:14 +01:00
Juergen Hoeller 4bd280b87e Explain availability and uniqueness (including primary/fallback/default) in javadoc
Closes gh-34447
2025-03-08 12:22:04 +01:00
Juergen Hoeller 5877a38fa1 Add explicit note on JSpecify support in Spring Framework 6.2 vs 7.0
Closes gh-34551
2025-03-08 12:21:46 +01:00
Yanming Zhou 639af7befa Add tests to ensure bean definition flag "fallback" take precedence over "defaultCandidate"
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-08 12:21:31 +01:00
Sam Brannen 86d81632c8 Consistently invoke isNullSafe() 2025-03-07 16:58:59 +01:00
Sam Brannen 80df88bd4f Clean up warnings in Gradle build 2025-03-07 16:58:52 +01:00
Sam Brannen 15a71f94fb Merge branch '6.2.x' 2025-03-07 13:38:50 +01:00
Vedran Pavic 94d29bac9f Fix typo in Spring MVC error responses documentation
Closes gh-34552

Signed-off-by: Vedran Pavic <vedran@vedranpavic.com>
2025-03-07 13:37:57 +01:00
Sébastien Deleuze 5bd03494d4 Merge branch '6.2.x' 2025-03-07 09:30:28 +01:00
Dmitry Sulman a6f3f18d89 Allow supertypes in ContentResultMatchersDsl matchers
Closes gh-34542
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-07 09:29:48 +01:00
Sébastien Deleuze fda9b9a696 Polishing
See gh-18353
2025-03-07 09:00:06 +01:00
Sébastien Deleuze bedc235bab Document programmatic bean registration
This commit adds the reference documentation for the new programmatic
bean registration capabilities for both Java and Kotlin.

Closes gh-18353
2025-03-06 19:15:56 +01:00
Sébastien Deleuze 682e2d6d84 Introduce BeanRegistrarDsl
This commit introduces a new BeanRegistrarDsl that supersedes
BeanDefinitionDsl which is now deprecated.

See BeanRegistrarDslConfigurationTests for a concrete example.

See gh-18353
2025-03-06 19:15:56 +01:00
Sébastien Deleuze 496be9ca98 Introduce first-class support for programmatic bean registration
This commit introduces a new BeanRegistrar interface that can be
implemented to register beans programmatically in a concise and
flexible way.

Those bean registrar implementations are typically imported with
an `@Import` annotation on `@Configuration` classes.

See BeanRegistrarConfigurationTests for a concrete example.

See gh-18353
2025-03-06 19:14:03 +01:00
Sam Brannen aeaf52ee96 Merge branch '6.2.x' 2025-03-06 17:32:49 +01:00
Sam Brannen 8334cb1abb Revise tests to better express intent 2025-03-06 17:32:32 +01:00
Sam Brannen e09cdcd920 Remove convention-based annotation attribute override support
This commit completely removes all support for convention-based
annotation attribute overrides in Spring's annotation utilities and the
MergedAnnotations infrastructure.

Composed annotations must now use @⁠AliasFor to declare explicit
overrides for attributes in meta-annotations.

See gh-28760
Closes gh-28761
2025-03-06 16:28:21 +01:00
Sam Brannen d722b9434e Merge branch '6.2.x' 2025-03-06 16:27:48 +01:00
Sam Brannen 2d88f18bf1 Update Javadoc 2025-03-06 16:26:40 +01:00
Sam Brannen 15a6641677 Clean up warnings in Gradle build 2025-03-06 16:26:32 +01:00
Juergen Hoeller 2a98b3137d Merge branch '6.2.x' 2025-03-06 15:45:18 +01:00
Juergen Hoeller 63c8e7cb5d Restore lenient matching of unresolved nested bound
Closes gh-34541
2025-03-06 15:44:12 +01:00
Sam Brannen 52e01bbb62 Merge branch '6.2.x' 2025-03-06 13:31:46 +01:00
Sam Brannen c5ecc50bfe Document wrapping behavior for TestExecutionListener callbacks
Closes gh-34422
2025-03-06 13:31:23 +01:00
Sam Brannen 0fd94f1b9f Polishing 2025-03-06 13:30:20 +01:00
Sam Brannen cd4e73a4a3 Fix typos in CloseStatus comments
Closes gh-34548
2025-03-06 10:26:07 +01:00
Juergen Hoeller a605f07100 Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/convert/support/GenericConversionService.java
2025-03-05 22:47:24 +01:00
Juergen Hoeller 2472126475 Add fallback to pre-6.2.3 behavior for unresolvable generics
Closes gh-34535
2025-03-05 22:45:22 +01:00
Juergen Hoeller f3b50c9a58 Ignore null beans in SimpleAutowireCandidateResolver.resolveAutowireCandidates
Closes gh-34543
2025-03-05 22:44:09 +01:00
Sam Brannen 5a0848b579 Merge branch '6.2.x' 2025-03-05 14:10:41 +01:00
Sam Brannen 0a6e666857 Ensure GenericTypeResolverTests compiles with Eclipse compiler 2025-03-05 14:07:52 +01:00
Juergen Hoeller 2fbd54078b Merge branch '6.2.x'
# Conflicts:
#	spring-webflux/src/main/java/org/springframework/web/reactive/resource/ResourceHandlerUtils.java
#	spring-webmvc/src/main/java/org/springframework/web/servlet/resource/ResourceHandlerUtils.java
2025-03-04 18:46:39 +01:00
Juergen Hoeller 403362fe3c Polishing 2025-03-04 18:44:56 +01:00
Juergen Hoeller 534f123fe8 Add explicit FileSystemResource path check for trailing slash
Closes gh-34509
2025-03-04 18:44:25 +01:00
Sam Brannen ca7ebd60ed Stop using deprecated ReflectionHintsPredicates.onMethod() on main 2025-03-04 11:21:37 +01:00
Sam Brannen 702c63a7e8 Merge branch '6.2.x' 2025-03-03 17:40:39 +01:00
Sam Brannen e421104cf3 Supply RuntimeHints to an AotContextLoader
This commit introduces a new loadContextForAotProcessing(...) variant
in AotContextLoader which accepts a RuntimeHints argument. This new
method is an interface default method which delegates to the existing
loadContextForAotProcessing(MergedContextConfiguration) variant for
backward compatibility.

In addition, the original loadContextForAotProcessing(...) variant is
now deprecated and has been converted to an interface default method
which throws an UnsupportedOperationException.

Note, however, that the framework now only invokes the new
loadContextForAotProcessing(...) variant within TestContextAotGenerator.

Closes gh-34513
2025-03-03 17:39:56 +01:00
Sam Brannen adfeba23e0 Polishing 2025-03-03 17:39:47 +01:00
Sam Brannen 955cc2039b Merge branch '6.2.x' 2025-03-03 15:05:11 +01:00
Sam Brannen 7789e12575 Polishing 2025-03-03 15:04:42 +01:00
Sam Brannen 5ffd88cd89 Remove deprecated rowsExpected property of SqlQuery
Closes gh-34530

Co-authored-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-03 14:45:22 +01:00
Sam Brannen e9345f16dc Merge branch '6.2.x' 2025-03-03 14:34:06 +01:00
Sam Brannen 30d793cefe Revise deprecation of SqlQuery.rowsExpected
Closes gh-34526
2025-03-03 14:33:19 +01:00
Yanming Zhou 78cc5df748 Deprecate unused "rowsExpected" property of SqlQuery for removal
See gh-34526

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-03 14:33:14 +01:00
Juergen Hoeller 3632c09348 Merge branch '6.2.x' 2025-03-03 13:34:14 +01:00
Juergen Hoeller 5ffaea7a43 Avoid JarURLConnection resource leak in AbstractFileResolvingResource.exists()
Closes gh-34528
2025-03-03 13:32:51 +01:00
Brian Clozel 84a57861d1 Merge branch '6.2.x' 2025-03-03 11:24:09 +01:00
Brian Clozel 1633ad24f3 Ignore nohttp check on buildSrc/build 2025-03-03 11:23:21 +01:00
Rhett CfZhuang 5faf2ed7f4 Fix missing Partitioned cookie support in reactive HTTP clients
This commit adds support for the Partitioned cookie attribute in the
reactive HTTP clients that support this: Reactor and HttpComponents.

Closes gh-34521

Signed-off-by: Rhett CfZhuang <dark.momo985@gmail.com>
[brian.clozel@broadcom.com: rework tests and support HttpComponents]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-03-03 11:23:13 +01:00
Sébastien Deleuze 7bc712e304 Upgrade NullAway to 0.12.4
This commit also slightly refines nullness but without
significant user-side impact expected.

Closes gh-34525
2025-03-03 08:45:54 +01:00
Sébastien Deleuze f7db4bf4f0 Fix a compilation warning in spring-webflux 2025-03-02 19:15:26 +01:00
Juergen Hoeller 533ecf0244 Merge branch '6.2.x' 2025-03-01 22:21:39 +01:00
Juergen Hoeller d2733cea36 Notify lenientCreationFinished condition after locked creation as well
Closes gh-34522
2025-03-01 22:20:23 +01:00
Sam Brannen 99d5e90b5e Merge branch '6.2.x' 2025-03-01 13:39:14 +01:00
Johnny Lim 108caea385 Use ORDER constant in MockitoResetTestExecutionListener
See gh-34404
Closes gh-34445

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-03-01 13:35:46 +01:00
rstoyanchev 788b66feac Remove UrlPathHelper in ServletWebSocketHandlerRegistry
See gh-34508
2025-02-28 16:20:38 +00:00
rstoyanchev 6a9783bb1a Merge branch '6.2.x' 2025-02-28 14:41:47 +00:00
rstoyanchev 7e9ac120ac Deprecate UrlPathHelper in ServletWebSocketHandlerRegistry
Closes gh-34508
2025-02-28 14:39:29 +00:00
Juergen Hoeller b610711235 Merge branch '6.2.x' 2025-02-28 14:15:36 +01:00
Juergen Hoeller c64dae3623 Avoid getTargetConnection call on transaction-aware Connection close
Closes gh-34484
2025-02-28 14:12:51 +01:00
Juergen Hoeller 559ea6c480 Defensively call isShutdown method for executor description
Closes gh-34514
2025-02-28 14:11:57 +01:00
Sébastien Deleuze fec0bfe6b3 Merge branch '6.2.x' 2025-02-28 12:06:30 +01:00
Tran Ngoc Nhan 34315fc20f Fix web and webflux reference links
Closes gh-34517
Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-02-28 12:06:11 +01:00
Juergen Hoeller 03cce13937 Merge branch '6.2.x' 2025-02-27 22:54:07 +01:00
Juergen Hoeller 3bb4795d43 Resolve variable bounds at outermost recursion level only
Closes gh-34504
2025-02-27 22:51:41 +01:00
Yanming Zhou 7f020118eb Polish JdbcTemplate to use getter instead of field
1. align with others in the same source file
2. allow subclass to override

Closes: gh-34501
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-02-27 19:11:14 +01:00
Brian Clozel 72afd4b9bd Merge branch '6.2.x' 2025-02-27 18:58:16 +01:00
Ryan Prayogo aae2952a32 Replace DefaultKeyGenerator with SimpleKeyGenerator
DefaultKeyGenerator has been deprecated and replaced with SimpleKeyGenerator

Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
2025-02-27 18:53:10 +01:00
rstoyanchev 33fef8df84 Merge branch '6.2.x' 2025-02-27 14:36:24 +00:00
rstoyanchev f62251aebd Avoid pathVar-requestParam name collision
Closes gh-34499
2025-02-27 14:34:26 +00:00
rstoyanchev f92f9c1d5b Fix handling of timeout in SseEmitter
Closes gh-34426
2025-02-27 14:34:26 +00:00
Brian Clozel 8a7d20f844 Upgrade Develocity and Foojay Gradle plugins 2025-02-27 15:02:07 +01:00
Brian Clozel f55fe79805 Remove Link to Jackson javadoc
The javadoc is not published by the team anymore and we should not link
to an outdated version.
2025-02-27 14:52:18 +01:00
Brian Clozel 68e9460e9b Revisit compiler configuration in project build
This commit revisit the build configuration to enforce the following:

* A single Java toolchain is used consistently with a recent Java
  version (here, Java 23) and language level
* the main source is compiled with the Java 17 "-release" target
* Multi-Release classes are compiled with their respective "-release"
  target. For now, only "spring-core" ships Java 21 variants.

Closes gh-34507
2025-02-27 14:39:43 +01:00
Sam Brannen 382caac37c Merge branch '6.2.x' 2025-02-26 15:45:09 +01:00
Sam Brannen 2b38c00656 Upgrade to Gradle 8.13
Closes gh-34495
2025-02-26 15:26:49 +01:00
Sam Brannen 5f98db6ffe Use new features introduced in JUnit Jupiter 5.11 and 5.12
See gh-34416
2025-02-26 15:18:16 +01:00
Juergen Hoeller fb77fcd922 Merge branch '6.2.x' 2025-02-26 10:33:19 +01:00
Juergen Hoeller 06721ba6c0 Lenient fallback when cached WeakReference returns null
Closes gh-34423
2025-02-26 10:24:24 +01:00
Brian Clozel a1410d98de Merge branch '6.2.x' 2025-02-25 17:19:01 +01:00
Brian Clozel b6a5402d88 Fix multiple Content-Language values in MockHttpServletResponse
Prior to this commit, `MockHttpServletResponse` would only support
adding a `Content-Language` once. Adding multiple header values would
always replace the content-language property in the response and the
entire header value.

This commit ensures that this behavior is supported.

Fixes gh-34488
2025-02-25 17:11:37 +01:00
Juergen Hoeller dc580740c0 Merge branch '6.2.x' 2025-02-25 16:21:09 +01:00
Juergen Hoeller aff9ac72ec Avoid unnecessary CGLIB processing on configuration classes
Closes gh-34486
2025-02-25 16:20:12 +01:00
Brian Clozel 466ac6b703 Improve SimpleKey hashing function
Prior to this commit, `SimpleKey` would be used in Spring Framework's
caching support and its `hashCode` value would be used to efficiently
store this key in data structures.

While the current hashcode strategy works, the resulting values don't
spread well enough when input keys are sequential (which is often the
case). This can have negative performance impacts, depending on the
data structures used by the cache implementation.

This commit improves the `hashCode` function with a mixer to better
spread the hash values. This is using the mixer function from the
MurMur3 hash algorithm.

Closes gh-34483
2025-02-25 16:09:01 +01:00
Brian Clozel 8b14bf86ef Merge branch '6.2.x' 2025-02-25 10:48:09 +01:00
Brian Clozel f895d762cd Remove duplicate Content-Type header in error cases
Prior to this commit, the `DispatcherServlet` would try and reset the
response buffer in case of errors, if the response is not committed
already. This allows for more flexible error handling, even if the
response was being handled already when it errored.

Resetting the response buffer clears the body but leaves HTTP response
headers intact. This is done on purpose as to not clear headers
previously added by Servlet Filters. By leaving in place some headers
like "Content-Type", this does not take into account the fact that the
response body was cleared and that error handling will perform another
round of content negotiation. While this isn't a problem for some
Servlet containers which enforce a single "Content-Type" header value,
this can cause multiple/duplicate values for some others.

This commit ensures that the "Content-Type" response header is removed
at the same time as we clear the "producible media types" attribute:
another pass of content negotiation will be performed for error
handling.

Fixes gh-34366
2025-02-25 10:43:19 +01:00
Brian Clozel 75329e6d9d Revisit MockHttpServletResponse for Servlet 6.1
This commit revisits the behavior of our `MockHttpServletResponse`
implementation with the javadoc clarifications applied in Servlet 6.1.

Prior to this change, adding or setting an HTTP response header with a
`null` name or value would not have the expected behavior:

* a `null` name should have no effect instead of throwing exceptions
* a `null` value when setting a header effectively removes the entry
  from the response headers

Also, this commit ensures that `IllegalStateException` are thrown if
`getWriter` is called after a previous `getOutputStream` (and vice
versa).

Closes gh-34467
2025-02-24 14:02:20 +01:00
Sam Brannen 34129f3f89 Upgrade to JUnit 5.12
Closes gh-34416
2025-02-23 17:38:04 +01:00
Juergen Hoeller 7c4594c014 Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/aot/hint/ResourceHints.java
#	spring-core/src/main/java/org/springframework/aot/hint/support/FilePatternResourceHintsRegistrar.java
2025-02-23 15:29:38 +01:00
Juergen Hoeller 634d1dd20b Consistent default ClassLoader fallback in hint classes
Closes gh-34470
2025-02-23 15:15:25 +01:00
Juergen Hoeller 1aea698088 Merge branch '6.2.x' 2025-02-23 14:04:31 +01:00
Juergen Hoeller 725b02a66d Ignore entries cache if no matching root entry path found
Closes gh-34446
2025-02-23 14:02:57 +01:00
Brian Clozel db5505d55a Merge branch '6.2.x' 2025-02-21 14:42:47 +01:00
Brian Clozel 5a0bd9e5d4 Fix null value support in ContentCachingResponseWrapper
Prior to this commit, calling `setHeader` on the response wrapper would
have a separate code path for the "Content-Length" header. This did not
support calls with `null` values and would result in an exception.

This commit ensures that the cached content length value is reset in
this case and that the call is forwarded properly to the superclass.

Fixes gh-34460
2025-02-21 14:33:03 +01:00
Brian Clozel 6dd73ae3e4 Handle null values in MockHttpServletResponse#setHeader
Prior to this commit, `MockHttpServletResponse#setHeader` would not
remove the header entry when given a `null` value, as documented in the
Servlet API.
This commit ensures that this behavior is enforced.

Fixes gh-34464
2025-02-21 14:23:12 +01:00
Sébastien Deleuze a08be368a2 Merge branch '6.2.x' 2025-02-21 11:33:15 +01:00
Gang Cheng 4606337180 Prevent hung uploads in MultipartParser
This commit adds an onRequest() hook to request more data from
the source in order to avoid hung uploads in MultipartParser.

Closes gh-34388
Signed-off-by: Gang Cheng <chenggangpro@gmail.com>
2025-02-21 11:32:54 +01:00
Brian Clozel a4d3977692 Remove unnecessary since tag in tests 2025-02-20 15:24:35 +01:00
Sébastien Deleuze 4ffbc4ea18 Merge branch '6.2.x' 2025-02-20 09:07:50 +01:00
Sébastien Deleuze f45a08d4f5 Remove BaseDefaultCodecs#synchronossMultipartPresent
Closes gh-34459
2025-02-20 09:07:26 +01:00
Sébastien Deleuze 5dc7425a8f Merge branch '6.2.x' 2025-02-19 16:41:13 +01:00
Sébastien Deleuze d62ce2969a Fix broken antora task
See https://github.com/spring-io/antora-extensions/pull/43

Closes gh-34454
2025-02-19 16:40:50 +01:00
Sébastien Deleuze e34899c06f Merge branch '6.2.x' 2025-02-19 13:58:47 +01:00
Johnny Lim ed3fd12210 Add missing @since tags in MockHttpServletRequestDsl
This commit adds missing `@since` tags for formField() and formFields in
MockHttpServletRequestDsl. See gh-34412 related issue.

Closes gh-34448
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-19 13:58:31 +01:00
Sébastien Deleuze 24cafbb0f5 Merge branch '6.2.x' 2025-02-19 13:45:35 +01:00
Vincent Potucek 6f596e2e84 Add a project icon for IntelliJ IDEA
The icon comes from https://spring.io/img/projects/spring-framework.svg.

Closes gh-34444
Signed-off-by: Vincent Potucek <vincent.potucek@sap.com>
2025-02-19 13:45:16 +01:00
Vincent Potucek 67d2635947 Sync checkstyle on buildSrc
Closes gh-34434
Signed-off-by: Vincent Potucek <vincent.potucek@sap.com>
2025-02-18 21:29:31 +01:00
Juergen Hoeller 63f6c33db6 Merge branch '6.2.x' 2025-02-18 20:45:34 +01:00
Juergen Hoeller 6786e1c3e5 Apply fallback in case of initial SmartClassLoader mismatch as well
See gh-34423
2025-02-18 20:40:13 +01:00
Juergen Hoeller 48aa94be46 Merge branch '6.2.x' 2025-02-18 15:18:01 +01:00
Juergen Hoeller 93134fd4d1 Apply fallback in case of any exception coming out of createClass
Closes gh-34423
2025-02-18 15:16:25 +01:00
Juergen Hoeller 2e4fbd1ff3 Merge branch '6.2.x' 2025-02-18 13:14:38 +01:00
Juergen Hoeller d0ceefedc6 Mark XML-configured executor/scheduler as infrastructure bean
Closes gh-34015
2025-02-18 13:13:34 +01:00
Juergen Hoeller e230ea537c Consistently resolve unique default candidate bean
Closes gh-34432
2025-02-18 13:11:36 +01:00
Juergen Hoeller 94eb6006e8 Leniently accept same singleton instance if implicitly appeared
Closes gh-34427
2025-02-18 13:01:08 +01:00
Sébastien Deleuze bc82077350 Merge branch '6.2.x' 2025-02-18 11:57:15 +01:00
Sébastien Deleuze 2576702cda Use public interface for HTTP Interface documentation
Closes gh-34443
2025-02-18 11:57:04 +01:00
Sébastien Deleuze 63ee6e6fe2 Merge branch '6.2.x' 2025-02-18 11:41:47 +01:00
Sébastien Deleuze 2099e046d3 Polishing
See gh-34439
2025-02-18 11:40:16 +01:00
Sébastien Deleuze 4dd83c814c Merge branch '6.2.x' 2025-02-18 11:28:35 +01:00
Sébastien Deleuze 2ee7a8e77a Add missing converters to DefaultRestClientBuilder
With this commit, DefaultRestClientBuilder configures the same
default converters than RestTemplate.

Closes gh-34439
2025-02-18 11:19:07 +01:00
Sébastien Deleuze b8d9dee7be Refine Kotlin serialization converters/codecs conditions
This commit is a follow-up of 34410 to refine the activation conditions
of Kotlin serialization converters/codecs.

Closes gh-34438
2025-02-17 18:40:05 +01:00
Sébastien Deleuze eae09637a1 Refine Kotlin serialization reference documentation
Closes gh-34437
2025-02-17 18:40:05 +01:00
Sébastien Deleuze 6bdb9bb950 Support open polymorphism with Kotlin Serialization
This commit introduces open polymorphism support with Kotlin
Serialization in HTTP converters and codecs as a follow-up of gh-34410
which considers Kotlin Serialization as a Jackson/Gson/Jsonb equivalent
(it is not anymore configured before Jackson).

Closes gh-34433
2025-02-17 18:40:05 +01:00
rstoyanchev d9100917d1 Refine onError handling WebAsyncManager
In addition to the wrapping of errors recognized as client disconnected
errors with AsyncRequestNotUsableException, we now wrap any IOException
in the onError callback. The Servlet container would only be aware of
such an exception if it relates to the response.

Closes gh-33832
2025-02-17 12:19:36 +00:00
Sébastien Deleuze 21604d1a25 Merge branch '6.2.x' 2025-02-16 12:10:59 +01:00
Johnny Lim 3c40e5e501 Add Javadoc since for HandlerMethod(HandlerMethod, Object, boolean)
See 56c4d2d

Closes gh-34431
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-16 12:10:01 +01:00
Sam Brannen fe41cd6d20 Merge branch '6.2.x' 2025-02-13 16:39:21 +01:00
Sam Brannen 9e45178202 Stop referring to "Java 8" in AnnotationUtils 2025-02-13 15:59:20 +01:00
Sam Brannen d82e70e345 Cross reference annotation search APIs in Javadoc
Closes gh-34421
2025-02-13 15:59:08 +01:00
Stéphane Nicoll e64243d8a1 Merge branch '6.2.x' 2025-02-13 14:19:17 +01:00
Stéphane Nicoll 1109892134 Next development version (v6.2.4-SNAPSHOT) 2025-02-13 14:19:02 +01:00
Sam Brannen 6868ff7dbe Merge branch '6.2.x' 2025-02-13 13:10:37 +01:00
Sam Brannen a8be11ebaf Upgrade to TestNG 7.11 2025-02-13 13:08:54 +01:00
Juergen Hoeller 9bc7229a1c Merge branch '6.2.x' 2025-02-12 23:07:37 +01:00
Juergen Hoeller dfc10c1a8d Wait for lenient bean creation in non-locked threads as well
Closes gh-34349
2025-02-12 23:06:22 +01:00
Juergen Hoeller 4d6947d14f Merge branch '6.2.x' 2025-02-12 19:20:01 +01:00
Juergen Hoeller bbb593db48 Consistently ignore non-jar files in classpath
Closes gh-34417
2025-02-12 19:18:30 +01:00
Sam Brannen 8df21109f2 Merge branch '6.2.x' 2025-02-12 17:50:22 +01:00
Sam Brannen b2134ee71f Avoid Gradle build warnings about @⁠SuppressFBWarnings from FindBugs
In order to avoid Gradle build warnings about @⁠SuppressFBWarnings, this
commit introduces a testCompileOnly dependency on `findbugs` in the
spring-webmvc module so that the class file for @⁠SuppressFBWarnings is
available to the compileTestJava task.

Closes gh-34418
2025-02-12 17:49:23 +01:00
Sam Brannen f42e886f03 Polishing 2025-02-12 17:10:22 +01:00
Sam Brannen de4db3812a Merge branch '6.2.x' 2025-02-12 16:46:58 +01:00
Sam Brannen 440a259b71 Clean up warnings in Gradle build 2025-02-12 16:46:41 +01:00
Sam Brannen 9eae0b6f6f Merge branch '6.2.x' 2025-02-12 16:32:05 +01:00
Sam Brannen 6174055910 Link to @⁠MockitoBean, @⁠MockitoSpyBean, & @⁠TestBean Javadoc from ref docs 2025-02-12 16:31:33 +01:00
Sam Brannen 8a53525209 Merge branch '6.2.x' 2025-02-12 15:55:33 +01:00
Sam Brannen e31ce359a1 Support @⁠MockitoSpyBean at the type level on test classes
Prior to this commit, @⁠MockitoSpyBean could only be declared on fields
within test classes, which prevented developers from being able to
easily reuse spy configuration across a test suite.

With this commit, @⁠MockitoSpyBean is now supported at the type level
on test classes, their superclasses, and interfaces implemented by
those classes. @⁠MockitoSpyBean is also supported on enclosing classes
for @⁠Nested test classes, their superclasses, and interfaces
implemented by those classes, while honoring @⁠NestedTestConfiguration
semantics.

In addition, @⁠MockitoSpyBean:

- has a new `types` attribute that can be used to declare the type or
  types to spy when @⁠MockitoSpyBean is declared at the type level

- can be declared as a repeatable annotation at the type level

- can be declared as a meta-annotation on a custom composed annotation
  which can be reused across a test suite (see the @⁠SharedSpies
  example in the reference manual)

To support these new features, this commit also includes the following
changes.

- MockitoSpyBeanOverrideProcessor has been revised to support
  @⁠MockitoSpyBean at the type level.

- The "Bean Overriding in Tests" and "@⁠MockitoBean and
  @⁠MockitoSpyBean" sections of the reference manual have been fully
  revised.

See gh-34408
Closes gh-33925
2025-02-12 15:54:54 +01:00
rstoyanchev 1fd6ded7a0 Polishing
Closes gh-34081
2025-02-12 11:48:27 +00:00
rstoyanchev 667004e5fa Update contribution
See gh-34081
2025-02-12 11:48:27 +00:00
m4tt30c91 ba74de997a Allow to set custom cookie parsers
Provides a way to be compliant with RFC 6265 section 4.1.1.

See gh-34081
2025-02-12 11:48:27 +00:00
rstoyanchev 011e398355 UriComponents formats Collection query param URI var
Closes gh-34311
2025-02-12 11:48:27 +00:00
Mengqi Xu 295a9565a3 Format Collection query param in UriComponentsBuilder
See gh-34311

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-02-12 11:48:27 +00:00
Juergen Hoeller b07ff1c2d4 Merge branch '6.2.x' 2025-02-12 12:17:54 +01:00
Juergen Hoeller b336bbe539 Wait for lenient bean creation in locked thread when necessary
Closes gh-34349
2025-02-12 12:17:02 +01:00
Sébastien Deleuze bb33a3efa3 Upgrade to Kotlin 2.1.10 2025-02-12 11:34:37 +01:00
Sébastien Deleuze 3956a36837 Merge branch '6.2.x' 2025-02-12 11:34:22 +01:00
Sébastien Deleuze 056757b493 Refine tests in MockMvcExtensionsTests
Closes gh-34412
2025-02-12 11:33:42 +01:00
Kevin Houtz 79c5fec1be Add form fields support to MockMvc Kotlin DSL
See gh-34412

Signed-off-by: Kevin Houtz <kevin@khoutz.com>
2025-02-12 11:33:29 +01:00
Brian Clozel 5c09435816 Fix warnings
See gh-34409
2025-02-12 08:48:04 +01:00
Brian Clozel 7271358ea4 Merge branch '6.2.x' 2025-02-11 22:34:49 +01:00
Brian Clozel 689782cbad Make ProblemDetail Serializable
This commit makes the `ProblemDetail` type implement `Serializable` in
order to be serialized and shared in distributed systems.

Closes gh-34409
2025-02-11 22:33:05 +01:00
Juergen Hoeller 39bd530461 Consistently use @Nullable annotation from JSpecify 2025-02-11 22:16:13 +01:00
Juergen Hoeller dce3f71b7d Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-02-11 22:11:45 +01:00
Juergen Hoeller 2df90e32c0 Upgrade to Netty 4.1.118 and Checkstyle 10.21.2 2025-02-11 22:10:15 +01:00
Juergen Hoeller f53da04717 Align with SmartClassLoader handling for AOP proxy classes
Closes gh-34274
2025-02-11 22:10:02 +01:00
Brian Clozel 7077809561 Configure Kotlin JSON converters as Jackson alternative
Prior to this commit, Spring MVC and WebFlux would consider the
"kotlinx.serialization" JSON codecs and converters in addition to other
JSON alternatives like Jackson, Gson and Jsonb.

This would cause issues because while in most cases this library is only
involved if the type is annotated with "@Serializable", this is not true
for Java enums. In this particular case, the codec shadows Jackson and
causes issues.

This commit now considers kotlinx.serialization JSON support as an
alternative to Jackson. Just like Jsonb and GSON, this is only
auto-detected if Jackson is not present.
We received consistent feedback that kotlinx.serialization is popular in
Kotlin libraries and is often a transitive dependency. As a result, we
cannot consider its presence on the classpath as a strong enough signal
to configure it by default.

Closes gh-34410
2025-02-11 20:05:53 +01:00
Sam Brannen 6ded25ba28 Merge branch '6.2.x' 2025-02-11 16:31:12 +01:00
Sam Brannen 124b38450b Remove unused code and improve assertion
See gh-34363
2025-02-11 16:30:52 +01:00
Sam Brannen e78e802647 Use JSpecify's @⁠Nullable on main 2025-02-11 16:17:32 +01:00
Sam Brannen 18e31fcfba Merge branch '6.2.x' 2025-02-11 16:12:32 +01:00
Sam Brannen b07217ab67 Use ConversionService to convert POJO to array for SpEL varargs invocations
Prior to this commit, if an appropriate Converter was registered with
the ConversionService that converts from a POJO to an array and that
ConversionService was registered with the Spring Expression Language
(SpEL) TypeConverter, an attempt to invoke a varargs method in a SpEL
expression with such a POJO would fail because the ConversionService
was not used to convert the POJO to an array suitable for the varargs
method invocation.

This commit revises the implementations of convertArguments(...) and
convertAllMethodHandleArguments(...) in ReflectionHelper to support
such use cases.

Closes gh-34371
2025-02-11 16:11:13 +01:00
Sam Brannen aa7e84c89f Polishing 2025-02-11 16:11:13 +01:00
Stéphane Nicoll 722701a451 Merge branch '6.2.x' 2025-02-11 16:01:09 +01:00
Stéphane Nicoll bd1c7b379f Merge pull request #34400 from canattofilipe
* pr/34400:
  Polish "Use correct method to retrieve DefaultListableBeanFactory"
  Use correct method to retrieve DefaultListableBeanFactory

Closes gh-34400
2025-02-11 16:01:04 +01:00
Stéphane Nicoll 6af19244a5 Polish "Use correct method to retrieve DefaultListableBeanFactory"
See gh-34400
2025-02-11 16:00:34 +01:00
canattofilipe 328dd71f6e Use correct method to retrieve DefaultListableBeanFactory
See gh-34400

Signed-off-by: canattofilipe <canattofilipe@gmail.com>
2025-02-11 15:57:01 +01:00
rstoyanchev e9d16da633 Remove Netty 5 support
Closes gh-34345
2025-02-11 12:27:33 +00:00
rstoyanchev bae12e739d Merge branch '6.2.x' 2025-02-11 11:18:23 +00:00
rstoyanchev d04883f839 HTTP Interface client handles query param with ":"
Closes gh-34364
2025-02-11 11:11:05 +00:00
rstoyanchev 9f55296049 Nested list/map/array with constructor binding
Closes gh-34305
2025-02-11 11:11:05 +00:00
rstoyanchev 4591a67641 Handle [] leniently in constructor binding
See gh-34305
2025-02-11 11:11:05 +00:00
Sam Brannen 85855ec793 Merge branch '6.2.x' 2025-02-11 11:57:48 +01:00
Sam Brannen 9797bc0acd Expose order values of TestExecutionListener implementations as constants
Prior to this commit, the order values of TestExecutionListener
implementations were hard-coded in their getOrder() methods.

To benefit users and integrators, this commit exposes those order values
as an ORDER constant in each TestExecutionListener.

See gh-34225
Closes gh-34404
2025-02-11 11:53:33 +01:00
Sam Brannen 9d3374b28d Finish incomplete sentences 2025-02-11 11:53:33 +01:00
Sam Brannen 09086fc648 Revise TestExecutionListener order values documentation
See gh-34265
2025-02-11 11:53:33 +01:00
Mengqi Xu 128e90064e Document order values for TestExecutionListener implementations
Closes gh-34265

Signed-off-by: Mengqi Xu <2663479778@qq.com>
2025-02-11 11:53:33 +01:00
Stéphane Nicoll 2f6d142ad7 Merge branch '6.2.x' 2025-02-11 11:41:02 +01:00
Stéphane Nicoll 16e3973118 Upgrade to Reactor 2024.0.3
Closes gh-34403
2025-02-11 11:36:47 +01:00
Stéphane Nicoll 5c37d07ad3 Upgrade to RSocket 1.1.5
Closes gh-34402
2025-02-11 10:39:21 +01:00
Stéphane Nicoll 12891d1975 Upgrade to Micrometer 1.14.4
Closes gh-34401
2025-02-11 10:34:33 +01:00
Sam Brannen 7557967f9e Stop using explicitly aliased value attribute as @⁠Component name
Prior to this commit, if a custom stereotype annotation was
meta-annotated with @⁠Component and declared a local String `value`
attribute that was explicitly configured (via @⁠AliasFor) as an
override for an attribute other than @⁠Component.value, the local
`value` attribute was still used as a convention-based override for
@⁠Component.value.

Consequently, a local `value` attribute was used as a custom
@⁠Component name, even when that is clearly not the intent.

To address that, this commit revises the logic in
AnnotationBeanNameGenerator so that a `value` attribute which is
explicitly aliased to something other than @⁠Component.value is no
longer used as an explicit @⁠Component name.

See gh-34317
Closes gh-34346
2025-02-10 18:21:29 +01:00
Juergen Hoeller 4ba14ca58c Merge branch '6.2.x' 2025-02-10 15:55:26 +01:00
Juergen Hoeller 1ca941ba9a Consistently resolve renamed type variables
Closes gh-34386
2025-02-10 15:51:39 +01:00
Sam Brannen b78d371746 Merge branch '6.2.x' 2025-02-10 13:30:30 +01:00
Sam Brannen 17a94fb110 Improve warning for unexpected use of value attribute as @⁠Component name
Prior to this commit, if a String 'value' attribute of an annotation
was annotated with @⁠AliasFor and explicitly configured to alias an
attribute other than @⁠Component.value, the value was still used as the
@⁠Component name, but the warning message that was logged stated that
the 'value' attribute should be annotated with
@⁠AliasFor(annotation=Component.class). However, it is not possible to
annotate an annotation attribute twice with @⁠AliasFor.

To address that, this commit revises the logic in
AnnotationBeanNameGenerator so that it issues a log message similar to
the following in such scenarios.

WARN o.s.c.a.AnnotationBeanNameGenerator - Although the 'value'
attribute in @⁠example.MyStereotype declares @⁠AliasFor for an
attribute other than @⁠Component's 'value' attribute, the value is
still used as the @⁠Component name based on convention. As of Spring
Framework 7.0, such a 'value' attribute will no longer be used as the
@⁠Component name.

See gh-34346
Closes gh-34317
2025-02-10 13:29:40 +01:00
Sam Brannen 2fcae65853 Polishing 2025-02-10 13:29:33 +01:00
rstoyanchev b0a1a11612 Merge branch '6.2.x' 2025-02-10 11:15:08 +00:00
rstoyanchev 7a0fe7d14f WebAsyncManager wraps disconnected client errors
If the Servlet container delegates a disconnected client error via
AsyncListener#onError, wrap it as AsyncRequestNotUsableException
for more targeted and consistent handling of such errors.

Closes gh-34363
2025-02-10 11:14:21 +00:00
rstoyanchev ccdaed594e Polishing contribution
Closes gh-34333
2025-02-10 11:14:21 +00:00
Branden Clark c41b0140cd Check hasNext on sessionIds in UserDestinationResult
See gh-34333

Signed-off-by: Branden Clark <brandenrayclark@gmail.com>
2025-02-10 11:14:21 +00:00
rstoyanchev ceffda7874 Polishing contribution
Closes gh-34362
2025-02-10 11:14:21 +00:00
Jared Wiltshire 49f9b40fba Support RFC 8441 upgrades over HTTP/2 CONNECT
See gh-34362

Signed-off-by: Jared Wiltshire <jazdw@users.noreply.github.com>
2025-02-10 11:14:21 +00:00
Sébastien Deleuze e49d2da443 Upgrade to Error Prone 2.36.0
Closes gh-34396
2025-02-10 12:09:19 +01:00
Sam Brannen e6f2f86f9f Merge branch '6.2.x' 2025-02-10 11:49:50 +01:00
Sam Brannen d59991fcc9 Revise contribution
See gh-34006
2025-02-10 11:42:24 +01:00
Yanming Zhou cf46f391d7 Improve diagnostics when a Bean Override cannot be selected by type
See gh-34004
Closes gh-34006

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-02-10 11:06:10 +01:00
Sam Brannen 1a29fbda48 Restore @⁠Nullable on AnnotatedElementUtils.getAllAnnotationAttributes(...)
Closes gh-34394
2025-02-10 10:52:32 +01:00
Brian Clozel 6d63abd4e9 Merge branch '6.2.x' 2025-02-10 09:24:44 +01:00
Andras Dobrosi 2b4c7d09b0 Match ContentDisposition attributes case-insensitively
This commit ensures that `ContentDisposition` parses attributes like
"filename" and "filename*" in a case insensitive fashion, per RFC 6266.

Closes gh-34383

Signed-off-by: Andras Dobrosi <dobrosi@gmail.com>
[brian.clozel@broadcom.com: apply code conventions]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-02-10 09:21:02 +01:00
Sam Brannen e81fcc34de Merge branch '6.2.x' 2025-02-09 11:40:02 +01:00
Johnny Lim 61138698c6 Fix copyright end year in ServerResponseResultHandler
See https://github.com/spring-projects/spring-framework/commit/1cea1fe962cc95544fce7be8fd2f56419e89aaaf#diff-fa20069f0305b5aee07bf90a7f8d0502a6ee139892639b7dfe470b54c3a8574aL2-R2

See gh-34066
Closes gh-34391

Signed-off-by: Johnny Lim <izeye@naver.com>
2025-02-09 11:38:24 +01:00
Brian Clozel 11a1858e79 Merge branch '6.2.x' 2025-02-08 16:20:38 +01:00
Daeho Kwon 3548e872b9 Fix deprecation warnings in RuntimeHintsAgentPlugin
Closes gh-34390

Signed-off-by: Daeho Kwon <trewq231@naver.com>
2025-02-08 16:19:26 +01:00
Sam Brannen 68fcf81c4d Merge branch '6.2.x' 2025-02-08 13:33:39 +01:00
Sam Brannen 305686dbf7 Ensure Bean Overrides are discovered once in @⁠Nested hierarchies
Changes made to the Bean Override search algorithms in commit
9181cce65f resulted in a regression that caused tests to start failing
due to duplicate BeanOverrideHandlers under the following circumstances.

- An enclosing class (typically a top-level test class) declares a
  @⁠BeanOverride such as @⁠MockitoBean.

- An inner class is declared in that enclosing class.

- A @⁠Nested test class which extends that inner class is declared in
  the same enclosing class.

The reason for the duplicate detection is that the current search
algorithm visits the common enclosing class twice.

To address that, this commit revises the search algorithm in
BeanOverrideHandler so that enclosing classes are only visited once.

See gh-33925
Closes gh-34324
2025-02-08 13:30:22 +01:00
Juergen Hoeller 3fff3b8a6d Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/SimpleAutowireCandidateResolver.java
#	spring-core/src/main/java/org/springframework/core/convert/TypeDescriptor.java
2025-02-07 19:03:37 +01:00
Juergen Hoeller ace2f0a3e5 Expose resolveAutowireCandidates method with basic candidate filtering
DependencyObjectProvider is aligned to check basic autowire-candidate status even in case of custom filtering.

Closes gh-34203
2025-02-07 19:00:25 +01:00
Juergen Hoeller 1a573d6e3c Lazily retrieve TypeDescriptor annotations on demand
Closes gh-33948
2025-02-07 18:55:24 +01:00
Sam Brannen bd9ae6bd2a Merge branch '6.2.x' 2025-02-07 18:34:07 +01:00
Sam Brannen bb7a8006c5 Fix @⁠Nullable declaration in DataBinder on 6.2.x 2025-02-07 18:33:03 +01:00
Sam Brannen a09f454dfc Merge branch '6.2.x' 2025-02-07 18:27:34 +01:00
Sam Brannen ba56c1a8f4 Fix copy-n-paste error 2025-02-07 18:26:26 +01:00
Sam Brannen cf1d274baa Merge branch '6.2.x' 2025-02-07 18:11:01 +01:00
Sam Brannen 9107f7b592 Honor @⁠Primary before fallback qualifier for Bean Overrides
Prior to this commit, test bean overrides (for example, @⁠MockitoBean,
@⁠TestBean, etc.) eagerly honored the name of the annotated field as a
fallback qualifier, effectively ignoring @⁠Primary and @⁠Fallback
semantics for certain use cases.

This led to situations where a bean override for a test would select a
different bean than the core container would for the same autowiring
metadata.

To address that, this commit revises the implementation of
BeanOverrideBeanFactoryPostProcessor so that @⁠Primary and @⁠Fallback
semantics are consistently honored before attempting to use the
annotated field's name as a fallback qualifier.

Closes gh-34374
2025-02-07 18:06:52 +01:00
rstoyanchev 55a090602b Merge branch '6.2.x' 2025-02-07 13:23:14 +00:00
rstoyanchev 1d7cb4fc13 Defer initialization of HandlerMethod validation flags
Re-create the HandlerMethod only after the original is used as a key
in the CORS lookup map.

Closes gh-34379
2025-02-07 13:20:16 +00:00
rstoyanchev 84992536c5 Defer initialization of HandlerMethod validation flags
Re-create the HandlerMethod only after the original is used as a key
in the CORS lookup map.

Closes gh-34375
2025-02-07 13:10:55 +00:00
rstoyanchev ff49b0b683 Align AnnotatedMethod#equals and #hashcode
See gh-34375
2025-02-07 13:10:55 +00:00
rstoyanchev 56c4d2d4ca Improve HandlerMethod#resolvedFromHandlerMethod initialization
Ensure the original instance is always the one returned no matter how
many times the HandlerMethod is re-created.

Make the constructor protected to allow subclasses to re-create the
HandlerMethod as the concrete subclass.

See gh-34375
2025-02-07 13:10:55 +00:00
Brian Clozel 0c739016d4 Merge branch '6.2.x' 2025-02-06 18:33:42 +01:00
Brian Clozel 174d0e4576 Fix "Nth day of week" Quartz-style cron expressions
Prior to this commit, `CronExpression` would support Quartz-style
expressions with "Nth occurence of a  dayOfWeek" semantics by using the
`TemporalAdjusters.dayOfWeekInMonth` JDK support. This method will
return the Nth occurence starting with the month of the given temporal,
but in some cases will overflow to the next or previous month.
This behavior is not expected for our cron expression support.

This commit ensures that when an overflow happens (meaning, the
resulting date is not in the same month as the input temporal), we
should instead have another attempt at finding a valid month for this
expression.

Fixes gh-34360
2025-02-06 18:27:07 +01:00
Sébastien Deleuze 262ce16bb4 Upgrade to Kotlin Serialization 1.8
Closes gh-34378
2025-02-06 17:42:19 +01:00
Sébastien Deleuze 66b3a94376 Upgrade to Kotlin Coroutines 1.10
Closes gh-34376
2025-02-06 17:41:44 +01:00
Brian Clozel e8f71ab5ef Simplify HttpHeaders constructor
As of gh-33913, `HttpHeaders` does not implement the `MultiValueMap`
contract anymore, so we can take this opportunity to simplify one of the
constructors to not consider that the argument could be an `HttpHeaders`
instance. This case is already covered by the other constructor.

See gh-33913
2025-02-06 14:37:16 +01:00
Bryce J. Fisher 2a846c9594 Add HttpHeaders.copyOf factory method
Prior to this commit, the `HttpHeaders` class would provide constructor
variants where the instances are are backed by the existing headers
collection given as a parameter.

While such constructors are clearly documented and meant for internal
usage, there are cases where developers would like to copy the data from
an existing headers instance without being backed by the same collection
instance and thus, being mutated from some place else.

This commit introduces new factory methods `HttpHeaders.copyOf` for this
purpose. While this name aligns with some of the Java collections
factory methods, in this case the returned instance is not immutable, on
purpose. `HttpHeaders` does not extends `MultiValueMap` anymore and
shouldn't be seen as such.

Closes: gh-34341

Signed-off-by: Bryce J. Fisher <bryce.fisher@gmail.com>
[brian.clozel@broadcom.com: reduce scope and update javadoc]
Signed-off-by: Brian Clozel <brian.clozel@broadcom.com>
2025-02-06 14:24:41 +01:00
Sébastien Deleuze 7695be0079 Merge branch '6.2.x' 2025-02-06 09:19:42 +01:00
Sébastien Deleuze dba4881318 Refine the CGLIB error message with native
See gh-34370
2025-02-06 09:18:51 +01:00
Sébastien Deleuze e44a3eb39a Merge branch '6.2.x' 2025-02-05 17:47:58 +01:00
Sébastien Deleuze 16ec08aec8 Provide a more actionable CGLIB error message with native
Closes gh-34370
2025-02-05 17:47:25 +01:00
rstoyanchev 03984bacf4 Merge branch '6.2.x' 2025-02-05 14:34:11 +00:00
rstoyanchev 462c2bd538 Enhance constructor binding for List/Map/Array
Support List/Map/Array of simple values, or values supported
by type conversion.

Closes gh-34305
2025-02-05 14:26:12 +00:00
rstoyanchev 7f29f0e663 Revert commit 3505c4bcad
The fix did not address the issue. It only made the constructor not
fail with tests succeeding due to setter binding instead.

See gh-34043
2025-02-05 14:26:12 +00:00
rstoyanchev 3898482d3f Revert commit 0f38c28e91
The fix is not how the issue needs to be addressed.

See gh-34121
2025-02-05 14:26:12 +00:00
rstoyanchev bb7ce21076 Expose Locale to method validation in WebFlux
Closes gh-33810
2025-02-05 14:26:12 +00:00
Stéphane Nicoll 49bd8333e8 Merge branch '6.2.x' 2025-02-05 14:42:42 +01:00
Stéphane Nicoll fd4dee7ce3 Merge pull request #34183 from remeio
* pr/34183:
  Polish "Add support for multidimensional arrays"
  Add support for multidimensional arrays

Closes gh-34183
2025-02-05 14:42:35 +01:00
Stéphane Nicoll ec037b1ec0 Polish "Add support for multidimensional arrays"
See gh-34183
2025-02-05 14:35:33 +01:00
xumengqi 68c1e2ac92 Add support for multidimensional arrays
See gh-34183
2025-02-05 14:23:09 +01:00
Sam Brannen e997e16cd1 Merge branch '6.2.x' 2025-02-05 13:43:46 +01:00
Sam Brannen 819a7c86c1 Clarify component scanning of abstract classes with @⁠Lookup methods
Due to changes in gh-19118, classes that contain @⁠Lookup methods are
no longer required to be concrete classes for use with component
scanning; however, the reference documentation still states that such
classes must not be abstract.

This commit therefore removes the outdated reference documentation and
updates the corresponding Javadoc.

See gh-19118
Closes gh-34367
2025-02-05 13:39:29 +01:00
Stéphane Nicoll fce0389e23 Merge branch '6.2.x' 2025-02-05 11:53:30 +01:00
Stéphane Nicoll 9c1346d240 Merge pull request #34316 from JoshuaChen
* pr/34316:
  Polish "Handle arbitrary JoinPoint argument index"
  Handle arbitrary JoinPoint argument index

Closes gh-34316
2025-02-05 11:50:35 +01:00
Stéphane Nicoll fb6e86551a Polish "Handle arbitrary JoinPoint argument index"
See gh-34316
2025-02-05 11:49:56 +01:00
Joshua Chen 13ba770428 Handle arbitrary JoinPoint argument index
See gh-34316

Signed-off-by: Joshua Chen <27291761@qq.com>
2025-02-05 11:44:51 +01:00
Stéphane Nicoll 3c4d535723 Merge branch '6.2.x' 2025-02-04 16:01:45 +01:00
Stéphane Nicoll a4d99d6201 Merge pull request #33957 from anaconda875
* pr/33957:
  Polish "Use proper return type in AsyncExecutionInterceptor"
  Use proper return type in AsyncExecutionInterceptor

Closes gh-33957
2025-02-04 16:01:38 +01:00
Stéphane Nicoll 3923150dad Polish "Use proper return type in AsyncExecutionInterceptor"
See gh-33957
2025-02-04 15:59:35 +01:00
Bao.Ngo 8eb24458f8 Use proper return type in AsyncExecutionInterceptor
See gh-33957
2025-02-04 15:58:53 +01:00
Stéphane Nicoll 0db2c7d40c Merge pull request #33729 from dssievewright
* pr/33729:
  Polish "Prevent further configuration once SqlCall is compiled"
  Prevent further configuration once SqlCall is compiled

Closes gh-33729
2025-02-04 15:46:48 +01:00
Stéphane Nicoll 35dea59ce4 Polish "Prevent further configuration once SqlCall is compiled"
See gh-33729
2025-02-04 15:45:18 +01:00
Dan Sievewright 8810913f30 Prevent further configuration once SqlCall is compiled
This commit prevents AbstractJdbcCall to be further configured once it
is compiled.

See gh-33729
2025-02-04 15:43:01 +01:00
Juergen Hoeller 83ab71725f Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/PropertyEditorRegistrySupport.java
2025-02-04 13:31:37 +01:00
Juergen Hoeller cda7e98643 Lazily override default editors when actually needed
Closes gh-34361
2025-02-04 13:26:16 +01:00
Stéphane Nicoll dfe6dc1ee5 Merge branch '6.2.x' 2025-02-04 09:30:02 +01:00
Stéphane Nicoll e92809d470 Update CI actions 2025-02-04 09:29:51 +01:00
rstoyanchev ecf75f2f40 Merge branch '6.2.x' 2025-02-03 15:31:32 +00:00
rstoyanchev f477c1653d Allow WebSocket over HTTP CONNECT
Closes gh-34044
2025-02-03 15:28:27 +00:00
rstoyanchev 1cea1fe962 Polishing contribution
Closes gh-34066
2025-02-03 15:15:21 +00:00
Tarek Mues 8b07f93620 Add getters ServerResponseResultHandler
See gh-34066
2025-02-03 15:11:47 +00:00
Pierre Rossato a9ecf90524 Minor update in WebSocket STOMP documentation
Closes gh-34353

Signed-off-by: Pierre Rossato <pierre.rossato@gmail.com>
2025-02-03 15:10:32 +00:00
Daeho Kwon 7536777a18 Replace hardcoded "Sec-WebSocket-Version" with constant
Closes gh-34319

Signed-off-by: Daeho Kwon <trewq231@naver.com>
2025-02-03 15:06:28 +00:00
Juergen Hoeller 088d53adb4 Merge branch '6.2.x' 2025-02-03 15:24:59 +01:00
Juergen Hoeller 1b18928bf0 Explicitly set custom ClassLoader on CGLIB Enhancer
Closes gh-34274
2025-02-03 15:23:51 +01:00
Juergen Hoeller 8c2b44bd6c Support filtered/unfiltered stream access on ObjectProvider
Closes gh-34318
Closes gh-34203
2025-02-03 15:04:27 +01:00
Juergen Hoeller ecc7ddd96b Merge branch '6.2.x' 2025-01-31 22:28:50 +01:00
Juergen Hoeller 2df8ea94e0 Clean root entry path to match jar entries format in cache
Closes gh-34348
2025-01-31 22:26:14 +01:00
Juergen Hoeller 121be15004 Merge branch '6.2.x' 2025-01-31 15:17:44 +01:00
Juergen Hoeller 323e52b5a9 Continue with pre-instantiation when current bean is in creation already
Closes gh-34349
2025-01-31 15:16:52 +01:00
Juergen Hoeller 7405e20690 Merge branch '6.2.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/ResolvableType.java
2025-01-30 15:38:09 +01:00
Juergen Hoeller ed994dcd97 Resolve bounds for type variable before emptiness check
Closes gh-34328
2025-01-30 15:35:14 +01:00
Juergen Hoeller 4c3b435d23 Enforce exact match for bounds of nested type variable
Closes gh-34300
2025-01-30 15:34:55 +01:00
Sébastien Deleuze 4620d864dd Refine GenericApplicationContext#registerBean nullness
Closes gh-34343
2025-01-30 12:26:31 +01:00
Johnny Lim 042b78f609 Fix Javadoc @code tags
Signed-off-by: Johnny Lim <izeye@naver.com>
2025-01-30 13:33:42 +09:00
Brian Clozel d4030a87e2 Merge branch '6.2.x' 2025-01-29 18:28:52 +01:00
Brian Clozel cfe2db0581 Improve reference docs on RestClient.retrieve()
As of Spring Framework 6.2, the `RestClient.retrieve()` method is a
no-op and developers must invoke a terminal operation on the returned
`ResponseSpec` to have any side effect.

This has been documented in the Javadoc and the wiki release notes, but
this commit highlights this as well in the reference documentation.

Closes gh-34334
2025-01-29 18:26:12 +01:00
Sam Brannen 7a98e210da Remove obsolete code
See gh-34331
2025-01-29 18:06:28 +01:00
Sam Brannen 38bdf0cd27 Merge branch '6.2.x' 2025-01-29 17:52:42 +01:00
Sam Brannen 53afe27109 Clean up warnings in Gradle build
See gh-34332
2025-01-29 17:52:27 +01:00
Sam Brannen c9f12aa804 Merge branch '6.2.x' 2025-01-29 17:40:49 +01:00
Sam Brannen b9e43d05bd Restore property binding support for a Map that implements Iterable
The changes in commit c20a2e4763 introduced a regression with regard to
binding to a Map property when the Map also happens to implement
Iterable.

Although that is perhaps not a very common scenario, this commit
reorders the if-blocks in AbstractNestablePropertyAccessor's
getPropertyValue(PropertyTokenHolder) method so that a Map is
considered before an Iterable, thereby allowing an Iterable-Map to be
accessed as a Map.

See gh-907
Closes gh-34332
2025-01-29 17:34:47 +01:00
Brian Clozel a853e94810 Merge branch '6.2.x' 2025-01-29 16:15:16 +01:00
Brian Clozel d80de043ce Fix filtered HTTP headers in data binding
Prior to this commit, several common HTTP headers were ignored from the
data binding process when collecting property values, in gh-34039 and
gh-34182.

This commit completes the initial enhancement by ensuring that the
default header predicate is also considering cases where constructor
binding is applied and the Java type has a lowercase variant of the HTTP
header name to filter.

Fixes gh-34292
2025-01-29 16:06:19 +01:00
Brian Clozel 7c5b6f1e1c Delete failing Freemarker test
This test was already ignored as of Java 21 because of a Java behavior
change, and now it started failing as of 17.0.14.
This commit removes the test entirely.
2025-01-29 15:55:58 +01:00
rstoyanchev f5b5f9a639 Fix forwarded host formatting
Follow-up to recent commit
75e2e2c3c7

Closes gh-34253
2025-01-28 15:53:14 +00:00
rstoyanchev 83cdd58ac8 Update localAddress handling in StandardWebSocketClient
Closes gh-34331
2025-01-28 15:49:58 +00:00
rstoyanchev 52c187bf64 Merge branch '6.2.x' 2025-01-28 15:37:38 +00:00
rstoyanchev a6b6d19545 Update localAddress Javadoc in WebSocketSession
Closes gh-34304
2025-01-28 15:36:26 +00:00
rstoyanchev 9b58df8857 Update HandlerMethod#createWithResolvedBean
Avoid re-creating the instance unless it is a bean name that
needs to be resolved through the BeanFactory.

Closes gh-34277
2025-01-28 15:36:26 +00:00
rstoyanchev 1cc767e90b Polishing in ExtendedServletRequestDataBinder 2025-01-28 15:36:19 +00:00
Sébastien Deleuze db3c2b39b1 Remove HttpHeaders#asMultiValueMap usages from Kotlin tests
Closes gh-34327
2025-01-27 15:57:54 +01:00
Sam Brannen 36cd069c6e Exclude spring-jcl from nohttp check on main branch
The spring-jcl module no longer exists on main, but it still exists on
the 6.2.x branch and previous branches and can cause build failures when
switching between branches.
2025-01-27 15:33:43 +01:00
Sam Brannen 5574f45cb1 Merge branch '6.2.x' 2025-01-27 15:22:10 +01:00
Sam Brannen 34d6dd9b62 Polishing 2025-01-27 15:19:00 +01:00
Sébastien Deleuze 1167b30b3f Merge branch '6.2.x' 2025-01-27 15:07:59 +01:00
Sébastien Deleuze 5499878de0 Support properties in kotlinx.serialization converters
This commit adds support for Kotlin properties in Spring WebMVC
controllers, supported for reasons explained in gh-31856, with
kotlinx.serialization converters.

Closes gh-34284
2025-01-27 15:06:57 +01:00
Sébastien Deleuze a970fc16aa Support properties in kotlinx.serialization codecs
This commit adds support for Kotlin properties in Spring WebFlux
controllers, supported for reasons explained in gh-31856, with
kotlinx.serialization codecs.

See gh-34284
2025-01-27 15:06:50 +01:00
Sam Brannen 86b04b7b69 Merge branch '6.2.x' 2025-01-24 15:34:10 +01:00
Sam Brannen 683733a682 Link to AspectJ "runtime-api" Javadoc site
The AspectJ team has confirmed that the following Javadoc site hosts
the latest version (currently 1.9.22.1) of the runtime API for AspectJ,
generated with a modern version of the javadoc tool which generates the
element-list file required by the Spring Framework build.

https://eclipse.dev/aspectj/doc/latest/runtime-api/

See https://github.com/eclipse-aspectj/aspectj/issues/321
See gh-34293
2025-01-24 15:33:24 +01:00
9744 changed files with 159210 additions and 66318 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ inputs:
java-version:
description: 'Java version to compile and test with'
required: false
default: '17'
default: '25'
publish:
description: 'Whether to publish artifacts ready for deployment to Artifactory'
required: false
@@ -15,7 +15,7 @@ runs:
using: composite
steps:
- name: Generate Changelog
uses: spring-io/github-changelog-generator@185319ad7eaa75b0e8e72e4b6db19c8b2cb8c4c1 #v0.0.11
uses: spring-io/github-changelog-generator@86958813a62af8fb223b3fd3b5152035504bcb83 #v0.0.12
with:
config-file: .github/actions/create-github-release/changelog-generator.yml
milestone: ${{ inputs.milestone }}
@@ -1,6 +1,13 @@
changelog:
repository: spring-projects/spring-framework
sections:
- title: ":warning: Attention Required"
labels:
- "for: upgrade-attention"
summary:
mode: "member-comment"
config:
prefix: "Attention Required:"
- title: ":star: New Features"
labels:
- "type: enhancement"
@@ -19,19 +19,20 @@ inputs:
java-version:
description: 'Java version to use for the build'
required: false
default: '17'
default: '25'
runs:
using: composite
steps:
- name: Set Up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: ${{ inputs.java-early-access == 'true' && 'temurin' || (inputs.java-distribution || 'liberica') }}
java-version: |
${{ inputs.java-early-access == 'true' && format('{0}-ea', inputs.java-version) || inputs.java-version }}
${{ inputs.java-toolchain == 'true' && '17' || '' }}
25
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
cache-read-only: false
develocity-access-key: ${{ inputs.develocity-access-key }}
@@ -1,18 +1,15 @@
name: Sync to Maven Central
description: 'Syncs a release to Maven Central and waits for it to be available for use'
inputs:
central-token-password:
description: 'Password for authentication with central.sonatype.com'
required: true
central-token-username:
description: 'Username for authentication with central.sonatype.com'
required: true
jfrog-cli-config-token:
description: 'Config token for the JFrog CLI'
required: true
ossrh-s01-staging-profile:
description: 'Staging profile to use when syncing to Central'
required: true
ossrh-s01-token-password:
description: 'Password for authentication with s01.oss.sonatype.org'
required: true
ossrh-s01-token-username:
description: 'Username for authentication with s01.oss.sonatype.org'
required: true
spring-framework-version:
description: 'Version of Spring Framework that is being synced to Central'
required: true
@@ -20,23 +17,17 @@ runs:
using: composite
steps:
- name: Set Up JFrog CLI
uses: jfrog/setup-jfrog-cli@dff217c085c17666e8849ebdbf29c8fe5e3995e6 # v4.5.2
uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1
env:
JF_ENV_SPRING: ${{ inputs.jfrog-cli-config-token }}
- name: Download Release Artifacts
shell: bash
run: jf rt download --spec ${{ format('{0}/artifacts.spec', github.action_path) }} --spec-vars 'buildName=${{ format('spring-framework-{0}', inputs.spring-framework-version) }};buildNumber=${{ github.run_number }}'
- name: Sync
uses: spring-io/nexus-sync-action@42477a2230a2f694f9eaa4643fa9e76b99b7ab84 # v0.0.1
uses: spring-io/central-publish-action@0c03960e9b16fdfe70e2443e1d5393cbc3a35622 # v0.3.0
with:
close: true
create: true
generate-checksums: true
password: ${{ inputs.ossrh-s01-token-password }}
release: true
staging-profile-name: ${{ inputs.ossrh-s01-staging-profile }}
upload: true
username: ${{ inputs.ossrh-s01-token-username }}
token: ${{ inputs.central-token-password }}
token-name: ${{ inputs.central-token-username }}
- name: Await
uses: ./.github/actions/await-http-resource
with:
+2 -2
View File
@@ -18,9 +18,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Set up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'liberica'
java-version: 17
@@ -13,7 +13,7 @@ jobs:
timeout-minutes: 60
steps:
- name: Check Out Code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build and Publish
id: build-and-publish
uses: ./.github/actions/build
@@ -21,13 +21,13 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
publish: true
- name: Deploy
uses: spring-io/artifactory-deploy-action@dc1913008c0599f0c4b1fdafb6ff3c502b3565ea # v0.0.2
uses: spring-io/artifactory-deploy-action@926d7f7cc810569395346bf3a4d91b380b3e355b # v0.0.4
with:
artifact-properties: |
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
/**/framework-api-*-docs.zip::zip.type=docs
/**/framework-api-*-schema.zip::zip.type=schema
build-name: 'spring-framework-7.0.x'
build-name: 'spring-framework-7.1.x'
folder: 'deployment-repository'
password: ${{ secrets.ARTIFACTORY_PASSWORD }}
repository: 'libs-snapshot-local'
+2 -2
View File
@@ -10,7 +10,7 @@ jobs:
timeout-minutes: 60
steps:
- name: Check Out Code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
id: build
uses: ./.github/actions/build
@@ -19,7 +19,7 @@ jobs:
uses: ./.github/actions/print-jvm-thread-dumps
- name: Upload Build Reports
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-reports
path: '**/build/reports/'
+2 -2
View File
@@ -20,7 +20,7 @@ jobs:
toolchain: false
- version: 21
toolchain: true
- version: 23
- version: 25
toolchain: true
exclude:
- os:
@@ -35,7 +35,7 @@ jobs:
git config --global core.longPaths true
Stop-Service -name Docker
- name: Check Out Code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build
id: build
uses: ./.github/actions/build
+1 -1
View File
@@ -19,7 +19,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 1
ref: docs-build
+9 -10
View File
@@ -2,8 +2,8 @@ name: Release Milestone
on:
push:
tags:
- v7.0.0-M[1-9]
- v7.0.0-RC[1-9]
- v7.1.0-M[1-9]
- v7.1.0-RC[1-9]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
@@ -13,7 +13,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build and Publish
id: build-and-publish
uses: ./.github/actions/build
@@ -21,7 +21,7 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
publish: true
- name: Stage Release
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
uses: spring-io/artifactory-deploy-action@926d7f7cc810569395346bf3a4d91b380b3e355b # v0.0.4
with:
artifact-properties: |
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
@@ -57,14 +57,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v6
- name: Sync to Maven Central
uses: ./.github/actions/sync-to-maven-central
with:
central-token-password: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
central-token-username: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
jfrog-cli-config-token: ${{ secrets.JF_ARTIFACTORY_SPRING }}
ossrh-s01-staging-profile: ${{ secrets.OSSRH_S01_STAGING_PROFILE }}
ossrh-s01-token-password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
ossrh-s01-token-username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
spring-framework-version: ${{ needs.build-and-stage-release.outputs.version }}
promote-release:
name: Promote Release
@@ -74,7 +73,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@dff217c085c17666e8849ebdbf29c8fe5e3995e6 # v4.5.2
uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote build
@@ -87,7 +86,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v6
- name: Create GitHub Release
uses: ./.github/actions/create-github-release
with:
+8 -9
View File
@@ -2,7 +2,7 @@ name: Release
on:
push:
tags:
- v7.0.[0-9]+
- v7.1.[0-9]+
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
jobs:
@@ -12,7 +12,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@v4
uses: actions/checkout@v6
- name: Build and Publish
id: build-and-publish
uses: ./.github/actions/build
@@ -20,7 +20,7 @@ jobs:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
publish: true
- name: Stage Release
uses: spring-io/artifactory-deploy-action@26bbe925a75f4f863e1e529e85be2d0093cac116 # v0.0.1
uses: spring-io/artifactory-deploy-action@926d7f7cc810569395346bf3a4d91b380b3e355b # v0.0.4
with:
artifact-properties: |
/**/framework-api-*.zip::zip.name=spring-framework,zip.deployed=false
@@ -56,14 +56,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v6
- name: Sync to Maven Central
uses: ./.github/actions/sync-to-maven-central
with:
central-token-password: ${{ secrets.CENTRAL_TOKEN_PASSWORD }}
central-token-username: ${{ secrets.CENTRAL_TOKEN_USERNAME }}
jfrog-cli-config-token: ${{ secrets.JF_ARTIFACTORY_SPRING }}
ossrh-s01-staging-profile: ${{ secrets.OSSRH_S01_STAGING_PROFILE }}
ossrh-s01-token-password: ${{ secrets.OSSRH_S01_TOKEN_PASSWORD }}
ossrh-s01-token-username: ${{ secrets.OSSRH_S01_TOKEN_USERNAME }}
spring-framework-version: ${{ needs.build-and-stage-release.outputs.version }}
promote-release:
name: Promote Release
@@ -73,7 +72,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Set up JFrog CLI
uses: jfrog/setup-jfrog-cli@dff217c085c17666e8849ebdbf29c8fe5e3995e6 # v4.5.2
uses: jfrog/setup-jfrog-cli@5b06f730cc5a6f55d78b30753f8583454b08c0aa # v4.8.1
env:
JF_ENV_SPRING: ${{ secrets.JF_ARTIFACTORY_SPRING }}
- name: Promote build
@@ -86,7 +85,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Code
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
uses: actions/checkout@v6
- name: Create GitHub Release
uses: ./.github/actions/create-github-release
with:
@@ -17,7 +17,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
branch: [ '6.1.x' ]
branch: [ '6.2.x', '7.0.x', 'main' ]
steps:
- uses: spring-io/spring-doc-actions/update-antora-spring-ui@5a57bcc6a0da2a1474136cf29571b277850432bc
name: Update
+5 -5
View File
@@ -30,23 +30,23 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check Out Release Verification Tests
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
ref: 'v0.0.2'
repository: spring-projects/spring-framework-release-verification
token: ${{ secrets.token }}
- name: Check Out Send Notification Action
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
path: send-notification
sparse-checkout: .github/actions/send-notification
- name: Set Up Java
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
distribution: 'liberica'
java-version: 17
- name: Set Up Gradle
uses: gradle/actions/setup-gradle@cc4fc85e6b35bafd578d5ffbc76a5518407e1af0 # v4.2.1
uses: gradle/actions/setup-gradle@4d9f0ba0025fe599b4ebab900eb7f3a1d93ef4c2 # v5.0.0
with:
cache-read-only: false
- name: Configure Gradle Properties
@@ -64,7 +64,7 @@ jobs:
run: ./gradlew spring-framework-release-verification-tests:test
- name: Upload Build Reports on Failure
if: failure()
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v6
with:
name: build-reports
path: '**/build/reports/'
+4 -2
View File
@@ -9,6 +9,7 @@ ivy-cache
argfile*
activemq-data/
classes/
.cursor/
# Log files
jxl.log
@@ -38,11 +39,12 @@ bin
.springBeans
spring-*/src/main/java/META-INF/MANIFEST.MF
# IDEA artifacts and output dirs
# IntelliJ IDEA artifacts and output dirs
*.iml
*.ipr
*.iws
.idea
.idea/*
!.idea/icon.svg
out
test-output
atlassian-ide-plugin.xml
+52
View File
@@ -0,0 +1,52 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Generator: Adobe Illustrator 24.0.3, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
<svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
viewBox="0 0 510 510" style="enable-background:new 0 0 510 510;" xml:space="preserve">
<style type="text/css">
.st0{fill:#6DB33F;}
</style>
<title>icon-framework</title>
<g id="Layer_2_1_">
<g id="Layer_1-2">
<path class="st0" d="M479.2,162.5c-5.6-34.3-20.5-64.4-43.9-87.8S382,36.5,347.6,30.9C320.1,11.2,288.5,0,255,0
s-65.1,11.2-92.6,30.9C128,36.5,98,51.3,74.7,74.7C50.9,98.4,36.5,128.7,31,162.2C11.2,189.8,0,221.4,0,255s11.2,65.2,31,92.8
c5.5,33.5,19.9,63.8,43.7,87.5c23.3,23.3,53.3,38.2,87.7,43.8C190,498.8,221.5,510,255,510s65-11.2,92.6-30.9
c34.4-5.6,64.4-20.5,87.7-43.8c23.8-23.8,38.1-54.1,43.7-87.5c19.8-27.6,31-59.2,31-92.8S498.8,190,479.2,162.5z M473,224.2
c-0.8,6-1.9,11.9-3.2,17.9c-7.2-22.4-17.1-43.8-29.4-63.8c-5.5-22.8-13.6-44.9-24.4-65.8c22.9,14.8,42.2,32.6,56.7,52.6
C475.7,184.6,475.8,204.6,473,224.2z M444.7,199.6c9.3,17.7,16.6,36.3,21.9,55.6c-5.3,19.3-12.7,37.9-22,55.6
C450.9,274,451,236.4,444.7,199.6L444.7,199.6z M175.4,341.1c6.5-4.5,13.7-7.8,21.3-9.8c32.2-7.5,46.7-9.9,66.3-18.4
c36.8-15.9,74.8-53.3,84.6-94c-16.1,38.8-59.5,70.2-97.9,81.6c-26.2,7.8-79.8,13.6-80.1,13.6l-1.4-1.2
c-30.6-17.4-27-85.8,31.8-104.1c25.7-8,55.9-0.7,83.5-5.4c29.4-5,64.4-24.5,79.9-52c12.3,46.4,26.1,118.5-9.7,160.2
C309.4,363,211.8,318,175.4,341.1z M310.8,444.6c-17.7,9.4-36.5,16.8-55.8,22.1c-19.4-5.3-38.1-12.7-55.8-22.1
C236.1,450.9,273.9,450.9,310.8,444.6z M117.6,392.4c13.1,13.1,27.3,25.1,42.3,35.8c-19-5.9-37.2-13.8-54.5-23.7
c-9.9-17.3-17.8-35.7-23.7-54.7C92.4,365.1,104.5,379.3,117.6,392.4z M81.7,160.1c5.9-19,13.9-37.4,23.7-54.7
c17.3-9.8,35.5-17.8,54.5-23.7c-15.1,10.8-29.2,22.7-42.3,35.8C104.5,130.7,92.4,144.9,81.7,160.1z M149.1,346.4
c-8.5,0.2-15.5-6.5-15.7-15c-0.2-8.5,6.5-15.5,15-15.7c8.5-0.2,15.5,6.5,15.7,15c0,0,0,0.1,0,0.1
C164.2,339.3,157.5,346.2,149.1,346.4L149.1,346.4z M199.2,65.4c17.7-9.4,36.5-16.8,55.8-22.1c19.4,5.3,38.1,12.7,55.8,22.1
C273.9,59.1,236.1,59.1,199.2,65.4L199.2,65.4z M392.4,392.4c13.1-13.1,25.1-27.3,35.9-42.4c-5.9,19-13.9,37.3-23.7,54.5
c-17.3,9.8-35.5,17.7-54.5,23.7C365.2,417.5,379.3,405.5,392.4,392.4L392.4,392.4z M392.4,117.6c-13.1-13.1-27.2-25.1-42.3-35.8
c19,5.9,37.2,13.9,54.5,23.7c9.8,17.3,17.8,35.6,23.7,54.7C417.6,144.9,405.5,130.7,392.4,117.6L392.4,117.6z M430.5,79.5
c19.4,19.3,32.6,43.6,39.3,71.1c-16.2-19.2-36.6-36.2-60.4-50c-13.8-23.8-30.8-44.2-50-60.4C387.1,46.9,411.2,60.1,430.5,79.5
L430.5,79.5z M397.6,94c-20.8-10.7-42.8-18.8-65.6-24.2c-20-12.4-41.5-22.4-63.9-29.6c15.5-3.4,31.3-5.1,47.2-5.2
c10,0,19.9,0.8,29.7,2.3C365.1,51.8,382.8,71.1,397.6,94z M255,6.8c27.6,0,53.8,8,77.4,22.2c-5.6-0.5-11.3-0.7-17.1-0.7
c-20.4,0.1-40.6,2.8-60.3,8.1c-19.7-5.3-39.9-8-60.3-8.1c-5.8,0-11.5,0.2-17.1,0.7C201.2,14.7,227.4,6.8,255,6.8z M165,37.3
c9.8-1.5,19.8-2.3,29.7-2.3c15.9,0.1,31.7,1.8,47.2,5.2C219.5,47.4,198,57.3,178,69.8c-22.7,5.4-44.8,13.6-65.6,24.2
C127.2,71.1,144.9,51.8,165,37.3z M79.5,79.5c19.3-19.3,43.5-32.6,71.1-39.3c-19.2,16.2-36.2,36.6-50,60.4
c-23.7,13.8-44,30.6-60.2,49.8C47,123.4,59.8,99.1,79.5,79.5z M37.4,164.9c14.6-20,33.8-37.7,56.6-52.4
c-10.7,20.9-18.8,43-24.3,65.8c-12.3,20-22.2,41.4-29.4,63.8C34.6,215.4,33.5,189.3,37.4,164.9z M65.4,310.4
c-9.3-17.6-16.6-36.2-21.9-55.4c5.3-19.2,12.6-37.8,21.9-55.4C59.1,236.3,59.1,273.7,65.4,310.4L65.4,310.4z M29.2,332.8
c-14.4-23.7-22.4-50-22.4-77.8s8.1-54.1,22.4-77.8c-2.1,25,0.4,51.3,7.4,77.8C29.5,281.5,27,307.8,29.2,332.8z M40.3,268
c7.2,22.3,17.1,43.7,29.4,63.7c5.5,22.8,13.6,44.9,24.3,65.8c-22.8-14.7-42-32.5-56.6-52.4C33.5,320.7,34.6,294.6,40.3,268z
M79.5,430.5c-19.6-19.6-32.5-43.9-39.1-70.9c16.1,19.1,36.5,36,60.2,49.8c13.8,23.7,30.8,44.2,50,60.4
C122.9,463.1,98.8,449.9,79.5,430.5z M112.5,416c20.8,10.7,42.8,18.8,65.5,24.2c20,12.4,41.5,22.4,63.9,29.6
c-15.5,3.4-31.3,5.1-47.2,5.1c-10,0-19.9-0.8-29.7-2.3C144.9,458.1,127.2,438.9,112.5,416L112.5,416z M255,503.2
c-27.6,0-53.8-8-77.4-22.2c5.6,0.5,11.3,0.7,17.1,0.7c20.4-0.1,40.6-2.8,60.3-8.1c19.7,5.3,39.9,8,60.3,8.1
c5.8,0,11.5-0.2,17.1-0.7C308.8,495.3,282.6,503.2,255,503.2z M345,472.7c-9.8,1.5-19.8,2.3-29.7,2.3c-15.9-0.1-31.7-1.8-47.2-5.1
c22.4-7.2,43.9-17.2,63.9-29.6c22.7-5.4,44.8-13.6,65.6-24.2C382.8,438.9,365.1,458.1,345,472.7z M430.5,430.5
c-19.3,19.3-43.5,32.6-71.1,39.3c19.2-16.2,36.2-36.6,50-60.4c23.7-13.8,44-30.6,60.2-49.8C463.1,386.6,450.1,410.9,430.5,430.5
L430.5,430.5z M472.6,345.1c-14.6,20-33.8,37.7-56.6,52.4c10.7-20.8,18.8-42.8,24.3-65.6c12.3-20,22.2-41.3,29.5-63.7
C475.4,294.7,476.5,320.8,472.6,345.1L472.6,345.1z M473.5,255.3c2.6-9.9,4.7-20,6.1-30.1c2.2-15.7,2.7-31.7,1.4-47.5
c14.2,23.6,22.2,49.8,22.2,77.4s-8.1,54.1-22.4,77.8C482.9,307.9,480.5,281.6,473.5,255.3L473.5,255.3z"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 4.8 KiB

+1 -1
View File
@@ -1,3 +1,3 @@
# Enable auto-env through the sdkman_auto_env config
# Add key=value pairs of SDKs to use below
java=23.0.1-librca
java=25-librca
+2 -2
View File
@@ -1,4 +1,4 @@
# Contributing to the Spring Framework
# Contributing to the Spring Framework
First off, thank you for taking the time to contribute! :+1: :tada:
@@ -120,7 +120,7 @@ source code into your IDE.
The wiki pages
[Code Style](https://github.com/spring-projects/spring-framework/wiki/Code-Style) and
[IntelliJ IDEA Editor Settings](https://github.com/spring-projects/spring-framework/wiki/IntelliJ-IDEA-Editor-Settings)
define the source file coding standards we use along with some IDEA editor settings we customize.
define the source file coding standards we use along with some IntelliJ editor settings we customize.
### Reference Docs
+1 -1
View File
@@ -27,7 +27,7 @@ See the [Build from Source](https://github.com/spring-projects/spring-framework/
## Continuous Integration Builds
Information regarding CI builds can be found in the [Spring Framework Concourse pipeline](ci/README.adoc) documentation.
CI builds are defined with [GitHub Actions workflows](.github/workflows).
## Stay in Touch
+21 -45
View File
@@ -1,15 +1,12 @@
plugins {
id 'io.freefair.aspectj' version '8.4' apply false
id 'io.freefair.aspectj' version '8.13.1' apply false
// kotlinVersion is managed in gradle.properties
id 'org.jetbrains.kotlin.plugin.serialization' version "${kotlinVersion}" apply false
id 'org.jetbrains.dokka' version '1.9.20'
id 'com.github.ben-manes.versions' version '0.51.0'
id 'org.jetbrains.dokka'
id 'com.github.bjornvester.xjc' version '1.8.2' apply false
id 'de.undercouch.download' version '5.4.0'
id 'io.github.goooler.shadow' version '8.1.8' apply false
id 'com.gradleup.shadow' version "9.2.2" apply false
id 'me.champeau.jmh' version '0.7.2' apply false
id 'me.champeau.mrjar' version '0.1.1'
id "net.ltgt.errorprone" version "3.1.0" apply false
id 'io.spring.nullability' version '0.0.11' apply false
}
ext {
@@ -24,13 +21,6 @@ configure(allprojects) { project ->
group = "org.springframework"
repositories {
mavenCentral()
maven {
url = "https://repo.spring.io/milestone"
content {
// Netty 5 optional support
includeGroup 'io.projectreactor.netty'
}
}
if (version.contains('-')) {
maven { url = "https://repo.spring.io/milestone" }
}
@@ -64,48 +54,34 @@ configure([rootProject] + javaProjects) { project ->
apply plugin: "java"
apply plugin: "java-test-fixtures"
apply plugin: 'org.springframework.build.conventions'
apply from: "${rootDir}/gradle/toolchains.gradle"
apply from: "${rootDir}/gradle/ide.gradle"
dependencies {
testImplementation("org.junit.jupiter:junit-jupiter-api")
testImplementation("org.junit.jupiter:junit-jupiter-params")
testImplementation("org.junit.platform:junit-platform-suite-api")
testImplementation("org.junit.jupiter:junit-jupiter")
testImplementation("org.junit.platform:junit-platform-suite")
testImplementation("org.mockito:mockito-core")
testImplementation("org.mockito:mockito-junit-jupiter")
testImplementation("io.mockk:mockk")
testImplementation("io.mockk:mockk") {
exclude group: 'junit', module: 'junit'
}
testImplementation("org.assertj:assertj-core")
// Pull in the latest JUnit 5 Launcher API to ensure proper support in IDEs.
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
testRuntimeOnly("org.junit.platform:junit-platform-suite-engine")
testRuntimeOnly("org.apache.logging.log4j:log4j-core")
}
ext.javadocLinks = [
"https://docs.oracle.com/en/java/javase/17/docs/api/",
"https://jakarta.ee/specifications/platform/11/apidocs/",
"https://docs.jboss.org/hibernate/orm/5.6/javadocs/",
"https://eclipse.dev/aspectj/doc/released/1.9.22.1/aspectjrt/",
"https://www.quartz-scheduler.org/api/2.3.0/",
"https://fasterxml.github.io/jackson-core/javadoc/2.14/",
"https://fasterxml.github.io/jackson-databind/javadoc/2.14/",
"https://fasterxml.github.io/jackson-dataformat-xml/javadoc/2.14/",
"https://hc.apache.org/httpcomponents-client-5.4.x/current/httpclient5/apidocs/",
"https://projectreactor.io/docs/test/release/api/",
"https://junit.org/junit4/javadoc/4.13.2/",
// TODO Uncomment link to JUnit 5 docs once we execute Gradle with Java 18+.
// See https://github.com/spring-projects/spring-framework/issues/27497
//
// "https://junit.org/junit5/docs/5.11.4/api/",
"https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/",
//"https://javadoc.io/static/io.rsocket/rsocket-core/1.1.1/",
"https://r2dbc.io/spec/1.0.0.RELEASE/api/",
// Previously there could be a split-package issue between JSR250 and JSR305 javax.annotation packages,
// but since 6.0 JSR 250 annotations such as @Resource and @PostConstruct have been replaced by their
// JakartaEE equivalents in the jakarta.annotation package.
//"https://www.javadoc.io/doc/com.google.code.findbugs/jsr305/3.0.2/",
"https://jspecify.dev/docs/api/"
"https://docs.oracle.com/en/java/javase/17/docs/api/",
//"https://jakarta.ee/specifications/platform/11/apidocs/",
"https://docs.hibernate.org/orm/7.2/javadocs/",
"https://www.quartz-scheduler.org/api/2.3.0/",
"https://hc.apache.org/httpcomponents-client-5.6.x/5.6/httpclient5/apidocs/",
"https://projectreactor.io/docs/core/release/api/",
"https://projectreactor.io/docs/test/release/api/",
"https://junit.org/junit4/javadoc/4.13.2/",
"https://docs.junit.org/6.1.0/api/",
"https://www.reactive-streams.org/reactive-streams-1.0.4-javadoc/",
"https://r2dbc.io/spec/1.0.0.RELEASE/api/",
"https://jspecify.dev/docs/api/"
] as String[]
}
+19
View File
@@ -33,6 +33,25 @@ but doesn't affect the classpath of dependent projects.
This plugin does not provide a `provided` configuration, as the native `compileOnly` and `testCompileOnly`
configurations are preferred.
### MultiRelease Jar
The `org.springframework.build.multiReleaseJar` plugin configures the project with MultiRelease JAR support.
It creates a new SourceSet and dedicated tasks for each Java variant considered.
This can be configured with the DSL, by setting a list of Java variants to configure:
```groovy
plugins {
id 'org.springframework.build.multiReleaseJar'
}
multiRelease {
releaseVersions 21, 24
}
```
Note, Java classes will be compiled with the toolchain pre-configured by the project, assuming that its
Java language version is equal or higher than all variants we consider. Each compilation task will only
set the "-release" compilation option accordingly to produce the expected bytecode version.
### RuntimeHints Java Agent
+18 -2
View File
@@ -20,10 +20,16 @@ ext {
dependencies {
checkstyle "io.spring.javaformat:spring-javaformat-checkstyle:${javaFormatVersion}"
implementation "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
implementation "com.tngtech.archunit:archunit:1.3.0"
implementation "org.gradle:test-retry-gradle-plugin:1.5.6"
implementation "org.jetbrains.dokka:dokka-gradle-plugin:2.2.0"
implementation "com.tngtech.archunit:archunit:1.4.1"
implementation "org.gradle:test-retry-gradle-plugin:1.6.2"
implementation "io.spring.javaformat:spring-javaformat-gradle-plugin:${javaFormatVersion}"
implementation "io.spring.nohttp:nohttp-gradle:0.0.11"
testImplementation("org.assertj:assertj-core:${assertjVersion}")
testImplementation(platform("org.junit:junit-bom:${junitVersion}"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
}
gradlePlugin {
@@ -40,6 +46,10 @@ gradlePlugin {
id = "org.springframework.build.localdev"
implementationClass = "org.springframework.build.dev.LocalDevelopmentPlugin"
}
multiReleasePlugin {
id = "org.springframework.build.multiReleaseJar"
implementationClass = "org.springframework.build.multirelease.MultiReleaseJarPlugin"
}
optionalDependenciesPlugin {
id = "org.springframework.build.optional-dependencies"
implementationClass = "org.springframework.build.optional.OptionalDependenciesPlugin"
@@ -50,3 +60,9 @@ gradlePlugin {
}
}
}
test {
useJUnitPlatform()
}
jar.dependsOn check
+7 -8
View File
@@ -1,27 +1,26 @@
<?xml version="1.0"?>
<!DOCTYPE module PUBLIC "-//Checkstyle//DTD Checkstyle Configuration 1.3//EN" "https://checkstyle.org/dtds/configuration_1_3.dtd">
<module name="com.puppycrawl.tools.checkstyle.Checker">
<module name="Checker">
<!-- Root Checks -->
<module name="io.spring.javaformat.checkstyle.check.SpringHeaderCheck">
<property name="fileExtensions" value="java"/>
<property name="headerType" value="apache2"/>
<property name="headerCopyrightPattern" value="20\d\d-20\d\d"/>
<property name="headerCopyrightPattern" value="20\d\d-present"/>
<property name="packageInfoHeaderType" value="none"/>
</module>
<module name="com.puppycrawl.tools.checkstyle.checks.NewlineAtEndOfFileCheck"/>
<!-- TreeWalker Checks -->
<module name="com.puppycrawl.tools.checkstyle.TreeWalker">
<module name="TreeWalker">
<!-- Imports -->
<module name="com.puppycrawl.tools.checkstyle.checks.imports.UnusedImportsCheck">
<property name="processJavadoc" value="true"/>
</module>
<module name="AvoidStarImport"/>
<module name="UnusedImports"/>
<module name="RedundantImport"/>
<!-- Modifiers -->
<module name="com.puppycrawl.tools.checkstyle.checks.modifier.ModifierOrderCheck"/>
</module>
</module>
</module>
+3 -1
View File
@@ -1,2 +1,4 @@
org.gradle.caching=true
javaFormatVersion=0.0.42
assertjVersion=3.27.3
javaFormatVersion=0.0.43
junitVersion=5.12.2
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2025 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -50,7 +50,7 @@ public class CheckstyleConventions {
project.getPlugins().apply(CheckstylePlugin.class);
project.getTasks().withType(Checkstyle.class).forEach(checkstyle -> checkstyle.getMaxHeapSize().set("1g"));
CheckstyleExtension checkstyle = project.getExtensions().getByType(CheckstyleExtension.class);
checkstyle.setToolVersion("10.21.1");
checkstyle.setToolVersion("13.4.2");
checkstyle.getConfigDirectory().set(project.getRootProject().file("src/checkstyle"));
String version = SpringJavaFormatPlugin.class.getPackage().getImplementationVersion();
DependencySet checkstyleDependencies = project.getConfigurations().getByName("checkstyle").getDependencies();
@@ -63,8 +63,8 @@ public class CheckstyleConventions {
project.getPlugins().apply(NoHttpPlugin.class);
NoHttpExtension noHttp = project.getExtensions().getByType(NoHttpExtension.class);
noHttp.setAllowlistFile(project.file("src/nohttp/allowlist.lines"));
noHttp.getSource().exclude("**/test-output/**", "**/.settings/**",
"**/.classpath", "**/.project", "**/.gradle/**", "**/node_modules/**");
noHttp.getSource().exclude("**/test-output/**", "**/.settings/**", "**/.classpath",
"**/.project", "**/.gradle/**", "**/node_modules/**", "**/spring-jcl/**", "buildSrc/build/**");
List<String> buildFolders = List.of("bin", "build", "out");
project.allprojects(subproject -> {
Path rootPath = project.getRootDir().toPath();
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,7 +17,6 @@
package org.springframework.build;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;
import org.gradle.api.Plugin;
@@ -27,7 +26,6 @@ import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.jvm.toolchain.JavaLanguageVersion;
import org.gradle.jvm.toolchain.JvmVendorSpec;
/**
* {@link Plugin} that applies conventions for compiling Java sources in Spring Framework.
@@ -42,8 +40,21 @@ public class JavaConventions {
private static final List<String> TEST_COMPILER_ARGS;
/**
* The Java version we should use as the JVM baseline for building the project.
* <p>NOTE: If you update this value, you should also update the value used in
* the {@code javadoc} task in {@code framework-api.gradle}.
*/
private static final JavaLanguageVersion DEFAULT_LANGUAGE_VERSION = JavaLanguageVersion.of(25);
/**
* The Java version we should use as the baseline for the compiled bytecode
* (the "-release" compiler argument).
*/
private static final JavaLanguageVersion DEFAULT_RELEASE_VERSION = JavaLanguageVersion.of(17);
static {
List<String> commonCompilerArgs = Arrays.asList(
List<String> commonCompilerArgs = List.of(
"-Xlint:serial", "-Xlint:cast", "-Xlint:classfile", "-Xlint:dep-ann",
"-Xlint:divzero", "-Xlint:empty", "-Xlint:finally", "-Xlint:overrides",
"-Xlint:path", "-Xlint:processing", "-Xlint:static", "-Xlint:try", "-Xlint:-options",
@@ -51,37 +62,44 @@ public class JavaConventions {
);
COMPILER_ARGS = new ArrayList<>();
COMPILER_ARGS.addAll(commonCompilerArgs);
COMPILER_ARGS.addAll(Arrays.asList(
COMPILER_ARGS.addAll(List.of(
"-Xlint:varargs", "-Xlint:fallthrough", "-Xlint:rawtypes", "-Xlint:deprecation",
"-Xlint:unchecked", "-Werror"
));
TEST_COMPILER_ARGS = new ArrayList<>();
TEST_COMPILER_ARGS.addAll(commonCompilerArgs);
TEST_COMPILER_ARGS.addAll(Arrays.asList("-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
TEST_COMPILER_ARGS.addAll(List.of("-Xlint:-varargs", "-Xlint:-fallthrough", "-Xlint:-rawtypes",
"-Xlint:-deprecation", "-Xlint:-unchecked"));
}
public void apply(Project project) {
project.getPlugins().withType(JavaBasePlugin.class, javaPlugin -> applyJavaCompileConventions(project));
project.getPlugins().withType(JavaBasePlugin.class, javaPlugin -> {
applyToolchainConventions(project);
applyJavaCompileConventions(project);
});
}
/**
* Applies the common Java compiler options for main sources, test fixture sources, and
* Configure the Toolchain support for the project.
* @param project the current project
*/
private static void applyToolchainConventions(Project project) {
project.getExtensions().getByType(JavaPluginExtension.class).toolchain(toolchain -> {
toolchain.getLanguageVersion().set(DEFAULT_LANGUAGE_VERSION);
});
}
/**
* Apply the common Java compiler options for main sources, test fixture sources, and
* test sources.
* @param project the current project
*/
private void applyJavaCompileConventions(Project project) {
project.getExtensions().getByType(JavaPluginExtension.class).toolchain(toolchain -> {
toolchain.getVendor().set(JvmVendorSpec.BELLSOFT);
toolchain.getLanguageVersion().set(JavaLanguageVersion.of(23));
});
SpringFrameworkExtension frameworkExtension = project.getExtensions().getByType(SpringFrameworkExtension.class);
project.afterEvaluate(p -> {
p.getTasks().withType(JavaCompile.class)
.matching(compileTask -> compileTask.getName().startsWith(JavaPlugin.COMPILE_JAVA_TASK_NAME))
.forEach(compileTask -> {
compileTask.getOptions().setCompilerArgs(COMPILER_ARGS);
compileTask.getOptions().getCompilerArgumentProviders().add(frameworkExtension.asArgumentProvider());
compileTask.getOptions().setEncoding("UTF-8");
setJavaRelease(compileTask);
});
@@ -90,7 +108,6 @@ public class JavaConventions {
|| compileTask.getName().equals("compileTestFixturesJava"))
.forEach(compileTask -> {
compileTask.getOptions().setCompilerArgs(TEST_COMPILER_ARGS);
compileTask.getOptions().getCompilerArgumentProviders().add(frameworkExtension.asArgumentProvider());
compileTask.getOptions().setEncoding("UTF-8");
setJavaRelease(compileTask);
});
@@ -98,8 +115,12 @@ public class JavaConventions {
});
}
/**
* We should pick the {@link #DEFAULT_RELEASE_VERSION} for all compiled classes,
* unless the current task is compiling multi-release JAR code with a higher version.
*/
private void setJavaRelease(JavaCompile task) {
int defaultVersion = 17;
int defaultVersion = DEFAULT_RELEASE_VERSION.asInt();
int releaseVersion = defaultVersion;
int compilerVersion = task.getJavaCompiler().get().getMetadata().getLanguageVersion().asInt();
for (int version = defaultVersion ; version <= compilerVersion ; version++) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2025 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -17,6 +17,10 @@
package org.springframework.build;
import org.gradle.api.Project;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
import org.jetbrains.dokka.gradle.DokkaExtension;
import org.jetbrains.dokka.gradle.DokkaPlugin;
import org.jetbrains.kotlin.gradle.dsl.JvmTarget;
import org.jetbrains.kotlin.gradle.dsl.KotlinVersion;
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
@@ -28,14 +32,20 @@ import org.jetbrains.kotlin.gradle.tasks.KotlinCompile;
public class KotlinConventions {
void apply(Project project) {
project.getPlugins().withId("org.jetbrains.kotlin.jvm",
(plugin) -> project.getTasks().withType(KotlinCompile.class, this::configure));
project.getPlugins().withId("org.jetbrains.kotlin.jvm", plugin -> {
project.getTasks().withType(KotlinCompile.class, this::configure);
if (project.getLayout().getProjectDirectory().dir("src/main/kotlin").getAsFile().exists()) {
project.getPlugins().apply(DokkaPlugin.class);
project.getExtensions().configure(DokkaExtension.class, dokka -> configure(project, dokka));
project.project(":framework-api").getDependencies().add("dokka", project);
}
});
}
private void configure(KotlinCompile compile) {
compile.compilerOptions(options -> {
options.getApiVersion().set(KotlinVersion.KOTLIN_2_1);
options.getLanguageVersion().set(KotlinVersion.KOTLIN_2_1);
options.getApiVersion().set(KotlinVersion.KOTLIN_2_2);
options.getLanguageVersion().set(KotlinVersion.KOTLIN_2_2);
options.getJvmTarget().set(JvmTarget.JVM_17);
options.getJavaParameters().set(true);
options.getAllWarningsAsErrors().set(true);
@@ -43,9 +53,41 @@ public class KotlinConventions {
"-Xsuppress-version-warnings",
"-Xjsr305=strict", // For dependencies using JSR 305
"-opt-in=kotlin.RequiresOptIn",
"-Xjdk-release=17" // Needed due to https://youtrack.jetbrains.com/issue/KT-49746
"-Xjdk-release=17", // Needed due to https://youtrack.jetbrains.com/issue/KT-49746
"-Xannotation-default-target=param-property" // Upcoming default, see https://youtrack.jetbrains.com/issue/KT-73255
);
});
}
private void configure(Project project, DokkaExtension dokka) {
dokka.getDokkaSourceSets().forEach(sourceSet -> {
sourceSet.getSourceRoots().setFrom(project.file("src/main/kotlin"));
sourceSet.getClasspath()
.from(project.getExtensions()
.getByType(SourceSetContainer.class)
.getByName(SourceSet.MAIN_SOURCE_SET_NAME)
.getOutput());
var externalDocumentationLinks = sourceSet.getExternalDocumentationLinks();
var springVersion = project.getVersion();
externalDocumentationLinks.register("spring-framework", spec -> {
spec.url("https://docs.spring.io/spring-framework/docs/" + springVersion + "/javadoc-api/");
spec.packageListUrl("https://docs.spring.io/spring-framework/docs/" + springVersion + "/javadoc-api/element-list");
});
externalDocumentationLinks.register("reactor-core", spec ->
spec.url("https://projectreactor.io/docs/core/release/api/"));
externalDocumentationLinks.register("reactive-streams", spec ->
spec.url("https://www.reactive-streams.org/reactive-streams-1.0.3-javadoc/"));
externalDocumentationLinks.register("kotlinx-coroutines", spec ->
spec.url("https://kotlinlang.org/api/kotlinx.coroutines/"));
externalDocumentationLinks.register("hamcrest", spec ->
spec.url("https://javadoc.io/doc/org.hamcrest/hamcrest/2.1/"));
externalDocumentationLinks.register("jakarta-servlet", spec -> {
spec.url("https://javadoc.io/doc/jakarta.servlet/jakarta.servlet-api/latest/");
spec.packageListUrl("https://javadoc.io/doc/jakarta.servlet/jakarta.servlet-api/latest/element-list");
});
externalDocumentationLinks.register("rsocket-core", spec ->
spec.url("https://javadoc.io/static/io.rsocket/rsocket-core/1.1.1/"));
});
}
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -21,6 +21,8 @@ import java.util.List;
import org.gradle.api.Project;
import org.gradle.api.provider.Property;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.testing.Test;
import org.gradle.process.CommandLineArgumentProvider;
public class SpringFrameworkExtension {
@@ -29,13 +31,18 @@ public class SpringFrameworkExtension {
public SpringFrameworkExtension(Project project) {
this.enableJavaPreviewFeatures = project.getObjects().property(Boolean.class);
project.getTasks().withType(JavaCompile.class).configureEach(javaCompile ->
javaCompile.getOptions().getCompilerArgumentProviders().add(asArgumentProvider()));
project.getTasks().withType(Test.class).configureEach(test ->
test.getJvmArgumentProviders().add(asArgumentProvider()));
}
public Property<Boolean> getEnableJavaPreviewFeatures() {
return this.enableJavaPreviewFeatures;
}
public CommandLineArgumentProvider asArgumentProvider() {
private CommandLineArgumentProvider asArgumentProvider() {
return () -> {
if (getEnableJavaPreviewFeatures().getOrElse(false)) {
return List.of("--enable-preview");
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -16,24 +16,31 @@
package org.springframework.build;
import java.util.Map;
import org.gradle.api.Project;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.Dependency;
import org.gradle.api.plugins.JavaBasePlugin;
import org.gradle.api.tasks.testing.Test;
import org.gradle.api.tasks.testing.TestFrameworkOptions;
import org.gradle.api.tasks.testing.junitplatform.JUnitPlatformOptions;
import org.gradle.testretry.TestRetryPlugin;
import org.gradle.testretry.TestRetryTaskExtension;
import java.util.Map;
/**
* Conventions that are applied in the presence of the {@link JavaBasePlugin}. When the
* plugin is applied:
* <ul>
* <li>The {@link TestRetryPlugin Test Retry} plugin is applied so that flaky tests
* are retried 3 times when running on the CI server.
* <li>Common test properties are configured
* <li>The ByteBuddy Java agent is configured on test tasks.
* </ul>
*
* @author Brian Clozel
* @author Andy Wilkinson
* @author Sam Brannen
*/
class TestConventions {
@@ -42,6 +49,7 @@ class TestConventions {
}
private void configureTestConventions(Project project) {
configureByteBuddyAgent(project);
project.getTasks().withType(Test.class,
test -> {
configureTests(project, test);
@@ -50,14 +58,17 @@ class TestConventions {
}
private void configureTests(Project project, Test test) {
test.useJUnitPlatform();
TestFrameworkOptions existingOptions = test.getOptions();
test.useJUnitPlatform(options -> {
if (existingOptions instanceof JUnitPlatformOptions junitPlatformOptions) {
options.copyFrom(junitPlatformOptions);
}
});
test.include("**/*Tests.class", "**/*Test.class");
test.setSystemProperties(Map.of(
"java.awt.headless", "true",
"io.netty.leakDetection.level", "paranoid",
"io.netty5.leakDetectionLevel", "paranoid",
"io.netty5.leakDetection.targetRecords", "32",
"io.netty5.buffer.lifecycleTracingEnabled", "true"
"junit.platform.discovery.issue.severity.critical", "INFO"
));
if (project.hasProperty("testGroups")) {
test.systemProperty("testGroups", project.getProperties().get("testGroups"));
@@ -67,8 +78,20 @@ class TestConventions {
"--add-opens=java.base/java.util=ALL-UNNAMED",
"-Xshare:off"
);
test.getJvmArgumentProviders().add(project.getExtensions()
.getByType(SpringFrameworkExtension.class).asArgumentProvider());
}
private void configureByteBuddyAgent(Project project) {
if (project.hasProperty("byteBuddyVersion")) {
String byteBuddyVersion = (String) project.getProperties().get("byteBuddyVersion");
Configuration byteBuddyAgentConfig = project.getConfigurations().create("byteBuddyAgentConfig");
byteBuddyAgentConfig.setTransitive(false);
Dependency byteBuddyAgent = project.getDependencies().create("net.bytebuddy:byte-buddy-agent:" + byteBuddyVersion);
byteBuddyAgentConfig.getDependencies().add(byteBuddyAgent);
project.afterEvaluate(p -> {
p.getTasks().withType(Test.class, test -> test
.jvmArgs("-javaagent:" + byteBuddyAgentConfig.getAsPath()));
});
}
}
private void configureTestRetryPlugin(Project project, Test test) {
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2025 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -44,7 +44,11 @@ import org.gradle.api.tasks.PathSensitivity;
import org.gradle.api.tasks.SkipWhenEmpty;
import org.gradle.api.tasks.TaskAction;
import static org.springframework.build.architecture.ArchitectureRules.*;
import static org.springframework.build.architecture.ArchitectureRules.allPackagesShouldBeFreeOfTangles;
import static org.springframework.build.architecture.ArchitectureRules.classesShouldNotImportForbiddenTypes;
import static org.springframework.build.architecture.ArchitectureRules.javaClassesShouldNotImportKotlinAnnotations;
import static org.springframework.build.architecture.ArchitectureRules.noClassesShouldCallStringToLowerCaseWithoutLocale;
import static org.springframework.build.architecture.ArchitectureRules.noClassesShouldCallStringToUpperCaseWithoutLocale;
/**
* {@link Task} that checks for architecture problems.
@@ -59,8 +63,7 @@ public abstract class ArchitectureCheck extends DefaultTask {
public ArchitectureCheck() {
getOutputDirectory().convention(getProject().getLayout().getBuildDirectory().dir(getName()));
getProhibitObjectsRequireNonNull().convention(true);
getRules().addAll(packageInfoShouldBeNullMarked(),
classesShouldNotImportForbiddenTypes(),
getRules().addAll(classesShouldNotImportForbiddenTypes(),
javaClassesShouldNotImportKotlinAnnotations(),
allPackagesShouldBeFreeOfTangles(),
noClassesShouldCallStringToLowerCaseWithoutLocale(),
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2025 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2025 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -46,13 +46,6 @@ abstract class ArchitectureRules {
.because("String.toUpperCase(Locale.ROOT) should be used instead");
}
static ArchRule packageInfoShouldBeNullMarked() {
return ArchRuleDefinition.classes()
.that().haveSimpleName("package-info")
.should().beAnnotatedWith("org.jspecify.annotations.NullMarked")
.allowEmptyShould(true);
}
static ArchRule classesShouldNotImportForbiddenTypes() {
return ArchRuleDefinition.noClasses()
.should().dependOnClassesThat()
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -27,6 +27,7 @@ import org.gradle.api.attributes.Usage;
import org.gradle.api.attributes.java.TargetJvmVersion;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.jvm.JvmTestSuite;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.testing.Test;
import org.gradle.testing.base.TestingExtension;
@@ -52,7 +53,7 @@ public class RuntimeHintsAgentPlugin implements Plugin<Project> {
TestingExtension testing = project.getExtensions().getByType(TestingExtension.class);
JvmTestSuite jvmTestSuite = (JvmTestSuite) testing.getSuites().getByName("test");
RuntimeHintsAgentExtension agentExtension = createRuntimeHintsAgentExtension(project);
Test agentTest = project.getTasks().create(RUNTIMEHINTS_TEST_TASK, Test.class, test -> {
TaskProvider<Test> agentTest = project.getTasks().register(RUNTIMEHINTS_TEST_TASK, Test.class, test -> {
test.useJUnitPlatform(options -> {
options.includeTags("RuntimeHintsTests");
});
@@ -63,7 +64,7 @@ public class RuntimeHintsAgentPlugin implements Plugin<Project> {
test.setClasspath(jvmTestSuite.getSources().getRuntimeClasspath());
test.getJvmArgumentProviders().add(createRuntimeHintsAgentArgumentProvider(project, agentExtension));
});
project.getTasks().getByName("check", task -> task.dependsOn(agentTest));
project.getTasks().named("check", task -> task.dependsOn(agentTest));
project.getDependencies().add(CONFIGURATION_NAME, project.project(":spring-core-test"));
});
}
@@ -0,0 +1,139 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.multirelease;
import javax.inject.Inject;
import org.gradle.api.artifacts.Configuration;
import org.gradle.api.artifacts.ConfigurationContainer;
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.attributes.LibraryElements;
import org.gradle.api.file.ConfigurableFileCollection;
import org.gradle.api.file.FileCollection;
import org.gradle.api.java.archives.Attributes;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.tasks.SourceSet;
import org.gradle.api.tasks.SourceSetContainer;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.bundling.Jar;
import org.gradle.api.tasks.compile.JavaCompile;
import org.gradle.api.tasks.testing.Test;
import org.gradle.language.base.plugins.LifecycleBasePlugin;
/**
* @author Cedric Champeau
* @author Brian Clozel
*/
public abstract class MultiReleaseExtension {
private final TaskContainer tasks;
private final SourceSetContainer sourceSets;
private final DependencyHandler dependencies;
private final ObjectFactory objects;
private final ConfigurationContainer configurations;
@Inject
public MultiReleaseExtension(SourceSetContainer sourceSets,
ConfigurationContainer configurations,
TaskContainer tasks,
DependencyHandler dependencies,
ObjectFactory objectFactory) {
this.sourceSets = sourceSets;
this.configurations = configurations;
this.tasks = tasks;
this.dependencies = dependencies;
this.objects = objectFactory;
}
public void releaseVersions(int... javaVersions) {
releaseVersions("src/main/", "src/test/", javaVersions);
}
private void releaseVersions(String mainSourceDirectory, String testSourceDirectory, int... javaVersions) {
for (int javaVersion : javaVersions) {
addLanguageVersion(javaVersion, mainSourceDirectory, testSourceDirectory);
}
}
private void addLanguageVersion(int javaVersion, String mainSourceDirectory, String testSourceDirectory) {
String javaN = "java" + javaVersion;
SourceSet langSourceSet = sourceSets.create(javaN, srcSet -> srcSet.getJava().srcDir(mainSourceDirectory + javaN));
SourceSet testSourceSet = sourceSets.create(javaN + "Test", srcSet -> srcSet.getJava().srcDir(testSourceDirectory + javaN));
SourceSet sharedSourceSet = sourceSets.findByName(SourceSet.MAIN_SOURCE_SET_NAME);
SourceSet sharedTestSourceSet = sourceSets.findByName(SourceSet.TEST_SOURCE_SET_NAME);
FileCollection mainClasses = objects.fileCollection().from(sourceSets.getByName(SourceSet.MAIN_SOURCE_SET_NAME).getOutput().getClassesDirs());
dependencies.add(javaN + "Implementation", mainClasses);
tasks.named(langSourceSet.getCompileJavaTaskName(), JavaCompile.class, task ->
task.getOptions().getRelease().set(javaVersion)
);
tasks.named(testSourceSet.getCompileJavaTaskName(), JavaCompile.class, task ->
task.getOptions().getRelease().set(javaVersion)
);
TaskProvider<Test> testTask = createTestTask(javaVersion, testSourceSet, sharedTestSourceSet, langSourceSet, sharedSourceSet);
tasks.named("check", task -> task.dependsOn(testTask));
configureMultiReleaseJar(javaVersion, langSourceSet);
}
private TaskProvider<Test> createTestTask(int javaVersion, SourceSet testSourceSet, SourceSet sharedTestSourceSet, SourceSet langSourceSet, SourceSet sharedSourceSet) {
Configuration testImplementation = configurations.getByName(testSourceSet.getImplementationConfigurationName());
testImplementation.extendsFrom(configurations.getByName(sharedTestSourceSet.getImplementationConfigurationName()));
Configuration testCompileOnly = configurations.getByName(testSourceSet.getCompileOnlyConfigurationName());
testCompileOnly.extendsFrom(configurations.getByName(sharedTestSourceSet.getCompileOnlyConfigurationName()));
testCompileOnly.getDependencies().add(dependencies.create(langSourceSet.getOutput().getClassesDirs()));
testCompileOnly.getDependencies().add(dependencies.create(sharedSourceSet.getOutput().getClassesDirs()));
Configuration testRuntimeClasspath = configurations.getByName(testSourceSet.getRuntimeClasspathConfigurationName());
// so here's the deal. MRjars are JARs! Which means that to execute tests, we need
// the JAR on classpath, not just classes + resources as Gradle usually does
testRuntimeClasspath.getAttributes()
.attribute(LibraryElements.LIBRARY_ELEMENTS_ATTRIBUTE, objects.named(LibraryElements.class, LibraryElements.JAR));
TaskProvider<Test> testTask = tasks.register("java" + javaVersion + "Test", Test.class, test -> {
test.setGroup(LifecycleBasePlugin.VERIFICATION_GROUP);
ConfigurableFileCollection testClassesDirs = objects.fileCollection();
testClassesDirs.from(testSourceSet.getOutput());
testClassesDirs.from(sharedTestSourceSet.getOutput());
test.setTestClassesDirs(testClassesDirs);
ConfigurableFileCollection classpath = objects.fileCollection();
// must put the MRJar first on classpath
classpath.from(tasks.named("jar"));
// then we put the specific test sourceset tests, so that we can override
// the shared versions
classpath.from(testSourceSet.getOutput());
// then we add the shared tests
classpath.from(sharedTestSourceSet.getRuntimeClasspath());
test.setClasspath(classpath);
});
return testTask;
}
private void configureMultiReleaseJar(int version, SourceSet languageSourceSet) {
tasks.named("jar", Jar.class, jar -> {
jar.into("META-INF/versions/" + version, s -> s.from(languageSourceSet.getOutput()));
Attributes attributes = jar.getManifest().getAttributes();
attributes.put("Multi-Release", "true");
});
}
}
@@ -0,0 +1,76 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.multirelease;
import javax.inject.Inject;
import org.gradle.api.JavaVersion;
import org.gradle.api.Plugin;
import org.gradle.api.Project;
import org.gradle.api.artifacts.ConfigurationContainer;
import org.gradle.api.artifacts.dsl.DependencyHandler;
import org.gradle.api.model.ObjectFactory;
import org.gradle.api.plugins.ExtensionContainer;
import org.gradle.api.plugins.JavaPlugin;
import org.gradle.api.plugins.JavaPluginExtension;
import org.gradle.api.tasks.TaskContainer;
import org.gradle.api.tasks.TaskProvider;
import org.gradle.api.tasks.bundling.AbstractArchiveTask;
import org.gradle.jvm.tasks.Jar;
import org.gradle.jvm.toolchain.JavaLanguageVersion;
import org.gradle.jvm.toolchain.JavaToolchainService;
/**
* A plugin which adds support for building multi-release jars
* with Gradle.
* @author Cedric Champeau
* @author Brian Clozel
* @see <a href="https://github.com/melix/mrjar-gradle-plugin">original project</a>
*/
public class MultiReleaseJarPlugin implements Plugin<Project> {
public static String VALIDATE_JAR_TASK_NAME = "validateMultiReleaseJar";
@Inject
protected JavaToolchainService getToolchains() {
throw new UnsupportedOperationException();
}
public void apply(Project project) {
project.getPlugins().apply(JavaPlugin.class);
ExtensionContainer extensions = project.getExtensions();
JavaPluginExtension javaPluginExtension = extensions.getByType(JavaPluginExtension.class);
ConfigurationContainer configurations = project.getConfigurations();
TaskContainer tasks = project.getTasks();
DependencyHandler dependencies = project.getDependencies();
ObjectFactory objects = project.getObjects();
extensions.create("multiRelease", MultiReleaseExtension.class,
javaPluginExtension.getSourceSets(),
configurations,
tasks,
dependencies,
objects);
if (JavaVersion.current().isCompatibleWith(JavaVersion.VERSION_25)) {
TaskProvider<MultiReleaseJarValidateTask> validateJarTask = tasks.register(VALIDATE_JAR_TASK_NAME, MultiReleaseJarValidateTask.class, (task) -> {
task.getJar().set(tasks.named("jar", Jar.class).flatMap(AbstractArchiveTask::getArchiveFile));
task.getJavaLauncher().set(task.getJavaToolchainService().launcherFor(spec -> spec.getLanguageVersion().set(JavaLanguageVersion.of(25))));
});
tasks.named("check", task -> task.dependsOn(validateJarTask));
}
}
}
@@ -0,0 +1,47 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.multirelease;
import org.gradle.api.file.RegularFileProperty;
import org.gradle.api.tasks.CacheableTask;
import org.gradle.api.tasks.InputFile;
import org.gradle.api.tasks.JavaExec;
import org.gradle.api.tasks.PathSensitive;
import org.gradle.api.tasks.PathSensitivity;
import org.gradle.jvm.toolchain.JavaToolchainService;
import java.util.List;
import javax.inject.Inject;
@CacheableTask
public abstract class MultiReleaseJarValidateTask extends JavaExec {
public MultiReleaseJarValidateTask() {
getMainModule().set("jdk.jartool");
getArgumentProviders().add(() -> List.of("--validate", "--file", getJar().get().getAsFile().getAbsolutePath()));
}
@Inject
protected abstract JavaToolchainService getJavaToolchainService();
@InputFile
@PathSensitive(PathSensitivity.RELATIVE)
public abstract RegularFileProperty getJar();
}
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -1,5 +1,5 @@
/*
* Copyright 2002-2023 the original author or authors.
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -78,7 +78,7 @@ public class ShadowSource extends DefaultTask {
}
@OutputDirectory
DirectoryProperty getOutputDirectory() {
public DirectoryProperty getOutputDirectory() {
return this.outputDirectory;
}
@@ -0,0 +1,182 @@
/*
* Copyright 2002-present the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package org.springframework.build.multirelease;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.PrintWriter;
import java.nio.file.Files;
import java.nio.file.Path;
import java.util.jar.Attributes;
import java.util.jar.JarFile;
import org.gradle.testkit.runner.BuildResult;
import org.gradle.testkit.runner.GradleRunner;
import org.gradle.testkit.runner.UnexpectedBuildFailure;
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledForJreRange;
import org.junit.jupiter.api.condition.JRE;
import org.junit.jupiter.api.io.TempDir;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.assertThatThrownBy;
/**
* Tests for {@link MultiReleaseJarPlugin}
*/
public class MultiReleaseJarPluginTests {
private File projectDir;
private File buildFile;
private File propertiesFile;
@BeforeEach
void setup(@TempDir File projectDir) {
this.projectDir = projectDir;
this.buildFile = new File(this.projectDir, "build.gradle");
this.propertiesFile = new File(this.projectDir, "gradle.properties");
}
@Test
void configureSourceSets() throws IOException {
writeBuildFile("""
plugins {
id 'java'
id 'org.springframework.build.multiReleaseJar'
}
multiRelease { releaseVersions 21, 24 }
task printSourceSets {
doLast {
sourceSets.all { println it.name }
}
}
""");
BuildResult buildResult = runGradle("printSourceSets");
assertThat(buildResult.getOutput()).contains("main", "test", "java21", "java21Test", "java24", "java24Test");
}
@Test
void configureToolchainReleaseVersion() throws IOException {
writeBuildFile("""
plugins {
id 'java'
id 'org.springframework.build.multiReleaseJar'
}
multiRelease { releaseVersions 21 }
task printReleaseVersion {
doLast {
tasks.all { println it.name }
tasks.named("compileJava21Java") {
println "compileJava21Java releaseVersion: ${it.options.release.get()}"
}
tasks.named("compileJava21TestJava") {
println "compileJava21TestJava releaseVersion: ${it.options.release.get()}"
}
}
}
""");
BuildResult buildResult = runGradle("printReleaseVersion");
assertThat(buildResult.getOutput()).contains("compileJava21Java releaseVersion: 21")
.contains("compileJava21TestJava releaseVersion: 21");
}
@Test
void packageInJar() throws IOException {
writeBuildFile("""
plugins {
id 'java'
id 'org.springframework.build.multiReleaseJar'
}
version = '1.2.3'
multiRelease { releaseVersions 17 }
""");
writeClass("src/main/java17", "Main.java", """
public class Main {}
""");
BuildResult buildResult = runGradle("assemble");
File file = new File(this.projectDir, "/build/libs/" + this.projectDir.getName() + "-1.2.3.jar");
assertThat(file).exists();
try (JarFile jar = new JarFile(file)) {
Attributes mainAttributes = jar.getManifest().getMainAttributes();
assertThat(mainAttributes.getValue("Multi-Release")).isEqualTo("true");
assertThat(jar.entries().asIterator()).toIterable()
.anyMatch(entry -> entry.getName().equals("META-INF/versions/17/Main.class"));
}
}
@Test
@DisabledForJreRange(max = JRE.JAVA_24, disabledReason = "'jar --validate' is available as of Java 25")
void validateJar() throws IOException {
writeBuildFile("""
plugins {
id 'java'
id 'org.springframework.build.multiReleaseJar'
}
version = '1.2.3'
tasks.withType(JavaCompile).configureEach {
options.release = 11
}
multiRelease { releaseVersions 17 }
""");
writeGradleProperties("""
org.gradle.jvmargs=-Duser.language=en
""");
writeClass("src/main/java17", "Main.java", """
public class Main {
public void method() {}
}
""");
writeClass("src/main/java", "Main.java", """
public class Main {}
""");
assertThatThrownBy(() ->runGradle("validateMultiReleaseJar"))
.isInstanceOf(UnexpectedBuildFailure.class)
.hasMessageContaining("entry: META-INF/versions/17/Main.class, contains a class with different api from earlier version");
}
private void writeBuildFile(String buildContent) throws IOException {
try (PrintWriter out = new PrintWriter(new FileWriter(this.buildFile))) {
out.print(buildContent);
}
}
private void writeGradleProperties(String properties) throws IOException {
try (PrintWriter out = new PrintWriter(new FileWriter(this.propertiesFile))) {
out.print(properties);
}
}
private void writeClass(String path, String fileName, String fileContent) throws IOException {
Path folder = this.projectDir.toPath().resolve(path);
Files.createDirectories(folder);
Path filePath = folder.resolve(fileName);
Files.createFile(filePath);
Files.writeString(filePath, fileContent);
}
private BuildResult runGradle(String... args) {
return GradleRunner.create().withProjectDir(this.projectDir).withArguments(args).withPluginClasspath().build();
}
}
+24 -16
View File
@@ -1,6 +1,7 @@
plugins {
id 'java-platform'
id 'io.freefair.aggregate-javadoc' version '8.3'
id 'io.freefair.aggregate-javadoc' version '8.13.1'
id 'org.jetbrains.dokka'
}
description = "Spring Framework API Docs"
@@ -19,8 +20,14 @@ dependencies {
}
}
def springAspectsOutput = project(":spring-aspects").sourceSets.main.output
javadoc {
javadocTool.set(javaToolchains.javadocToolFor({
languageVersion = JavaLanguageVersion.of(25)
}))
title = "${rootProject.description} ${version} API"
failOnError = true
options {
encoding = "UTF-8"
memberLevel = JavadocMemberLevel.PROTECTED
@@ -31,36 +38,37 @@ javadoc {
destinationDir = project.java.docsDir.dir("javadoc-api").get().asFile
splitIndex = true
links(rootProject.ext.javadocLinks)
addBooleanOption('Xdoclint:syntax,reference', true) // only check syntax and reference with doclint
addBooleanOption('Werror', true) // fail build on Javadoc warnings
// Check for 'syntax' and 'reference' during linting.
addBooleanOption('Xdoclint:syntax,reference', true)
// Change modularity mismatch from warn to info.
// See https://github.com/spring-projects/spring-framework/issues/27497
addStringOption("-link-modularity-mismatch", "info")
// Fail build on Javadoc warnings.
addBooleanOption('Werror', true)
}
maxMemory = "1024m"
doFirst {
classpath += files(
// ensure the javadoc process can resolve types compiled from .aj sources
project(":spring-aspects").sourceSets.main.output
// ensure the javadoc process can resolve types compiled from .aj sources
springAspectsOutput
)
classpath += files(moduleProjects.collect { it.sourceSets.main.compileClasspath })
}
}
/**
* Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
*/
rootProject.tasks.dokkaHtmlMultiModule.configure {
dependsOn {
tasks.named("javadoc")
dokka {
moduleName = "spring-framework"
dokkaPublications.html {
outputDirectory = project.java.docsDir.dir("kdoc-api")
includes.from("$rootProject.rootDir/framework-docs/src/docs/api/dokka-overview.md")
}
moduleName.set("spring-framework")
outputDirectory.set(project.java.docsDir.dir("kdoc-api").get().asFile)
includes.from("$rootProject.rootDir/framework-docs/src/docs/api/dokka-overview.md")
}
/**
* Zip all Java docs (javadoc & kdoc) into a single archive
*/
tasks.register('docsZip', Zip) {
dependsOn = ['javadoc', rootProject.tasks.dokkaHtmlMultiModule]
dependsOn = ['javadoc', 'dokkaGenerate']
group = "distribution"
description = "Builds -${archiveClassifier} archive containing api and reference " +
"for deployment at https://docs.spring.io/spring-framework/docs/."
@@ -73,7 +81,7 @@ tasks.register('docsZip', Zip) {
from(javadoc) {
into "javadoc-api"
}
from(rootProject.tasks.dokkaHtmlMultiModule.outputDirectory) {
from(project.java.docsDir.dir("kdoc-api")) {
into "kdoc-api"
}
}
+5 -3
View File
@@ -13,8 +13,10 @@ content:
- url: https://github.com/spring-projects/spring-framework
# Refname matching:
# https://docs.antora.org/antora/latest/playbook/content-refname-matching/
branches: ['main', '{6..9}.+({1..9}).x']
tags: ['v{6..9}.+({0..9}).+({0..9})?(-{RC,M}*)', '!(v6.0.{0..8})', '!(v6.0.0-{RC,M}{0..9})']
# branches: We include snapshots for main, 6.2.x, and 7.0.x to 9.*.x.
branches: ['main', '6.2.x', '{7..9}.+({0..9}).x']
# tags: include all releases from 6.2.0 to 9.*.*.
tags: ['v6.2.+({0..9})', 'v{7..9}.+({0..9}).+({0..9})?(-{RC,M}*)']
start_path: framework-docs
asciidoc:
extensions:
@@ -36,4 +38,4 @@ runtime:
failure_level: warn
ui:
bundle:
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.18/ui-bundle.zip
url: https://github.com/spring-io/antora-ui-spring/releases/download/v0.4.26/ui-bundle.zip
+1 -1
View File
@@ -6,7 +6,7 @@ nav:
ext:
collector:
run:
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g -XX:+HeapDumpOnOutOfMemoryError" :framework-docs:generateAntoraResources
command: gradlew -q -PbuildSrc.skipTests=true "-Dorg.gradle.jvmargs=-Xmx3g" :framework-docs:generateAntoraResources
local: true
scan:
dir: ./build/generated-antora-resources
+49 -33
View File
@@ -1,3 +1,4 @@
import org.jetbrains.kotlin.gradle.dsl.JvmTarget
import org.jetbrains.kotlin.gradle.tasks.KotlinCompilationTask
plugins {
@@ -14,11 +15,15 @@ apply from: "${rootDir}/gradle/publications.gradle"
antora {
options = [clean: true, fetch: !project.gradle.startParameter.offline, stacktrace: true]
environment = [
'BUILD_REFNAME': 'HEAD',
'BUILD_VERSION': project.version,
'BUILD_REFNAME': 'HEAD',
'BUILD_VERSION': project.version,
]
}
node {
version = '24.15.0'
}
tasks.named("generateAntoraYml") {
asciidocAttributes = project.provider( {
return ["spring-version": project.version ]
@@ -43,40 +48,51 @@ repositories {
}
}
// To avoid a redeclaration error with Kotlin compiler
tasks.named('compileKotlin', KotlinCompilationTask.class) {
javaSources.from = []
// To avoid a redeclaration error with Kotlin compiler and set the JVM target
tasks.withType(KotlinCompilationTask.class).configureEach {
javaSources.from = []
compilerOptions.jvmTarget = JvmTarget.JVM_17
compilerOptions.freeCompilerArgs.addAll(
"-Xjdk-release=17", // Needed due to https://youtrack.jetbrains.com/issue/KT-49746
"-Xannotation-default-target=param-property" // Upcoming default, see https://youtrack.jetbrains.com/issue/KT-73255
)
}
dependencies {
api(project(":spring-aspects"))
api(project(":spring-context"))
api(project(":spring-context-support"))
api(project(":spring-jdbc"))
api(project(":spring-jms"))
api(project(":spring-test"))
api(project(":spring-web"))
api(project(":spring-webflux"))
api(project(":spring-webmvc"))
api(project(":spring-websocket"))
api("com.fasterxml.jackson.core:jackson-databind")
api("com.fasterxml.jackson.module:jackson-module-parameter-names")
api("com.mchange:c3p0:0.9.5.5")
api("com.oracle.database.jdbc:ojdbc11")
api("io.projectreactor.netty:reactor-netty-http")
api("jakarta.jms:jakarta.jms-api")
api("jakarta.servlet:jakarta.servlet-api")
api("jakarta.resource:jakarta.resource-api")
api("jakarta.validation:jakarta.validation-api")
api("jakarta.websocket:jakarta.websocket-client-api")
api("javax.cache:cache-api")
api("org.apache.activemq:activemq-ra:6.1.2")
api("org.apache.commons:commons-dbcp2:2.11.0")
api("org.aspectj:aspectjweaver")
api("org.eclipse.jetty.websocket:jetty-websocket-jetty-api")
api("org.jetbrains.kotlin:kotlin-stdlib")
implementation(project(":spring-aspects"))
implementation(project(":spring-context"))
implementation(project(":spring-context-support"))
implementation(project(":spring-core-test"))
implementation(project(":spring-jdbc"))
implementation(project(":spring-jms"))
implementation(project(":spring-test"))
implementation(project(":spring-web"))
implementation(project(":spring-webflux"))
implementation(project(":spring-webmvc"))
implementation(project(":spring-websocket"))
implementation("com.github.ben-manes.caffeine:caffeine")
implementation("com.mchange:c3p0:0.9.5.5")
implementation("com.oracle.database.jdbc:ojdbc11")
implementation("io.micrometer:context-propagation")
implementation("io.projectreactor.netty:reactor-netty-http")
implementation("jakarta.jms:jakarta.jms-api")
implementation("jakarta.servlet:jakarta.servlet-api")
implementation("jakarta.resource:jakarta.resource-api")
implementation("jakarta.validation:jakarta.validation-api")
implementation("jakarta.websocket:jakarta.websocket-client-api")
implementation("javax.cache:cache-api")
implementation("org.apache.activemq:activemq-ra:6.1.2")
implementation("org.apache.commons:commons-dbcp2:2.11.0")
implementation("org.apache.groovy:groovy-templates")
implementation("org.aspectj:aspectjweaver")
implementation("org.assertj:assertj-core")
implementation("org.eclipse.jetty.websocket:jetty-websocket-jetty-api")
implementation("org.freemarker:freemarker")
implementation("org.jetbrains.kotlin:kotlin-stdlib")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core")
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-reactor")
implementation("org.junit.jupiter:junit-jupiter-api")
implementation("tools.jackson.core:jackson-databind")
implementation("tools.jackson.dataformat:jackson-dataformat-xml")
}
Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 158 KiB

@@ -17,6 +17,7 @@
class="st5"
id="svg5499"
version="1.1"
font-family="Helvetica, Arial, sans-serif"
inkscape:version="0.91 r13725"
sodipodi:docname="mvc-splitted-contexts.svg"
style="font-size:12px;overflow:visible;color-interpolation-filters:sRGB;fill:none;fill-rule:evenodd;stroke-linecap:square;stroke-miterlimit:3"
@@ -36,7 +37,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path9164" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -47,7 +48,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path8836" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -58,7 +59,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path8520" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -69,7 +70,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path8216" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -80,7 +81,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path7924" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -91,7 +92,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path7644" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -102,7 +103,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path7375" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -113,7 +114,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path7119" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -124,7 +125,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path6875" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -135,7 +136,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path6643" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -146,7 +147,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path6423" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -157,7 +158,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path6215" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -168,7 +169,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path6019" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -179,7 +180,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5835" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -190,7 +191,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5663" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -201,7 +202,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5503" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -212,7 +213,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5355" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -223,7 +224,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5219" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -234,7 +235,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path5095" /></marker><marker
inkscape:isstock="true"
style="overflow:visible;"
@@ -245,7 +246,7 @@
inkscape:stockid="Arrow2Mend"><path
transform="scale(0.6) rotate(180) translate(0,0)"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
id="path4983" /></marker><marker
inkscape:stockid="Arrow2Mend"
orient="auto"
@@ -256,7 +257,7 @@
inkscape:isstock="true"
inkscape:collect="always"><path
id="path7394"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(0.6) rotate(180) translate(0,0)" /></marker><marker
inkscape:stockid="Arrow2Lend"
@@ -267,7 +268,7 @@
style="overflow:visible;"
inkscape:isstock="true"><path
id="path8123"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1;fill:#333333;fill-opacity:1"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) rotate(180) translate(1,0)" /></marker><marker
inkscape:stockid="Arrow1Mend"
@@ -279,7 +280,7 @@
inkscape:isstock="true"><path
id="path8035"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#333333;stroke-width:1pt;stroke-opacity:1;fill:#333333;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" /></marker><marker
inkscape:stockid="Arrow1Mend"
orient="auto"
@@ -290,7 +291,7 @@
inkscape:isstock="true"><path
id="path7959"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#333333;stroke-width:1pt;stroke-opacity:1;fill:#333333;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" /></marker><marker
inkscape:stockid="Arrow1Mend"
orient="auto"
@@ -301,7 +302,7 @@
inkscape:isstock="true"><path
id="path7376"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#333333;stroke-width:1pt;stroke-opacity:1;fill:#333333;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" /></marker><marker
inkscape:stockid="Arrow2Lend"
orient="auto"
@@ -311,7 +312,7 @@
style="overflow:visible;"
inkscape:isstock="true"><path
id="path7388"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#000000;stroke-opacity:1"
style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round;stroke:#333333;stroke-opacity:1"
d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
transform="scale(1.1) rotate(180) translate(1,0)" /></marker><marker
inkscape:stockid="Arrow1Lend"
@@ -323,7 +324,7 @@
inkscape:isstock="true"><path
id="path7370"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:#000000;stroke-width:1pt;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#333333;stroke-width:1pt;stroke-opacity:1;fill:#333333;fill-opacity:1"
transform="scale(0.8) rotate(180) translate(12.5,0)" /></marker></defs><sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
@@ -352,9 +353,9 @@
v:viewMarkup="false" /><style
type="text/css"
id="style5501"><![CDATA[
.st1 {fill:#969696;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}
.st2 {fill:#dde2cd;stroke:#000000;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}
.st3 {fill:#000000;font-family:Arial;font-size:2.50001em;font-weight:bold}
.st1 {fill:#969696;stroke:#333333;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}
.st2 {fill:#F8F9FA;stroke:#333333;stroke-linecap:round;stroke-linejoin:round;stroke-width:0.24}
.st3 {fill:#333333;font-family:Helvetica, Arial, sans-serif;font-size:2.50001em;font-weight:bold}
.st4 {font-size:0.333333em;font-weight:normal}
.st5 {fill:none;fill-rule:evenodd;font-size:12;overflow:visible;stroke-linecap:square;stroke-miterlimit:3}
]]></style><g
@@ -363,20 +364,22 @@
v:groupContext="foregroundPage"
id="g5503"
transform="matrix(0.99998201,0,0,1.0824094,-40.812382,-98.908648)"><rect
style="fill:#dde2cd;fill-opacity:1;stroke:#000000;stroke-width:1.53790233;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:#F8F9FA;fill-opacity:1;stroke:#6db33f;stroke-width:2;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect6599"
width="382.68423"
height="146.09897"
x="87.884865"
y="148.26482" /><v:userDefs><v:ud
y="148.26482"
rx="8" /><v:userDefs><v:ud
v:nameU="SchemeName"
v:val="VT4(Default)" /></v:userDefs><rect
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1.53790233;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:none;fill-opacity:1;stroke:#6db33f;stroke-width:2;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect5725"
width="464.31128"
height="374.11411"
x="41.684383"
y="112.3262" /><title
y="112.3262"
rx="8" /><title
id="title5505">Page-1</title><v:pageProperties
v:drawingScale="0.0393701"
v:pageScale="0.0393701"
@@ -385,15 +388,16 @@
v:shadowOffsetY="-8.50394" /><v:layer
v:name="Connector"
v:index="0" /><rect
style="fill:#dde2cd;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:1.53790233;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:#F8F9FA;fill-opacity:1;fill-rule:evenodd;stroke:#6db33f;stroke-width:2;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect5715"
width="322.8194"
height="43.63184"
x="119.95335"
y="-135.66222"
transform="scale(1,-1)" /><text
transform="scale(1,-1)"
rx="8" /><text
xml:space="preserve"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30.7580471px;line-height:125%;font-family:sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="168.843"
y="124.32391"
id="text5717"
@@ -401,12 +405,12 @@
transform="scale(1.0403984,0.96117025)"><tspan
sodipodi:role="line"
id="tspan5719"
x="168.843"
x="172.843"
y="124.32391"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:sans-serif;-inkscape-font-specification:sans-serif">DispatcherServlet</tspan></text>
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;fill:#333333">DispatcherServlet</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="89.770851"
y="181.20923"
id="text6589"
@@ -414,12 +418,12 @@
transform="scale(1.0403984,0.96117025)"><tspan
sodipodi:role="line"
id="tspan6591"
x="89.770851"
x="106.770851"
y="181.20923"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:sans-serif;-inkscape-font-specification:sans-serif">Servlet WebApplicationContext</tspan></text>
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;fill:#333333">Servlet WebApplicationContext</tspan></text>
<text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="260.00443"
y="198.41273"
id="text6593"
@@ -429,36 +433,39 @@
id="tspan6595"
x="260.00443"
y="198.41273"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle">(containing controllers, view resolvers,</tspan><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle;fill:#555555">(containing controllers, view resolvers,</tspan><tspan
sodipodi:role="line"
x="260.00443"
y="212.83057"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle;fill:#555555"
id="tspan6597">and other web-related beans)</tspan></text>
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.86203903;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect6620"
width="82.040657"
height="36.72575"
x="114.52653"
y="-259.43161"
transform="scale(1,-1)" /><rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.89166164;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
transform="scale(1,-1)"
rx="4" /><rect
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect6622"
width="87.843979"
height="36.697304"
x="223.39864"
y="-287.19809"
transform="scale(1,-1)" /><rect
transform="scale(1,-1)"
rx="4" /><rect
transform="scale(1,-1)"
y="-264.81918"
x="117.92834"
height="36.72575"
width="82.040657"
id="rect6614"
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.86203903;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1" /><text
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
rx="4" /><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="121.24728"
y="260.14957"
id="text6616"
@@ -466,20 +473,20 @@
transform="scale(1.0403984,0.96117025)"><tspan
sodipodi:role="line"
id="tspan6618"
x="121.24728"
x="124.24728"
y="260.14957"
style="font-size:11.53426838px">Controllers</tspan></text>
style="font-size:11.53426838px;fill:#333333">Controllers</tspan></text>
<text
transform="scale(1.0403984,0.96117025)"
sodipodi:linespacing="125%"
id="text6624"
y="282.70709"
x="219.61203"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:11.53426838px"
style="font-size:11.53426838px;fill:#333333"
y="282.70709"
x="219.61203"
x="221.61203"
id="tspan6626"
sodipodi:role="line">ViewResolver</tspan></text>
<rect
@@ -489,9 +496,10 @@
height="36.577778"
width="114.4539"
id="rect6628"
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:1.0161339;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1" /><text
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
rx="4" /><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="327.51276"
y="255.28464"
id="text6630"
@@ -499,26 +507,27 @@
transform="scale(1.0403984,0.96117025)"><tspan
sodipodi:role="line"
id="tspan6632"
x="327.51276"
x="332.51276"
y="255.28464"
style="font-size:11.53426838px">HandlerMapping</tspan></text>
style="font-size:11.53426838px;fill:#333333">HandlerMapping</tspan></text>
<rect
y="338.69724"
x="87.803261"
height="121.5683"
width="382.84744"
id="rect6634"
style="fill:#dde2cd;fill-opacity:1;stroke:#000000;stroke-width:1.53790233;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1" /><text
style="fill:#F8F9FA;fill-opacity:1;stroke:#6db33f;stroke-width:2;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
rx="8" /><text
transform="scale(1.0403984,0.96117025)"
sodipodi:linespacing="125%"
id="text6636"
y="376.61673"
x="108.61351"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:sans-serif;-inkscape-font-specification:sans-serif"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:23.06853676px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;fill:#333333"
y="376.61673"
x="108.61351"
x="113.61351"
id="tspan6638"
sodipodi:role="line">Root WebApplicationContext</tspan></text>
<text
@@ -527,10 +536,10 @@
id="text6640"
y="395.35812"
x="260.93863"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
id="tspan6644"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle;fill:#555555"
y="395.35812"
x="260.93863"
sodipodi:role="line">(containing middle-tier services, datasources, etc.)</tspan></text>
@@ -541,43 +550,47 @@
height="36.72575"
width="82.040657"
id="rect6648"
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.86203903;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1" /><rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.86203903;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
rx="4" /><rect
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect6650"
width="82.040657"
height="36.72575"
x="167.73116"
y="-445.45563"
transform="scale(1,-1)" /><text
transform="scale(1,-1)"
rx="4" /><text
transform="scale(1.0403984,0.96117025)"
sodipodi:linespacing="125%"
id="text6652"
y="448.55054"
x="175.87148"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
xml:space="preserve"><tspan
style="font-size:11.53426838px"
style="font-size:11.53426838px;fill:#333333"
y="448.55054"
x="175.87148"
x="178.87148"
id="tspan6654"
sodipodi:role="line">Services</tspan></text>
<rect
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.88435173;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
id="rect6656"
width="86.393044"
height="36.704323"
x="306.86328"
y="-439.60837"
transform="scale(1,-1)" /><rect
transform="scale(1,-1)"
rx="4" /><rect
transform="scale(1,-1)"
y="-444.99475"
x="310.26624"
height="36.701977"
width="86.876686"
id="rect6658"
style="fill:#ffffff;fill-opacity:1;stroke:#000000;stroke-width:0.88679528;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1" /><text
style="fill:#ffffff;fill-opacity:1;stroke:#6db33f;stroke-width:1.5;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1"
rx="4" /><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="305.30771"
y="448.55054"
id="text6660"
@@ -585,20 +598,20 @@
transform="scale(1.0403984,0.96117025)"><tspan
sodipodi:role="line"
id="tspan6662"
x="305.30771"
x="308.30771"
y="448.55054"
style="font-size:11.53426838px">Repositories</tspan></text>
style="font-size:11.53426838px;fill:#333333">Repositories</tspan></text>
<path
style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.76895118px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="fill:none;fill-rule:evenodd;stroke:#333333;stroke-width:0.76895118px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 265.33234,295.60379 c 0,42.65169 0,42.65169 0,0 z"
id="path7643"
inkscape:connector-curvature="0" /><path
style="fill:#000000;fill-opacity:1;fill-rule:evenodd;stroke:#000000;stroke-width:3.46028023;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow2Mend)"
style="fill:#333333;fill-opacity:1;fill-rule:evenodd;stroke:#333333;stroke-width:3.46028023;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:3;stroke-dasharray:none;stroke-opacity:1;marker-end:url(#Arrow2Mend)"
d="m 270.43505,294.70585 c 0,39.4721 0,39.87903 0,39.87903"
id="path7645"
inkscape:connector-curvature="0" /><text
xml:space="preserve"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Sans;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
style="font-style:normal;font-weight:normal;font-size:30.7580471px;line-height:125%;font-family:Helvetica, Arial, sans-serif;letter-spacing:0px;word-spacing:0px;fill:#333333;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
x="352.55331"
y="333.03622"
id="text4963"
@@ -607,6 +620,6 @@
sodipodi:role="line"
x="352.55331"
y="333.03622"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle"
style="font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;font-size:11.53426838px;font-family:Helvetica, Arial, sans-serif;-inkscape-font-specification:sans-serif;text-align:center;text-anchor:middle;fill:#555555"
id="tspan4965">Delegates if no bean found</tspan></text>
</g></svg>

Before

Width:  |  Height:  |  Size: 30 KiB

After

Width:  |  Height:  |  Size: 31 KiB

+18 -8
View File
@@ -32,6 +32,7 @@
**** xref:core/beans/java/bean-annotation.adoc[]
**** xref:core/beans/java/configuration-annotation.adoc[]
**** xref:core/beans/java/composing-configuration-classes.adoc[]
**** xref:core/beans/java/programmatic-bean-registration.adoc[]
*** xref:core/beans/environment.adoc[]
*** xref:core/beans/context-load-time-weaver.adoc[]
*** xref:core/beans/context-introduction.adoc[]
@@ -39,8 +40,8 @@
** xref:core/resources.adoc[]
** xref:core/validation.adoc[]
*** xref:core/validation/validator.adoc[]
*** xref:core/validation/beans-beans.adoc[]
*** xref:core/validation/conversion.adoc[]
*** xref:core/validation/data-binding.adoc[]
*** xref:core/validation/error-code-resolution.adoc[]
*** xref:core/validation/convert.adoc[]
*** xref:core/validation/format.adoc[]
*** xref:core/validation/format-configuring-formatting-globaldatetimeformat.adoc[]
@@ -99,6 +100,7 @@
*** xref:core/aop-api/autoproxy.adoc[]
*** xref:core/aop-api/targetsource.adoc[]
*** xref:core/aop-api/extensibility.adoc[]
** xref:core/resilience.adoc[]
** xref:core/null-safety.adoc[]
** xref:core/databuffer-codec.adoc[]
** xref:core/aot.adoc[]
@@ -195,7 +197,10 @@
*** xref:web/webmvc-functional.adoc[]
*** xref:web/webmvc/mvc-uri-building.adoc[]
*** xref:web/webmvc/mvc-ann-async.adoc[]
*** xref:web/webmvc/mvc-range.adoc[]
*** xref:web/webmvc/mvc-data-binding.adoc[]
*** xref:web/webmvc-cors.adoc[]
*** xref:web/webmvc-versioning.adoc[]
*** xref:web/webmvc/mvc-ann-rest-exceptions.adoc[]
*** xref:web/webmvc/mvc-security.adoc[]
*** xref:web/webmvc/mvc-caching.adoc[]
@@ -224,6 +229,7 @@
**** xref:web/webmvc/mvc-config/static-resources.adoc[]
**** xref:web/webmvc/mvc-config/default-servlet-handler.adoc[]
**** xref:web/webmvc/mvc-config/path-matching.adoc[]
**** xref:web/webmvc/mvc-config/api-version.adoc[]
**** xref:web/webmvc/mvc-config/advanced-java.adoc[]
**** xref:web/webmvc/mvc-config/advanced-xml.adoc[]
*** xref:web/webmvc/mvc-http2.adoc[]
@@ -256,7 +262,6 @@
**** xref:web/websocket/stomp/configuration-performance.adoc[]
**** xref:web/websocket/stomp/stats.adoc[]
**** xref:web/websocket/stomp/testing.adoc[]
** xref:web/integration.adoc[]
* xref:web-reactive.adoc[]
** xref:web/webflux.adoc[]
*** xref:web/webflux/new-framework.adoc[]
@@ -290,7 +295,10 @@
**** xref:web/webflux/controller/ann-advice.adoc[]
*** xref:web/webflux-functional.adoc[]
*** xref:web/webflux/uri-building.adoc[]
*** xref:web/webflux/range.adoc[]
*** xref:web/webflux/data-binding.adoc[]
*** xref:web/webflux-cors.adoc[]
*** xref:web/webflux-versioning.adoc[]
*** xref:web/webflux/ann-rest-exceptions.adoc[]
*** xref:web/webflux/security.adoc[]
*** xref:web/webflux/caching.adoc[]
@@ -307,7 +315,7 @@
*** xref:web/webflux-webclient/client-context.adoc[]
*** xref:web/webflux-webclient/client-synchronous.adoc[]
*** xref:web/webflux-webclient/client-testing.adoc[]
** xref:web/webflux-http-interface-client.adoc[]
** xref:web/webflux-http-service-client.adoc[]
** xref:web/webflux-websocket.adoc[]
** xref:web/webflux-test.adoc[]
** xref:rsocket.adoc[]
@@ -324,9 +332,10 @@
*** xref:testing/testcontext-framework/application-events.adoc[]
*** xref:testing/testcontext-framework/test-execution-events.adoc[]
*** xref:testing/testcontext-framework/ctx-management.adoc[]
**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[]
**** xref:testing/testcontext-framework/ctx-management/xml.adoc[]
**** xref:testing/testcontext-framework/ctx-management/groovy.adoc[]
**** xref:testing/testcontext-framework/ctx-management/javaconfig.adoc[]
**** xref:testing/testcontext-framework/ctx-management/default-config.adoc[]
**** xref:testing/testcontext-framework/ctx-management/mixed-config.adoc[]
**** xref:testing/testcontext-framework/ctx-management/context-customizers.adoc[]
**** xref:testing/testcontext-framework/ctx-management/initializers.adoc[]
@@ -337,6 +346,7 @@
**** xref:testing/testcontext-framework/ctx-management/web.adoc[]
**** xref:testing/testcontext-framework/ctx-management/web-mocks.adoc[]
**** xref:testing/testcontext-framework/ctx-management/caching.adoc[]
**** xref:testing/testcontext-framework/ctx-management/context-pausing.adoc[]
**** xref:testing/testcontext-framework/ctx-management/failure-threshold.adoc[]
**** xref:testing/testcontext-framework/ctx-management/hierarchies.adoc[]
*** xref:testing/testcontext-framework/fixture-di.adoc[]
@@ -348,6 +358,7 @@
*** xref:testing/testcontext-framework/support-classes.adoc[]
*** xref:testing/testcontext-framework/aot.adoc[]
** xref:testing/webtestclient.adoc[]
** xref:testing/resttestclient.adoc[]
** xref:testing/mockmvc.adoc[]
*** xref:testing/mockmvc/overview.adoc[]
*** xref:testing/mockmvc/setup-options.adoc[]
@@ -431,8 +442,8 @@
*** xref:integration/cache/plug.adoc[]
*** xref:integration/cache/specific-config.adoc[]
** xref:integration/observability.adoc[]
** xref:integration/aot-cache.adoc[]
** xref:integration/checkpoint-restore.adoc[]
** xref:integration/cds.adoc[]
** xref:integration/appendix.adoc[]
* xref:languages.adoc[]
** xref:languages/kotlin.adoc[]
@@ -441,14 +452,13 @@
*** xref:languages/kotlin/null-safety.adoc[]
*** xref:languages/kotlin/classes-interfaces.adoc[]
*** xref:languages/kotlin/annotations.adoc[]
*** xref:languages/kotlin/bean-definition-dsl.adoc[]
*** xref:languages/kotlin/bean-registration-dsl.adoc[]
*** xref:languages/kotlin/web.adoc[]
*** xref:languages/kotlin/coroutines.adoc[]
*** xref:languages/kotlin/spring-projects-in.adoc[]
*** xref:languages/kotlin/getting-started.adoc[]
*** xref:languages/kotlin/resources.adoc[]
** xref:languages/groovy.adoc[]
** xref:languages/dynamic.adoc[]
* xref:appendix.adoc[]
* {spring-framework-docs-root}/{spring-version}/javadoc-api/[Java API,window=_blank, role=link-external]
* {spring-framework-api-kdoc}/[Kotlin API,window=_blank, role=link-external]
@@ -74,6 +74,11 @@ expressions used in XML bean definitions, `@Value`, etc.
| The mode to use when compiling expressions for the
xref:core/expressions/evaluation.adoc#expressions-compiler-configuration[Spring Expression Language].
| `spring.expression.maxOperations`
| The default maximum number of operations permitted during
xref:core/expressions/evaluation.adoc#expressions-parser-configuration[Spring Expression Language]
expression evaluation.
| `spring.getenv.ignore`
| Instructs Spring to ignore operating system environment variables if a Spring
`Environment` property -- for example, a placeholder in a configuration String -- isn't
@@ -81,6 +86,11 @@ resolvable otherwise. See
{spring-framework-api}++/core/env/AbstractEnvironment.html#IGNORE_GETENV_PROPERTY_NAME++[`AbstractEnvironment`]
for details.
| `spring.http.response.flush.enabled`
| Configures the Spring MVC `ServletServerHttpResponse` to allow flushing on the `OutputStream`
returned by `ServletServerHttpResponse#getBody()`. By default, such flush calls are ignored and
only `ServletServerHttpResponse#flush()` will actually flush the response to the network.
| `spring.jdbc.getParameterType.ignore`
| Instructs Spring to ignore `java.sql.ParameterMetaData.getParameterType` completely.
See the note in xref:data-access/jdbc/advanced.adoc#jdbc-batch-list[Batch Operations with a List of Objects].
@@ -92,11 +102,25 @@ the repeated JNDI lookup overhead. See
{spring-framework-api}++/jndi/JndiLocatorDelegate.html#IGNORE_JNDI_PROPERTY_NAME++[`JndiLocatorDelegate`]
for details.
| `spring.locking.strict`
| Instructs Spring to enforce strict locking during bean creation, rather than the mix of
strict and lenient locking that 6.2 applies by default. See
{spring-framework-api}++/beans/factory/support/DefaultListableBeanFactory.html#STRICT_LOCKING_PROPERTY_NAME++[`DefaultListableBeanFactory`]
for details.
| `spring.objenesis.ignore`
| Instructs Spring to ignore Objenesis, not even attempting to use it. See
{spring-framework-api}++/objenesis/SpringObjenesis.html#IGNORE_OBJENESIS_PROPERTY_NAME++[`SpringObjenesis`]
for details.
| `spring.placeholder.escapeCharacter.default`
| The default escape character for property placeholder support. If not set, `'\'` will
be used. Can be set to a custom escape character or an empty string to disable support
for an escape character. The default escape character be explicitly overridden in
`PropertySourcesPlaceholderConfigurer` and subclasses of `AbstractPropertyResolver`. See
{spring-framework-api}++/core/env/AbstractPropertyResolver.html#DEFAULT_PLACEHOLDER_ESCAPE_CHARACTER_PROPERTY_NAME++[`AbstractPropertyResolver`]
for details.
| `spring.test.aot.processing.failOnError`
| A boolean flag that controls whether errors encountered during AOT processing in the
_Spring TestContext Framework_ should result in an exception that fails the overall process.
@@ -110,11 +134,20 @@ on a test class. See xref:testing/annotations/integration-junit-jupiter.adoc#int
| The maximum size of the context cache in the _Spring TestContext Framework_. See
xref:testing/testcontext-framework/ctx-management/caching.adoc[Context Caching].
| `spring.test.context.cache.pause`
| The pause mode for the context cache in the _Spring TestContext Framework_. See
xref:testing/testcontext-framework/ctx-management/context-pausing.adoc[Context Pausing].
| `spring.test.context.failure.threshold`
| The failure threshold for errors encountered while attempting to load an `ApplicationContext`
in the _Spring TestContext Framework_. See
xref:testing/testcontext-framework/ctx-management/failure-threshold.adoc[Context Failure Threshold].
| `spring.test.extension.context.scope`
| The default _extension context scope_ used by the `SpringExtension` in `@Nested` test
class hierarchies. See
xref:testing/annotations/integration-junit-jupiter.adoc#integration-testing-annotations-springextensionconfig[`@SpringExtensionConfig`].
| `spring.test.enclosing.configuration`
| The default _enclosing configuration inheritance mode_ to use if
`@NestedTestConfiguration` is not present on a test class. See
@@ -17,14 +17,3 @@ is also provided.
AOT processing can be used to optimize your application ahead-of-time. It is typically
used for native image deployment using GraalVM.
@@ -6,7 +6,3 @@ The previous chapter described the Spring's support for AOP with @AspectJ and sc
aspect definitions. In this chapter, we discuss the lower-level Spring AOP APIs. For common
applications, we recommend the use of Spring AOP with AspectJ pointcuts as described in the
previous chapter.
@@ -4,7 +4,6 @@
Now we can examine how Spring AOP handles advice.
[[aop-api-advice-lifecycle]]
== Advice Lifecycles
@@ -22,14 +21,12 @@ the advice adds state to the proxied object.
You can use a mix of shared and per-instance advice in the same AOP proxy.
[[aop-api-advice-types]]
== Advice Types in Spring
Spring provides several advice types and is extensible to support
arbitrary advice types. This section describes the basic concepts and standard advice types.
[[aop-api-advice-around]]
=== Interception Around Advice
@@ -101,7 +98,6 @@ you are likely to want to run the aspect in another AOP framework. Note that poi
are not currently interoperable between frameworks, and the AOP Alliance does not
currently define pointcut interfaces.
[[aop-api-advice-before]]
=== Before Advice
@@ -168,7 +164,6 @@ Kotlin::
TIP: Before advice can be used with any pointcut.
[[aop-api-advice-throws]]
=== Throws Advice
@@ -297,7 +292,6 @@ exception that is incompatible with the target method's signature!_
TIP: Throws advice can be used with any pointcut.
[[aop-api-advice-after-returning]]
=== After Returning Advice
@@ -361,7 +355,6 @@ thrown up the interceptor chain instead of the return value.
TIP: After returning advice can be used with any pointcut.
[[aop-api-advice-introduction]]
=== Introduction Advice
@@ -501,7 +494,6 @@ Java::
}
return super.invoke(invocation);
}
}
----
@@ -531,7 +523,6 @@ Kotlin::
}
return super.invoke(invocation)
}
}
----
======
@@ -582,8 +573,3 @@ We can apply this advisor programmatically by using the `Advised.addAdvisor()` m
(the recommended way) in XML configuration, as any other advisor. All proxy creation
choices discussed below, including "`auto proxy creators,`" correctly handle introductions
and stateful mixins.
@@ -142,7 +142,3 @@ case, the `Advised` `isFrozen()` method returns `true`, and any attempts to modi
advice through addition or removal results in an `AopConfigException`. The ability
to freeze the state of an advised object is useful in some cases (for example, to
prevent calling code removing a security interceptor).
@@ -14,7 +14,3 @@ It is possible to mix advisor and advice types in Spring in the same AOP proxy.
example, you could use an interception around advice, throws advice, and before advice in
one proxy configuration. Spring automatically creates the necessary interceptor
chain.
@@ -19,14 +19,12 @@ There are two ways to do this:
auto-proxy creation driven by source-level metadata attributes.
[[aop-autoproxy-choices]]
== Auto-proxy Bean Definitions
This section covers the auto-proxy creators provided by the
`org.springframework.aop.framework.autoproxy` package.
[[aop-api-autoproxy]]
=== `BeanNameAutoProxyCreator`
@@ -61,7 +59,6 @@ automatically created by the `BeanNameAutoProxyCreator`. The same advice is appl
to all matching beans. Note that, if advisors are used (rather than the interceptor in
the preceding example), the pointcuts may apply differently to different beans.
[[aop-api-autoproxy-default]]
=== `DefaultAdvisorAutoProxyCreator`
@@ -125,7 +122,3 @@ differently configured, AdvisorAutoProxyCreators in the same factory) and orderi
Advisors can implement the `org.springframework.core.Ordered` interface to ensure
correct ordering if this is an issue. The `TransactionAttributeSourceAdvisor` used in the
preceding example has a configurable order value. The default setting is unordered.
@@ -65,7 +65,3 @@ that, if you have a (parent) bean definition that you intend to use only as a te
and this definition specifies a class, you must make sure to set the `abstract`
attribute to `true`. Otherwise, the application context actually tries to
pre-instantiate it.
@@ -14,7 +14,6 @@ the pointcuts, any advice that applies, and their ordering. However, there are s
options that are preferable if you do not need such control.
[[aop-pfb-1]]
== Basics
@@ -32,7 +31,6 @@ application objects (besides the target, which should be available in any AOP
framework), benefiting from all the pluggability provided by Dependency Injection.
[[aop-pfb-2]]
== JavaBean Properties
@@ -87,7 +85,6 @@ to be applied. You can find an example of using this feature in xref:core/aop-ap
`false`.
[[aop-pfb-proxy-types]]
== JDK- and CGLIB-based proxies
@@ -137,7 +134,6 @@ interface that the target class implements to the `proxyInterfaces` property. Ho
it is significantly less work and less prone to typographical errors.
[[aop-api-proxying-intf]]
== Proxying Interfaces
@@ -263,7 +259,6 @@ However, there are times when being able to obtain the un-advised target from th
factory might actually be an advantage (for example, in certain test scenarios).
[[aop-api-proxying-class]]
== Proxying Classes
@@ -302,7 +297,6 @@ There is little performance difference between CGLIB proxies and dynamic proxies
Performance should not be a decisive consideration in this case.
[[aop-global-advisors]]
== Using "`Global`" Advisors
@@ -325,7 +319,3 @@ two global advisors:
<bean id="global_debug" class="org.springframework.aop.interceptor.DebugInterceptor"/>
<bean id="global_performance" class="org.springframework.aop.interceptor.PerformanceMonitorInterceptor"/>
----
@@ -4,7 +4,6 @@
This section describes how Spring handles the crucial pointcut concept.
[[aop-api-concepts]]
== Concepts
@@ -69,7 +68,6 @@ TIP: If possible, try to make pointcuts static, allowing the AOP framework to ca
results of pointcut evaluation when an AOP proxy is created.
[[aop-api-pointcut-ops]]
== Operations on Pointcuts
@@ -84,7 +82,6 @@ You can compose pointcuts by using the static methods in the
expressions is usually a simpler approach.
[[aop-api-pointcuts-aspectj]]
== AspectJ Expression Pointcuts
@@ -95,14 +92,12 @@ uses an AspectJ-supplied library to parse an AspectJ pointcut expression string.
See the xref:core/aop.adoc[previous chapter] for a discussion of supported AspectJ pointcut primitives.
[[aop-api-pointcuts-impls]]
== Convenience Pointcut Implementations
Spring provides several convenient pointcut implementations. You can use some of them
directly; others are intended to be subclassed in application-specific pointcuts.
[[aop-api-pointcuts-static]]
=== Static Pointcuts
@@ -146,7 +141,6 @@ You can use `RegexpMethodPointcutAdvisor` with any `Advice` type.
An important type of static pointcut is a metadata-driven pointcut. This uses the
values of metadata attributes (typically, source-level metadata).
[[aop-api-pointcuts-dynamic]]
=== Dynamic pointcuts
@@ -172,7 +166,6 @@ other dynamic pointcuts. In Java 1.4, the cost is about five times that of other
pointcuts.
[[aop-api-pointcuts-superclasses]]
== Pointcut Superclasses
@@ -214,7 +207,6 @@ There are also superclasses for dynamic pointcuts.
You can use custom pointcuts with any advice type.
[[aop-api-pointcuts-custom]]
== Custom Pointcuts
@@ -225,7 +217,3 @@ expression language, if you can.
NOTE: Later versions of Spring may offer support for "`semantic pointcuts`" as offered by JAC --
for example, "`all methods that change instance variables in the target object.`"
@@ -22,7 +22,6 @@ rather than a singleton bean definition. This allows Spring to create a new targ
instance when required.
[[aop-ts-swap]]
== Hot-swappable Target Sources
@@ -77,7 +76,6 @@ use a `TargetSource`), any `TargetSource` can be used in conjunction with
arbitrary advice.
[[aop-ts-pool]]
== Pooling Target Sources
@@ -89,14 +87,12 @@ A crucial difference between Spring pooling and SLSB pooling is that Spring pool
be applied to any POJO. As with Spring in general, this service can be applied in a
non-invasive way.
Spring provides support for Commons Pool 2.2, which provides a
Spring provides support for Commons Pool 2, which provides a
fairly efficient pooling implementation. You need the `commons-pool` Jar on your
application's classpath to use this feature. You can also subclass
`org.springframework.aop.target.AbstractPoolingTargetSource` to support any other
pooling API.
NOTE: Commons Pool 1.5+ is also supported but is deprecated as of Spring Framework 4.2.
The following listing shows an example configuration:
[source,xml,indent=0,subs="verbatim,quotes"]
@@ -175,7 +171,6 @@ Simpler pooling is available by using auto-proxying. You can set the `TargetSour
used by any auto-proxy creator.
[[aop-ts-prototype]]
== Prototype Target Sources
@@ -200,7 +195,6 @@ The only property is the name of the target bean. Inheritance is used in the
source, the target bean must be a prototype bean definition.
[[aop-ts-threadlocal]]
== `ThreadLocal` Target Sources
@@ -226,7 +220,3 @@ always remember to correctly set and unset (where the latter involves a call to
any case, since not unsetting it might result in problematic behavior. Spring's
`ThreadLocal` support does this for you and should always be considered in favor of using
`ThreadLocal` instances without other proper handling code.
@@ -32,7 +32,3 @@ AOP is used in the Spring Framework to:
NOTE: If you are interested only in generic declarative services or other pre-packaged
declarative middleware services such as pooling, you do not need to work directly with
Spring AOP, and can skip most of this chapter.
@@ -53,7 +53,3 @@ Kotlin::
======
See the {spring-framework-api}/aop/aspectj/annotation/AspectJProxyFactory.html[javadoc] for more information.
@@ -11,6 +11,3 @@ there is no dependency on the AspectJ compiler or weaver.
NOTE: Using the AspectJ compiler and weaver enables use of the full AspectJ language and
is discussed in xref:core/aop/using-aspectj.adoc[Using AspectJ with Spring Applications].
@@ -727,7 +727,7 @@ of determining parameter names, an exception will be thrown.
parameter names. This discoverer is only used if such APIs are present on the classpath.
`StandardReflectionParameterNameDiscoverer` :: Uses the standard `java.lang.reflect.Parameter`
API to determine parameter names. Requires that code be compiled with the `-parameters`
flag for `javac`. Recommended approach on Java 8+.
flag for `javac`. Recommended approach.
`AspectJAdviceParameterNameDiscoverer` :: Deduces parameter names from the pointcut
expression, `returning`, and `throwing` clauses. See the
{spring-framework-api}/aop/aspectj/AspectJAdviceParameterNameDiscoverer.html[javadoc]
@@ -937,5 +937,3 @@ reflection for javac-compiled classes). Consider collapsing such advice methods
advice method per join point in each `@Aspect` class or refactor the pieces of advice into
separate `@Aspect` classes that you can order at the aspect level via `Ordered` or `@Order`.
====
@@ -32,6 +32,3 @@ stereotype annotation that qualifies, as per the rules of Spring's component sca
NOTE: In Spring AOP, aspects themselves cannot be the targets of advice from other
aspects. The `@Aspect` annotation on a class marks it as an aspect and, hence, excludes
it from auto-proxying.
@@ -18,7 +18,8 @@ call `proceed` multiple times. The following listing shows the basic aspect impl
include-code::./ConcurrentOperationExecutor[tag=snippet,indent=0]
`@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions].
`@Around("com.xyz.CommonPointcuts.businessService()")` references the `businessService` named pointcut defined in
xref:core/aop/ataspectj/pointcuts.adoc#aop-common-pointcuts[Sharing Named Pointcut Definitions].
Note that the aspect implements the `Ordered` interface so that we can set the precedence of
the aspect higher than the transaction advice (we want a fresh transaction each time we
@@ -60,6 +60,3 @@ Programming Guide for more information on `per` clauses.
The `pertarget` instantiation model works in exactly the same way as `perthis`, but it
creates one aspect instance for each unique target object at matched join points.
@@ -75,5 +75,3 @@ Kotlin::
val usageTracked = context.getBean<UsageTracked>("myService")
----
======
@@ -104,7 +104,7 @@ Note that pointcut definitions are generally matched against any intercepted met
If a pointcut is strictly meant to be public-only, even in a CGLIB proxy scenario with
potential non-public interactions through proxies, it needs to be defined accordingly.
If your interception needs include method calls or even constructors within the target
If your interception needs to include method calls or even constructors within the target
class, consider the use of Spring-driven xref:core/aop/using-aspectj.adoc#aop-aj-ltw[native AspectJ weaving] instead
of Spring's proxy-based AOP framework. This constitutes a different mode of AOP usage
with different characteristics, so be sure to make yourself familiar with weaving
@@ -581,6 +581,3 @@ performance (time and memory used), due to extra processing and analysis. Scopin
designators are very fast to match, and using them means AspectJ can very quickly
dismiss groups of join points that should not be further processed. A good
pointcut should always include one if possible.
@@ -8,7 +8,6 @@ decisions are influenced by a number of factors including application requiremen
development tools, and team familiarity with AOP.
[[aop-spring-or-aspectj]]
== Spring AOP or Full AspectJ?
@@ -31,7 +30,6 @@ the @AspectJ style, sticking with regular Java compilation in your IDE, and addi
an aspect weaving phase to your build script.
[[aop-ataspectj-or-xml]]
== @AspectJ or XML for Spring AOP?
@@ -107,7 +105,3 @@ Spring AOP and by AspectJ. So, if you later decide you need the capabilities of
to implement additional requirements, you can easily migrate to a classic AspectJ setup.
In general, the Spring team prefers the @AspectJ style for custom aspects beyond simple
configuration of enterprise services.
@@ -73,7 +73,3 @@ it from older technologies offering only interception. Pointcuts enable advice t
targeted independently of the object-oriented hierarchy. For example, you can apply an
around advice providing declarative transaction management to a set of methods that span
multiple objects (such as all business operations in the service layer).
@@ -14,9 +14,5 @@ need to advise a method that is not declared on an interface or where you need t
pass a proxied object to a method as a concrete type.
It is important to grasp the fact that Spring AOP is proxy-based. See
xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies] for a thorough examination of exactly what this
implementation detail actually means.
xref:core/aop/proxying.adoc#aop-understanding-aop-proxies[Understanding AOP Proxies]
for a thorough examination of exactly what this implementation detail actually means.
@@ -52,10 +52,6 @@ configuration-style approach. The fact that this chapter chooses to introduce th
@AspectJ-style approach first should not be taken as an indication that the Spring team
favors the @AspectJ annotation-style approach over the Spring XML configuration-style.
See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more complete discussion of the advantages and disadvantages of
each style.
See xref:core/aop/choosing.adoc[Choosing which AOP Declaration Style to Use] for a more
complete discussion of the advantages and disadvantages of each style.
====
@@ -6,7 +6,3 @@ It is perfectly possible to mix @AspectJ style aspects by using the auto-proxyin
schema-defined `<aop:aspect>` aspects, `<aop:advisor>` declared advisors, and even proxies
and interceptors in other styles in the same configuration. All of these are implemented
by using the same underlying support mechanism and can co-exist without any difficulty.
@@ -28,6 +28,10 @@ you can do so. However, you should consider the following issues:
deploying on the module path. Such cases require a JVM bootstrap flag
`--add-opens=java.base/java.lang=ALL-UNNAMED` which is not available for modules.
[[aop-forcing-proxy-types]]
== Forcing Specific AOP Proxy Types
To force the use of CGLIB proxies, set the value of the `proxy-target-class` attribute
of the `<aop:config>` element to true, as follows:
@@ -60,6 +64,23 @@ To be clear, using `proxy-target-class="true"` on `<tx:annotation-driven/>`,
proxies _for all three of them_.
====
`@EnableAspectJAutoProxy`, `@EnableTransactionManagement` and related configuration
annotations offer a corresponding `proxyTargetClass` attribute. These are collapsed
into a single unified auto-proxy creator too, effectively applying the _strongest_
proxy settings at runtime. As of 7.0, this applies to individual proxy processors
as well, for example `@EnableAsync`, consistently participating in unified global
default settings for all auto-proxying attempts in a given application.
The global default proxy type may differ between setups. While the core framework
suggests interface-based proxies by default, Spring Boot may - depending on
configuration properties - enable class-based proxies by default.
As of 7.0, forcing a specific proxy type for individual beans is possible through
the `@Proxyable` annotation on a given `@Bean` method or `@Component` class, with
`@Proxyable(INTERFACES)` or `@Proxyable(TARGET_CLASS)` overriding any globally
configured default. For very specific purposes, you may even specify the proxy
interface(s) to use through `@Proxyable(interfaces=...)`, limiting the exposure
to selected interfaces rather than all interfaces that the target bean implements.
[[aop-understanding-aop-proxies]]
@@ -291,4 +312,3 @@ Kotlin::
NOTE: AspectJ compile-time weaving and load-time weaving do not have this self-invocation
issue because they apply advice within the bytecode instead of via a proxy.
@@ -26,7 +26,6 @@ use either only the `<aop:config>` style or only the `AutoProxyCreator` style an
never mix them.
[[aop-schema-declaring-an-aspect]]
== Declaring an Aspect
@@ -54,7 +53,6 @@ The bean that backs the aspect (`aBean` in this case) can of course be configure
dependency injected just like any other Spring bean.
[[aop-schema-pointcuts]]
== Declaring a Pointcut
@@ -177,9 +175,7 @@ follows:
Note that pointcuts defined in this way are referred to by their XML `id` and cannot be
used as named pointcuts to form composite pointcuts. The named pointcut support in the
schema-based definition style is thus more limited than that offered by the @AspectJ
style.
schema-based definition style is thus more limited than that offered by the @AspectJ style.
[[aop-schema-advice]]
@@ -188,7 +184,6 @@ style.
The schema-based AOP support uses the same five kinds of advice as the @AspectJ style, and they have
exactly the same semantics.
[[aop-schema-advice-before]]
=== Before Advice
@@ -237,7 +232,6 @@ that contains the advice. Before a data access operation is performed (a method
join point matched by the pointcut expression), the `doAccessCheck` method on the aspect
bean is invoked.
[[aop-schema-advice-after-returning]]
=== After Returning Advice
@@ -295,7 +289,6 @@ Kotlin::
----
======
[[aop-schema-advice-after-throwing]]
=== After Throwing Advice
@@ -353,7 +346,6 @@ Kotlin::
----
======
[[aop-schema-advice-after-finally]]
=== After (Finally) Advice
@@ -372,7 +364,6 @@ You can declare it by using the `after` element, as the following example shows:
</aop:aspect>
----
[[aop-schema-advice-around]]
=== Around Advice
@@ -444,17 +435,18 @@ Kotlin::
----
======
[[aop-schema-params]]
=== Advice Parameters
The schema-based declaration style supports fully typed advice in the same way as
described for the @AspectJ support -- by matching pointcut parameters by name against
advice method parameters. See xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details. If you wish
to explicitly specify argument names for the advice methods (not relying on the
advice method parameters. See
xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params[Advice Parameters] for details.
If you wish to explicitly specify argument names for the advice methods (not relying on the
detection strategies previously described), you can do so by using the `arg-names`
attribute of the advice element, which is treated in the same manner as the `argNames`
attribute in an advice annotation (as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]).
attribute in an advice annotation (as described in
xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-params-names[Determining Argument Names]).
The following example shows how to specify an argument name in XML:
[source,xml,indent=0,subs="verbatim"]
@@ -464,7 +456,8 @@ The following example shows how to specify an argument name in XML:
method="audit"
arg-names="auditable" />
----
<1> References the `publicMethod` named pointcut defined in xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions].
<1> References the `publicMethod` named pointcut defined in
xref:core/aop/ataspectj/pointcuts.adoc#aop-pointcuts-combining[Combining Pointcut Expressions].
The `arg-names` attribute accepts a comma-delimited list of parameter names.
@@ -645,15 +638,15 @@ ms % Task name
00000 ? execution(getFoo)
----
[[aop-ordering]]
=== Advice Ordering
When multiple pieces of advice need to run at the same join point (executing method)
the ordering rules are as described in xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The precedence
between aspects is determined via the `order` attribute in the `<aop:aspect>` element or
by either adding the `@Order` annotation to the bean that backs the aspect or by having
the bean implement the `Ordered` interface.
the ordering rules are as described in
xref:core/aop/ataspectj/advice.adoc#aop-ataspectj-advice-ordering[Advice Ordering]. The
precedence between aspects is determined via the `order` attribute in the `<aop:aspect>`
element or by either adding the `@Order` annotation to the bean that backs the aspect
or by having the bean implement the `Ordered` interface.
[NOTE]
====
@@ -676,7 +669,6 @@ at the aspect level.
====
[[aop-schema-introductions]]
== Introductions
@@ -756,7 +748,6 @@ Kotlin::
======
[[aop-schema-instantiation-models]]
== Aspect Instantiation Models
@@ -764,7 +755,6 @@ The only supported instantiation model for schema-defined aspects is the singlet
model. Other instantiation models may be supported in future releases.
[[aop-schema-advisors]]
== Advisors
@@ -772,7 +762,8 @@ The concept of "advisors" comes from the AOP support defined in Spring
and does not have a direct equivalent in AspectJ. An advisor is like a small
self-contained aspect that has a single piece of advice. The advice itself is
represented by a bean and must implement one of the advice interfaces described in
xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring]. Advisors can take advantage of AspectJ pointcut expressions.
xref:core/aop-api/advice.adoc#aop-api-advice-types[Advice Types in Spring].
Advisors can take advantage of AspectJ pointcut expressions.
Spring supports the advisor concept with the `<aop:advisor>` element. You most
commonly see it used in conjunction with transactional advice, which also has its own
@@ -805,7 +796,6 @@ To define the precedence of an advisor so that the advice can participate in ord
use the `order` attribute to define the `Ordered` value of the advisor.
[[aop-schema-example]]
== An AOP Schema Example
@@ -981,7 +971,3 @@ pointcut expression so that only `@Idempotent` operations match, as follows:
expression="execution(* com.xyz.service.*.*(..)) and
@annotation(com.xyz.service.Idempotent)"/>
----
@@ -8,12 +8,14 @@ alone.
Spring ships with a small AspectJ aspect library, which is available stand-alone in your
distribution as `spring-aspects.jar`. You need to add this to your classpath in order
to use the aspects in it. xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring] and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ] discuss the
content of this library and how you can use it. xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC] discusses how to
dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally,
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework] provides an introduction to load-time weaving for Spring applications
that use AspectJ.
to use the aspects in it.
xref:core/aop/using-aspectj.adoc#aop-atconfigurable[Using AspectJ to Dependency Inject Domain Objects with Spring]
and xref:core/aop/using-aspectj.adoc#aop-ajlib-other[Other Spring aspects for AspectJ]
discuss the content of this library and how you can use it.
xref:core/aop/using-aspectj.adoc#aop-aj-configure[Configuring AspectJ Aspects by Using Spring IoC]
discusses how to dependency inject AspectJ aspects that are woven using the AspectJ compiler. Finally,
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework]
provides an introduction to load-time weaving for Spring applications that use AspectJ.
[[aop-atconfigurable]]
@@ -206,7 +208,6 @@ not use `@Configurable` on bean classes that are registered as regular Spring be
with the container. Doing so results in double initialization, once through the
container and once through the aspect.
[[aop-configurable-testing]]
=== Unit Testing `@Configurable` Objects
@@ -219,7 +220,6 @@ you can still unit test outside of the container as normal, but you see a warnin
message each time that you construct a `@Configurable` object indicating that it has
not been configured by Spring.
[[aop-configurable-container]]
=== Working with Multiple Application Contexts
@@ -249,7 +249,6 @@ is added only to the container-wide classpath (and hence loaded by the shared pa
not what you want).
[[aop-ajlib-other]]
== Other Spring aspects for AspectJ
@@ -302,7 +301,6 @@ fully qualified class names:
----
[[aop-aj-configure]]
== Configuring AspectJ Aspects by Using Spring IoC
@@ -357,7 +355,6 @@ results in the creation of Spring AOP proxies. The @AspectJ style of aspect
declaration is being used here, but the AspectJ runtime is not involved.
[[aop-aj-ltw]]
== Load-time Weaving with AspectJ in the Spring Framework
@@ -391,7 +388,6 @@ LTW that uses Spring, followed by detailed specifics about elements introduced i
example. For a complete example, see the
{petclinic-github-org}/spring-framework-petclinic[Petclinic sample application based on Spring Framework].
[[aop-aj-ltw-first-example]]
=== A First Example
@@ -677,7 +673,6 @@ nice example of a development-time aspect that developers can use during develop
and then easily exclude from builds of the application being deployed
into UAT or production.
[[aop-aj-ltw-the-aspects]]
=== Aspects
@@ -686,7 +681,6 @@ either the AspectJ language itself, or you can write your aspects in the @Aspect
Your aspects are then both valid AspectJ and Spring AOP aspects.
Furthermore, the compiled aspect classes need to be available on the classpath.
[[aop-aj-ltw-aop_dot_xml]]
=== `META-INF/aop.xml`
@@ -716,7 +710,6 @@ The structure and contents of this file is detailed in the LTW part of the
{aspectj-docs-devguide}/ltw-configuration.html[AspectJ reference
documentation]. Because the `aop.xml` file is 100% AspectJ, we do not describe it further here.
[[aop-aj-ltw-libraries]]
=== Required libraries (JARS)
@@ -731,7 +724,6 @@ If you use the xref:core/aop/using-aspectj.adoc#aop-aj-ltw-environments-generic[
* `spring-instrument.jar`
[[aop-aj-ltw-spring]]
=== Spring Configuration
@@ -831,7 +823,6 @@ possible values:
then AspectJ weaving is on. Otherwise, it is off. This is the default value.
|===
[[aop-aj-ltw-environments]]
=== Environment-specific Configuration
@@ -880,7 +871,3 @@ Note that this requires modification of the JVM launch script, which may prevent
from using this in application server environments (depending on your server and your
operation policies). That said, for one-app-per-JVM deployments such as standalone
Spring Boot applications, you typically control the entire JVM setup in any case.
+110 -47
View File
@@ -5,6 +5,7 @@ This chapter covers Spring's Ahead of Time (AOT) optimizations.
For AOT support specific to integration tests, see xref:testing/testcontext-framework/aot.adoc[Ahead of Time Support for Tests].
[[aot.introduction]]
== Introduction to Ahead of Time Optimizations
@@ -17,9 +18,9 @@ Applying such optimizations early implies the following restrictions:
* The beans defined in your application cannot change at runtime, meaning:
** `@Profile`, in particular profile-specific configuration, needs to be chosen at build time and is automatically enabled at runtime when AOT is enabled.
** `Environment` properties that impact the presence of a bean (`@Conditional`) are only considered at build time.
* Bean definitions with instance suppliers (lambdas or method references) cannot be transformed ahead-of-time.
* Bean definitions with instance suppliers (lambdas or method references) cannot be transformed ahead of time.
* Beans registered as singletons (using `registerSingleton`, typically from
`ConfigurableListableBeanFactory`) cannot be transformed ahead-of-time either.
`ConfigurableListableBeanFactory`) cannot be transformed ahead of time either.
* As we cannot rely on the instance, make sure that the bean type is as precise as
possible.
@@ -35,6 +36,7 @@ A Spring AOT processed application typically generates:
NOTE: At the moment, AOT is focused on allowing Spring applications to be deployed as native images using GraalVM.
We intend to support more JVM-based use cases in future generations.
[[aot.basics]]
== AOT Engine Overview
@@ -51,6 +53,7 @@ The `RuntimeHints` instance can also be used to generate the relevant GraalVM na
Those steps are covered in greater detail in the sections below.
[[aot.refresh]]
== Refresh for AOT Processing
@@ -88,6 +91,7 @@ This makes sure to create any proxy that will be required at runtime.
Once this part completes, the `BeanFactory` contains the bean definitions that are necessary for the application to run. It does not trigger bean instantiation but allows the AOT engine to inspect the beans that will be created at runtime.
[[aot.bean-factory-initialization-contributions]]
== Bean Factory Initialization AOT Contributions
@@ -106,11 +110,10 @@ Consequently, such a bean is automatically excluded from the AOT-optimized conte
[NOTE]
====
If a bean implements the `BeanFactoryInitializationAotProcessor` interface, the bean and **all** of its dependencies will be initialized during AOT processing.
We generally recommend that this interface is only implemented by infrastructure beans such as `BeanFactoryPostProcessor` which have limited dependencies and are already initialized early in the bean factory lifecycle.
We generally recommend that this interface is only implemented by infrastructure beans, such as a `BeanFactoryPostProcessor`, which have limited dependencies and are already initialized early in the bean factory lifecycle.
If such a bean is registered using an `@Bean` factory method, ensure the method is `static` so that its enclosing `@Configuration` class does not have to be initialized.
====
[[aot.bean-registration-contributions]]
=== Bean Registration AOT Contributions
@@ -127,7 +130,7 @@ Typically used when the bean definition needs to be tuned for specific features
[NOTE]
====
If a bean implements the `BeanRegistrationAotProcessor` interface, the bean and **all** of its dependencies will be initialized during AOT processing.
We generally recommend that this interface is only implemented by infrastructure beans such as `BeanFactoryPostProcessor` which have limited dependencies and are already initialized early in the bean factory lifecycle.
We generally recommend that this interface is only implemented by infrastructure beans, such as a `BeanFactoryPostProcessor`, which have limited dependencies and are already initialized early in the bean factory lifecycle.
If such a bean is registered using an `@Bean` factory method, ensure the method is `static` so that its enclosing `@Configuration` class does not have to be initialized.
====
@@ -219,21 +222,23 @@ NOTE: The exact code generated may differ depending on the exact nature of your
TIP: Each generated class is annotated with `org.springframework.aot.generate.Generated` to
identify them if they need to be excluded, for instance by static analysis tools.
The generated code above creates bean definitions equivalent to the `@Configuration` class, but in a direct way and without the use of reflection if at all possible.
The generated code above creates bean definitions equivalent to the `@Configuration` class, but in a direct way and without the use of reflection at all if possible.
There is a bean definition for `dataSourceConfiguration` and one for `dataSourceBean`.
When a `datasource` instance is required, a `BeanInstanceSupplier` is called.
This supplier invokes the `dataSource()` method on the `dataSourceConfiguration` bean.
[[aot.running]]
== Running with AOT Optimizations
AOT is a mandatory step to transform a Spring application to a native executable, so it
is automatically enabled when running in this mode. It is possible to use those optimizations
is automatically enabled when running within a native image. However it is also possible to use AOT optimizations
on the JVM by setting the `spring.aot.enabled` System property to `true`.
NOTE: When AOT optimizations are included, some decisions that have been taken at build-time
are hard-coded in the application setup. For instance, profiles that have been enabled at
build-time are automatically enabled at runtime as well.
NOTE: When AOT optimizations are included, some decisions that have been made at build time
are hard coded in the application setup. For instance, profiles that have been enabled at
build time are automatically enabled at runtime as well.
[[aot.bestpractices]]
== Best Practices
@@ -271,7 +276,7 @@ build time.
While your application may interact with an interface that a bean implements, it is still very important to declare the most precise type.
The AOT engine performs additional checks on the bean type, such as detecting the presence of `@Autowired` members or lifecycle callback methods.
For `@Configuration` classes, make sure that the return type of the factory `@Bean` method is as precise as possible.
For `@Configuration` classes, make sure that the return type of an `@Bean` factory method is as precise as possible.
Consider the following example:
[tabs]
@@ -305,11 +310,11 @@ Kotlin::
----
======
In the example above, the declared type for the `myInterface` bean is `MyInterface`.
None of the usual post-processing will take `MyImplementation` into account.
For instance, if there is an annotated handler method on `MyImplementation` that the context should register, it wont be detected upfront.
In the example above, the declared type for the `myInterface` bean is `MyInterface`.
During AOT processing, none of the usual post-processing will take `MyImplementation` into account.
For instance, if there is an annotated handler method on `MyImplementation` that the context should register, it will not be detected during AOT processing.
The example above should be rewritten as follows:
The example above should therefore be rewritten as follows:
[tabs]
======
@@ -348,7 +353,7 @@ If you are registering bean definitions programmatically, consider using `RootBe
=== Avoid Multiple Constructors
The container is able to choose the most appropriate constructor to use based on several candidates.
However, this is not a best practice and flagging the preferred constructor with `@Autowired` if necessary is preferred.
However, relying on that is not a best practice, and flagging the preferred constructor with `@Autowired` if necessary is preferred.
In case you are working on a code base that you cannot modify, you can set the {spring-framework-api}/beans/factory/support/AbstractBeanDefinition.html#PREFERRED_CONSTRUCTORS_ATTRIBUTE[`preferredConstructors` attribute] on the related bean definition to indicate which constructor should be used.
@@ -363,17 +368,17 @@ A good rule of thumb is to keep in mind that bean definitions are an abstraction
Rather than using such structures, decomposing to simple types or referring to a bean that is built as such is recommended.
As a last resort, you can implement your own `org.springframework.aot.generate.ValueCodeGenerator$Delegate`.
To use it, register its fully qualified name in `META-INF/spring/aot.factories` using the `Delegate` as the key.
To use it, register its fully-qualified name in `META-INF/spring/aot.factories` using `org.springframework.aot.generate.ValueCodeGenerator$Delegate` as the key.
[[aot.bestpractices.custom-arguments]]
=== Avoid Creating Beans with Custom Arguments
Spring AOT detects what needs to be done to create a bean and translates that in generated code using an instance supplier.
The container also supports creating a bean with {spring-framework-api}++/beans/factory/BeanFactory.html#getBean(java.lang.String,java.lang.Object...)++[custom arguments] that leads to several issues with AOT:
Spring AOT detects what needs to be done to create a bean and translates that into generated code that uses an instance supplier.
The container also supports creating a bean with {spring-framework-api}++/beans/factory/BeanFactory.html#getBean(java.lang.String,java.lang.Object...)++[custom arguments] which can lead to several issues with AOT:
. The custom arguments require dynamic introspection of a matching constructor or factory method.
Those arguments cannot be detected by AOT, so the necessary reflection hints will have to be provided manually.
. By-passing the instance supplier means that all other optimizations after creation are skipped as well.
. Bypassing the instance supplier means that all other optimizations after creation are skipped as well.
For instance, autowiring on fields and methods will be skipped as they are handled in the instance supplier.
Rather than having prototype-scoped beans created with custom arguments, we recommend a manual factory pattern where a bean is responsible for the creation of the instance.
@@ -396,7 +401,7 @@ for further information.
=== FactoryBean
`FactoryBean` should be used with care as it introduces an intermediate layer in terms of bean type resolution that may not be conceptually necessary.
As a rule of thumb, if the `FactoryBean` instance does not hold long-term state and is not needed at a later point in time at runtime, it should be replaced by a regular factory method, possibly with a `FactoryBean` adapter layer on top (for declarative configuration purposes).
As a rule of thumb, if a `FactoryBean` instance does not hold long-term state and is not needed at a later point at runtime, it should be replaced by a regular `@Bean` factory method, possibly with a `FactoryBean` adapter layer on top (for declarative configuration purposes).
If your `FactoryBean` implementation does not resolve the object type (i.e. `T`), extra care is necessary.
Consider the following example:
@@ -455,7 +460,7 @@ Kotlin::
----
======
If the `FactoryBean` bean definition is registered programmatically, make sure to follow these steps:
If a `FactoryBean` bean definition is registered programmatically, make sure to follow these steps:
1. Use `RootBeanDefinition`.
2. Set the `beanClass` to the `FactoryBean` class so that AOT knows that it is an intermediate layer.
@@ -469,20 +474,20 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
RootBeanDefinition beanDefinition = new RootBeanDefinition(ClientFactoryBean.class);
beanDefinition.setTargetType(ResolvableType.forClassWithGenerics(ClientFactoryBean.class, MyClient.class));
// ...
registry.registerBeanDefinition("myClient", beanDefinition);
RootBeanDefinition beanDefinition = new RootBeanDefinition(ClientFactoryBean.class);
beanDefinition.setTargetType(ResolvableType.forClassWithGenerics(ClientFactoryBean.class, MyClient.class));
// ...
registry.registerBeanDefinition("myClient", beanDefinition);
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
val beanDefinition = RootBeanDefinition(ClientFactoryBean::class.java)
beanDefinition.setTargetType(ResolvableType.forClassWithGenerics(ClientFactoryBean::class.java, MyClient::class.java));
// ...
registry.registerBeanDefinition("myClient", beanDefinition)
val beanDefinition = RootBeanDefinition(ClientFactoryBean::class.java)
beanDefinition.setTargetType(ResolvableType.forClassWithGenerics(ClientFactoryBean::class.java, MyClient::class.java));
// ...
registry.registerBeanDefinition("myClient", beanDefinition)
----
======
@@ -520,7 +525,7 @@ Kotlin::
----
======
To make sure the scanning occurs ahead of time, a `PersistenceManagedTypes` bean must be declared and used by the
To ensure that entity scanning occurs ahead of time, a `PersistenceManagedTypes` bean must be declared and used by the
factory bean definition, as shown by the following example:
[tabs]
@@ -564,6 +569,7 @@ Kotlin::
----
======
[[aot.hints]]
== Runtime Hints
@@ -598,35 +604,38 @@ For instance, the return type of a `@Controller` method is inspected, and releva
For cases that the core container cannot infer, you can register such hints programmatically.
A number of convenient annotations are also provided for common use cases.
[[aot.hints.import-runtime-hints]]
=== `@ImportRuntimeHints`
`RuntimeHintsRegistrar` implementations allow you to get a callback to the `RuntimeHints` instance managed by the AOT engine.
Implementations of this interface can be registered using `@ImportRuntimeHints` on any Spring bean or `@Bean` factory method.
`RuntimeHintsRegistrar` implementations are detected and invoked at build time.
{spring-framework-api}/aot/hint/RuntimeHintsRegistrar.html[`RuntimeHintsRegistrar`]
implementations allow you to get a callback to the `RuntimeHints` instance managed by the
AOT engine. Implementations of this interface can be registered using
{spring-framework-api}/context/annotation/ImportRuntimeHints.html[`@ImportRuntimeHints`]
on any Spring bean or `@Bean` factory method. `RuntimeHintsRegistrar` implementations are
detected and invoked at build time.
include-code::./SpellCheckService[]
If at all possible, `@ImportRuntimeHints` should be used as close as possible to the component that requires the hints.
This way, if the component is not contributed to the `BeanFactory`, the hints won't be contributed either.
This way, if the component is not contributed to the `BeanFactory`, the hints will not be contributed either.
It is also possible to register an implementation statically by adding an entry in `META-INF/spring/aot.factories` with a key equal to the fully-qualified name of the `RuntimeHintsRegistrar` interface.
[[aot.hints.reflective]]
=== `@Reflective`
{spring-framework-api}/aot/hint/annotation/Reflective.html[`@Reflective`] provides an idiomatic way to flag the need for reflection on an annotated element.
For instance, `@EventListener` is meta-annotated with `@Reflective` since the underlying implementation invokes the annotated method using reflection.
Out-of-the-box, only Spring beans are considered but you can opt-in for scanning using `@ReflectiveScan`.
In the example below, all types of the package `com.example.app` and their subpackages are considered:
Out-of-the-box, only Spring beans are considered, but you can opt-in for scanning using
{spring-framework-api}/context/annotation/ReflectiveScan.html[`@ReflectiveScan`]. In the
example below, all types in the `com.example.app` package and its subpackages are
considered:
include-code::./MyConfiguration[]
Scanning happens during AOT processing and the types in the target packages do not need to have a class-level annotation to be considered.
This performs a "deep scan" and the presence of `@Reflective`, either directly or as a meta-annotation, is checked on types, fields, constructors, methods, and enclosed elements.
Scanning happens during AOT processing, and the types in the target packages do not need to have a class-level annotation to be considered.
This performs a _deep scan_, and the presence of `@Reflective`, either directly or as a meta-annotation, is checked on types, fields, constructors, methods, and enclosed elements.
By default, `@Reflective` registers an invocation hint for the annotated element.
This can be tuned by specifying a custom `ReflectiveProcessor` implementation via the `@Reflective` annotation.
@@ -634,13 +643,12 @@ This can be tuned by specifying a custom `ReflectiveProcessor` implementation vi
Library authors can reuse this annotation for their own purposes.
An example of such customization is covered in the next section.
[[aot.hints.register-reflection]]
=== `@RegisterReflection`
{spring-framework-api}/aot/hint/annotation/RegisterReflection.html[`@RegisterReflection`] is a specialization of `@Reflective` that provides a declarative way of registering reflection for arbitrary types.
{spring-framework-api}/aot/hint/annotation/RegisterReflection.html[`@RegisterReflection`] is a specialization of `@Reflective` that provides a declarative way to register reflection for arbitrary types.
NOTE: As a specialization of `@Reflective`, this is also detected if you're using `@ReflectiveScan`.
NOTE: As a specialization of `@Reflective`, `@RegisterReflection` is also detected if you are using `@ReflectiveScan`.
In the following example, public constructors and public methods can be invoked via reflection on `AccountService`:
@@ -648,8 +656,8 @@ include-code::./MyConfiguration[tag=snippet,indent=0]
`@RegisterReflection` can be applied to any target type at the class level, but it can also be applied directly to a method to better indicate where the hints are actually required.
`@RegisterReflection` can be used as a meta-annotation to provide more specific needs.
{spring-framework-api}/aot/hint/annotation/RegisterReflectionForBinding.html[`@RegisterReflectionForBinding`] is such composed annotation and registers the need for serializing arbitrary types.
`@RegisterReflection` can be used as a meta-annotation to support more specific needs.
{spring-framework-api}/aot/hint/annotation/RegisterReflectionForBinding.html[`@RegisterReflectionForBinding`] is a composed annotation that is meta-annotated with `@RegisterReflection` and registers the need for serializing arbitrary types.
A typical use case is the use of DTOs that the container cannot infer, such as using a web client within a method body.
The following example registers `Order` for serialization.
@@ -660,11 +668,66 @@ This registers hints for constructors, fields, properties, and record components
Hints are also registered for types transitively used on properties and record components.
In other words, if `Order` exposes others types, hints are registered for those as well.
[[aot.hints.convention-based-conversion]]
=== Runtime Hints for Convention-based Conversion
Although the core container provides built-in support for automatic conversion of many
common types (see xref:core/validation/convert.adoc[Spring Type Conversion]), some
conversions are supported via a convention-based algorithm that relies on reflection.
Specifically, if there is no explicit `Converter` registered with the `ConversionService`
for a particular source &#8594; target type pair, the internal `ObjectToObjectConverter`
will attempt to use conventions to convert a source object to a target type by delegating
to a method on the source object or to a static factory method or constructor on the
target type. Since this convention-based algorithm can be applied to arbitrary types at
runtime, the core container is not able to infer the runtime hints necessary to support
such reflection.
If you encounter convention-based conversion issues within a native image resulting from
lacking runtime hints, you can register the necessary hints programmatically. For
example, if your application requires a conversion from `java.time.Instant` to
`java.sql.Timestamp` and relies on `ObjectToObjectConverter` to invoke
`java.sql.Timestamp.from(Instant)` using reflection, you could implement a custom
`RuntimeHintsRegitrar` to support this use case within a native image, as demonstrated in
the following example.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
public class TimestampConversionRuntimeHints implements RuntimeHintsRegistrar {
public void registerHints(RuntimeHints hints, ClassLoader classLoader) {
ReflectionHints reflectionHints = hints.reflection();
reflectionHints.registerTypeIfPresent(classLoader, "java.sql.Timestamp", hint -> hint
.withMethod("from", List.of(TypeReference.of(Instant.class)), ExecutableMode.INVOKE)
.onReachableType(TypeReference.of("java.sql.Timestamp")));
}
}
----
======
`TimestampConversionRuntimeHints` can then be registered declaratively via
<<aot.hints.import-runtime-hints>> or statically via a `META-INF/spring/aot.factories`
configuration file.
[NOTE]
====
The above `TimestampConversionRuntimeHints` class is a simplified version of the
`ObjectToObjectConverterRuntimeHints` class that is included in the framework and
registered by default.
Thus, this specific `Instant`-to-`Timestamp` use case is already handled by the framework.
====
[[aot.hints.testing]]
=== Testing Runtime Hints
Spring Core also ships `RuntimeHintsPredicates`, a utility for checking that existing hints match a particular use case.
This can be used in your own tests to validate that a `RuntimeHintsRegistrar` contains the expected results.
This can be used in your own tests to validate that a `RuntimeHintsRegistrar` produces the expected results.
We can write a test for our `SpellCheckService` and ensure that we will be able to load a dictionary at runtime:
include-code::./SpellCheckServiceTests[tag=hintspredicates]
@@ -1,7 +1,3 @@
[[appendix]]
= Appendix
:page-section-summary-toc: 1
@@ -19,10 +19,6 @@ its behavior changes.
| Initialization of `SmartInitializingSingleton` beans.
| `beanName` the name of the bean.
| `spring.context.annotated-bean-reader.create`
| Creation of the `AnnotatedBeanDefinitionReader`.
|
| `spring.context.base-packages.scan`
| Scanning of base packages.
| `packages` array of base packages for scanning.
@@ -12,7 +12,6 @@ Spring's extensible XML configuration mechanism is based on XML Schema. If you a
familiar with Spring's current XML configuration extensions that come with the standard
Spring distribution, you should first read the previous section on xref:core/appendix/xsd-schemas.adoc[XML Schemas].
To create new XML configuration extensions:
. xref:core/appendix/xml-custom.adoc#core.appendix.xsd-custom-schema[Author] an XML schema to describe your custom element(s).
@@ -38,7 +37,6 @@ examples follow later in this appendix. The intent of this first simple example
through the basic steps of making a custom extension.)
[[xsd-custom-schema]]
== Authoring the Schema
@@ -110,7 +108,6 @@ can use autocompletion to let a user choose between several configuration option
defined in the enumeration.
[[xsd-custom-namespacehandler]]
== Coding a `NamespaceHandler`
@@ -187,7 +184,6 @@ means that each `BeanDefinitionParser` contains only the logic for parsing a sin
custom element, as we can see in the next step.
[[xsd-custom-parser]]
== Using `BeanDefinitionParser`
@@ -276,13 +272,11 @@ the basic grunt work of creating a single `BeanDefinition`.
single `BeanDefinition` represents.
======
In this simple case, this is all that we need to do. The creation of our single
`BeanDefinition` is handled by the `AbstractSingleBeanDefinitionParser` superclass, as
is the extraction and setting of the bean definition's unique identifier.
[[xsd-custom-registration]]
== Registering the Handler and the Schema
@@ -294,7 +288,6 @@ can, for example, be distributed alongside your binary classes in a JAR file. Th
XML parsing infrastructure automatically picks up your new extension by consuming
these special properties files, the formats of which are detailed in the next two sections.
[[xsd-custom-registration-spring-handlers]]
=== Writing `META-INF/spring.handlers`
@@ -313,7 +306,6 @@ The first part (the key) of the key-value pair is the URI associated with your c
namespace extension and needs to exactly match exactly the value of the `targetNamespace`
attribute, as specified in your custom XSD schema.
[[xsd-custom-registration-spring-schemas]]
=== Writing 'META-INF/spring.schemas'
@@ -337,7 +329,6 @@ You are encouraged to deploy your XSD file (or files) right alongside
the `NamespaceHandler` and `BeanDefinitionParser` classes on the classpath.
[[xsd-custom-using]]
== Using a Custom Extension in Your Spring XML Configuration
@@ -371,13 +362,11 @@ in a Spring XML configuration file:
<1> Our custom bean.
[[xsd-custom-meat]]
== More Detailed Examples
This section presents some more detailed examples of custom XML extensions.
[[xsd-custom-custom-nested]]
=== Nesting Custom Elements within Custom Elements
@@ -753,7 +742,6 @@ http\://www.foo.example/schema/component=com.foo.ComponentNamespaceHandler
http\://www.foo.example/schema/component/component.xsd=com/foo/component.xsd
----
[[xsd-custom-custom-just-attributes]]
=== Custom Attributes on "`Normal`" Elements
@@ -1007,5 +995,3 @@ http\://www.foo.example/schema/jcache=com.foo.JCacheNamespaceHandler
# in 'META-INF/spring.schemas'
http\://www.foo.example/schema/jcache/jcache.xsd=com/foo/jcache.xsd
----
@@ -4,7 +4,6 @@
This part of the appendix lists XML schemas related to the core container.
[[xsd-schemas-util]]
== The `util` Schema
@@ -29,7 +28,6 @@ correct schema so that the tags in the `util` namespace are available to you):
</beans>
----
[[xsd-schemas-util-constant]]
=== Using `<util:constant/>`
@@ -186,7 +184,6 @@ Kotlin::
</bean>
----
[[xsd-schemas-util-property-path]]
=== Using `<util:property-path/>`
@@ -308,7 +305,6 @@ You can specifically set the result type in the actual definition. This is not n
for most use cases, but it can sometimes be useful. See the javadoc for more info on
this feature.
[[xsd-schemas-util-properties]]
=== Using `<util:properties/>`
@@ -334,7 +330,6 @@ The following example uses a `util:properties` element to make a more concise re
<util:properties id="jdbcConfiguration" location="classpath:com/foo/jdbc-production.properties"/>
----
[[xsd-schemas-util-list]]
=== Using `<util:list/>`
@@ -389,7 +384,6 @@ following configuration:
If no `list-class` attribute is supplied, the container chooses a `List` implementation.
[[xsd-schemas-util-map]]
=== Using `<util:map/>`
@@ -444,7 +438,6 @@ following configuration:
If no `'map-class'` attribute is supplied, the container chooses a `Map` implementation.
[[xsd-schemas-util-set]]
=== Using `<util:set/>`
@@ -500,7 +493,6 @@ following configuration:
If no `set-class` attribute is supplied, the container chooses a `Set` implementation.
[[xsd-schemas-aop]]
== The `aop` Schema
@@ -530,7 +522,6 @@ are available to you):
----
[[xsd-schemas-context]]
== The `context` Schema
@@ -555,7 +546,6 @@ available to you:
</beans>
----
[[xsd-schemas-context-pphc]]
=== Using `<property-placeholder/>`
@@ -599,34 +589,25 @@ element for that purpose. Similarly, Spring's
xref:integration/cache/annotations.adoc[caching annotations] need to be explicitly
xref:integration/cache/annotations.adoc#cache-annotation-enable[enabled] as well.
[[xsd-schemas-context-component-scan]]
=== Using `<component-scan/>`
This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration]
.
This element is detailed in the section on xref:core/beans/annotation-config.adoc[annotation-based container configuration].
[[xsd-schemas-context-ltw]]
=== Using `<load-time-weaver/>`
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework]
.
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-aj-ltw[load-time weaving with AspectJ in the Spring Framework].
[[xsd-schemas-context-sc]]
=== Using `<spring-configured/>`
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring]
.
This element is detailed in the section on xref:core/aop/using-aspectj.adoc#aop-atconfigurable[using AspectJ to dependency inject domain objects with Spring].
[[xsd-schemas-context-mbe]]
=== Using `<mbean-export/>`
This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export]
.
This element is detailed in the section on xref:integration/jmx/naming.adoc#jmx-context-mbeanexport[configuring annotation-based MBean export].
[[xsd-schemas-beans]]
@@ -666,7 +647,3 @@ as it stands).
In the case of the preceding example, you could assume that there is some logic that consumes
the bean definition and sets up some caching infrastructure that uses the supplied metadata.
@@ -3,7 +3,3 @@
:page-section-summary-toc: 1
This chapter covers Spring's Inversion of Control (IoC) container.
@@ -62,6 +62,3 @@ application context in which it is defined. This means that, if you put
it only checks for `@Autowired` beans in your controllers, and not your services. See
xref:web/webmvc/mvc-servlet.adoc[The DispatcherServlet] for more information.
====
@@ -152,6 +152,3 @@ The corresponding bean definitions follow:
</beans>
----
@@ -151,17 +151,17 @@ injected into a `Set<MovieCatalog>` annotated with `@Qualifier("action")`.
[TIP]
====
Letting qualifier values select against target bean names, within the type-matching
candidates, does not require a `@Qualifier` annotation at the injection point.
If there is no other resolution indicator (such as a qualifier or a primary marker),
for a non-unique dependency situation, Spring matches the injection point name
(that is, the field name or parameter name) against the target bean names and chooses
the same-named candidate, if any (either by bean name or by associated alias).
candidates, does not require a `@Qualifier` annotation at the injection point. If there
is no other resolution indicator (such as a qualifier, a primary marker, or a fallback
marker), for a non-unique dependency situation, Spring matches the injection point name
(that is, the field name or parameter name) against the target bean names and chooses the
same-named candidate, if any (either by bean name or by associated alias).
Since version 6.1, this requires the `-parameters` Java compiler flag to be present.
As of 6.2, the container applies fast shortcut resolution for bean name matches,
bypassing the full type matching algorithm when the parameter name matches the
bean name and no type, qualifier or primary conditions override the match. It is
therefore recommendable for your parameter names to match the target bean names.
Since version 6.1, this requires the `-parameters` Java compiler flag to be present. As
of 6.2, the container applies fast shortcut resolution for bean name matches, bypassing
the full type matching algorithm when the parameter name matches the bean name and no
type, qualifier, primary, or fallback conditions override the match. It is therefore
recommendable for your parameter names to match the target bean names.
====
As an alternative for injection by name, consider the JSR-250 `@Resource` annotation
@@ -274,7 +274,7 @@ Kotlin::
Next, you can provide the information for the candidate bean definitions. You can add
`<qualifier/>` tags as sub-elements of the `<bean/>` tag and then specify the `type` and
`value` to match your custom qualifier annotations. The type is matched against the
fully-qualified class name of the annotation. Alternately, as a convenience if no risk of
fully-qualified class name of the annotation. Alternatively, as a convenience if no risk of
conflicting names exists, you can use the short class name. The following example
demonstrates both approaches:
@@ -568,6 +568,3 @@ the following example:
</beans>
----
--
@@ -37,18 +37,18 @@ Kotlin::
----
======
[NOTE]
[TIP]
====
As of Spring Framework 4.3, an `@Autowired` annotation on such a constructor is no longer
necessary if the target bean defines only one constructor to begin with. However, if
several constructors are available and there is no primary/default constructor, at least
one of the constructors must be annotated with `@Autowired` in order to instruct the
container which one to use. See the discussion on
xref:core/beans/annotation-config/autowired.adoc#beans-autowired-annotation-constructor-resolution[constructor resolution] for details.
An `@Autowired` annotation on such a constructor is not necessary if the target bean
defines only one constructor. However, if several constructors are available and there is
no primary or default constructor, at least one of the constructors must be annotated
with `@Autowired` in order to instruct the container which one to use. See the discussion
on xref:core/beans/annotation-config/autowired.adoc#beans-autowired-annotation-constructor-resolution[constructor resolution]
for details.
====
You can also apply the `@Autowired` annotation to _traditional_ setter methods,
as the following example shows:
You can apply the `@Autowired` annotation to _traditional_ setter methods, as the
following example shows:
[tabs]
======
@@ -84,8 +84,8 @@ Kotlin::
----
======
You can also apply the annotation to methods with arbitrary names and multiple
arguments, as the following example shows:
You can apply `@Autowired` to methods with arbitrary names and multiple arguments, as the
following example shows:
[tabs]
======
@@ -176,14 +176,15 @@ Kotlin::
====
Make sure that your target components (for example, `MovieCatalog` or `CustomerPreferenceDao`)
are consistently declared by the type that you use for your `@Autowired`-annotated
injection points. Otherwise, injection may fail due to a "no type match found" error at runtime.
injection points. Otherwise, injection may fail due to a "no type match found" error at
runtime.
For XML-defined beans or component classes found via classpath scanning, the container
usually knows the concrete type up front. However, for `@Bean` factory methods, you need
to make sure that the declared return type is sufficiently expressive. For components
that implement several interfaces or for components potentially referred to by their
implementation type, consider declaring the most specific return type on your factory
method (at least as specific as required by the injection points referring to your bean).
implementation type, declare the most specific return type on your factory method (at
least as specific as required by the injection points referring to your bean).
====
.[[beans-autowired-annotation-self-injection]]Self Injection
@@ -308,12 +309,13 @@ set of multiple matches for the specific bean type (as returned by the factory m
Note that the standard `jakarta.annotation.Priority` annotation is not available at the
`@Bean` level, since it cannot be declared on methods. Its semantics can be modeled
through `@Order` values in combination with `@Primary` on a single bean for each type.
through `@Order` values in combination with `@Primary` or `@Fallback` on a single bean
for each type.
====
Even typed `Map` instances can be autowired as long as the expected key type is `String`.
The map values contain all beans of the expected type, and the keys contain the
corresponding bean names, as the following example shows:
The map values are all beans of the expected type, and the keys are the corresponding
bean names, as the following example shows:
[tabs]
======
@@ -431,7 +433,7 @@ annotated constructor does not have to be public.
====
Alternatively, you can express the non-required nature of a particular dependency
through Java 8's `java.util.Optional`, as the following example shows:
through Java's `java.util.Optional`, as the following example shows:
[source,java,indent=0,subs="verbatim,quotes"]
----
@@ -444,9 +446,9 @@ through Java 8's `java.util.Optional`, as the following example shows:
}
----
You can also use a `@Nullable` annotation (of any kind in any package -- for example,
`javax.annotation.Nullable` from JSR-305) or just leverage Kotlin built-in null-safety
support:
You can also use a parameter-level `@Nullable` annotation (of any kind in any package --
for example, `org.jspecify.annotations.Nullable` from JSpecify) or just leverage Kotlin's
built-in null-safety support:
[tabs]
======
@@ -521,8 +523,6 @@ class MovieRecommender {
The `@Autowired`, `@Inject`, `@Value`, and `@Resource` annotations are handled by Spring
`BeanPostProcessor` implementations. This means that you cannot apply these annotations
within your own `BeanPostProcessor` or `BeanFactoryPostProcessor` types (if any).
These types must be 'wired up' explicitly by using XML or a Spring `@Bean` method.
====
@@ -27,7 +27,5 @@ with the `CustomAutowireConfigurer`
When multiple beans qualify as autowire candidates, the determination of a "`primary`" is
as follows: If exactly one bean definition among the candidates has a `primary`
attribute set to `true`, it is selected.
attribute set to `true`, it is selected. For annotation-based configuration, see
xref:core/beans/annotation-config/autowired-primary.adoc[Fine-tuning with `@Primary` or `@Fallback`].
@@ -96,6 +96,3 @@ Kotlin::
private lateinit var s: List<Store<Integer>>
----
======
@@ -64,7 +64,3 @@ JDK 11. As of Jakarta EE 9, the package lives in `jakarta.annotation` now. If ne
the `jakarta.annotation-api` artifact needs to be obtained via Maven Central now,
simply to be added to the application's classpath like any other library.
====
@@ -142,4 +142,3 @@ Kotlin::
`ApplicationContext`.
======
--
@@ -9,15 +9,15 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
public class MovieRecommender {
@Component
public class MovieRecommender {
private final String catalog;
private final String catalog;
public MovieRecommender(@Value("${catalog.name}") String catalog) {
this.catalog = catalog;
}
}
public MovieRecommender(@Value("${catalog.name}") String catalog) {
this.catalog = catalog;
}
}
----
Kotlin::
@@ -37,9 +37,9 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@PropertySource("classpath:application.properties")
public class AppConfig { }
@Configuration
@PropertySource("classpath:application.properties")
public class AppConfig { }
----
Kotlin::
@@ -56,7 +56,7 @@ And the following `application.properties` file:
[source,java,indent=0,subs="verbatim,quotes"]
----
catalog.name=MovieCatalog
catalog.name=MovieCatalog
----
In that case, the `catalog` parameter and field will be equal to the `MovieCatalog` value.
@@ -101,8 +101,11 @@ NOTE: When configuring a `PropertySourcesPlaceholderConfigurer` using JavaConfig
Using the above configuration ensures Spring initialization failure if any `${}`
placeholder could not be resolved. It is also possible to use methods like
`setPlaceholderPrefix`, `setPlaceholderSuffix`, `setValueSeparator`, or
`setEscapeCharacter` to customize placeholders.
`setPlaceholderPrefix()`, `setPlaceholderSuffix()`, `setValueSeparator()`, or
`setEscapeCharacter()` to customize the placeholder syntax. In addition, the default
escape character can be changed or disabled globally by setting the
`spring.placeholder.escapeCharacter.default` property via a JVM system property (or via
the xref:appendix.adoc#appendix-spring-properties[`SpringProperties`] mechanism).
NOTE: Spring Boot configures by default a `PropertySourcesPlaceholderConfigurer` bean that
will get properties from `application.properties` and `application.yml` files.
@@ -119,15 +122,15 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
public class MovieRecommender {
@Component
public class MovieRecommender {
private final String catalog;
private final String catalog;
public MovieRecommender(@Value("${catalog.name:defaultCatalog}") String catalog) {
this.catalog = catalog;
}
}
public MovieRecommender(@Value("${catalog.name:defaultCatalog}") String catalog) {
this.catalog = catalog;
}
}
----
Kotlin::
@@ -150,16 +153,16 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
public class AppConfig {
@Configuration
public class AppConfig {
@Bean
public ConversionService conversionService() {
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
conversionService.addConverter(new MyCustomConverter());
return conversionService;
}
}
@Bean
public ConversionService conversionService() {
DefaultFormattingConversionService conversionService = new DefaultFormattingConversionService();
conversionService.addConverter(new MyCustomConverter());
return conversionService;
}
}
----
Kotlin::
@@ -188,15 +191,15 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
public class MovieRecommender {
@Component
public class MovieRecommender {
private final String catalog;
private final String catalog;
public MovieRecommender(@Value("#{systemProperties['user.catalog'] + 'Catalog' }") String catalog) {
this.catalog = catalog;
}
}
public MovieRecommender(@Value("#{systemProperties['user.catalog'] + 'Catalog' }") String catalog) {
this.catalog = catalog;
}
}
----
Kotlin::
@@ -217,16 +220,16 @@ Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
public class MovieRecommender {
@Component
public class MovieRecommender {
private final Map<String, Integer> countOfMoviesPerCatalog;
private final Map<String, Integer> countOfMoviesPerCatalog;
public MovieRecommender(
@Value("#{{'Thriller': 100, 'Comedy': 300}}") Map<String, Integer> countOfMoviesPerCatalog) {
this.countOfMoviesPerCatalog = countOfMoviesPerCatalog;
}
}
public MovieRecommender(
@Value("#{{'Thriller': 100, 'Comedy': 300}}") Map<String, Integer> countOfMoviesPerCatalog) {
this.countOfMoviesPerCatalog = countOfMoviesPerCatalog;
}
}
----
Kotlin::
@@ -238,5 +241,3 @@ Kotlin::
@Value("#{{'Thriller': 100, 'Comedy': 300}}") private val countOfMoviesPerCatalog: Map<String, Int>)
----
======
@@ -29,7 +29,6 @@ created and initialized, you have a fully configured and executable system or ap
image::container-magic.png[]
[[beans-factory-metadata]]
== Configuration Metadata
@@ -63,8 +62,6 @@ Typically, one does not configure fine-grained domain objects in the container,
it is usually the responsibility of repositories and business logic to create and load
domain objects.
[[beans-factory-xml]]
=== XML as an External Configuration DSL
@@ -119,7 +116,7 @@ Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
val context = ClassPathXmlApplicationContext("services.xml", "daos.xml")
val context = ClassPathXmlApplicationContext("services.xml", "daos.xml")
----
======
@@ -188,7 +185,6 @@ definition. This linkage between `id` and `ref` elements expresses the dependenc
collaborating objects. For details of configuring an object's dependencies, see
xref:core/beans/dependencies.adoc[Dependencies].
[[beans-factory-xml-import]]
=== Composing XML-based Configuration Metadata
@@ -243,42 +239,6 @@ The namespace itself provides the import directive feature. Further
configuration features beyond plain bean definitions are available in a selection
of XML namespaces provided by Spring -- for example, the `context` and `util` namespaces.
[[beans-factory-groovy]]
=== The Groovy Bean Definition DSL
As a further example for externalized configuration metadata, bean definitions can also
be expressed in Spring's Groovy Bean Definition DSL, as known from the Grails framework.
Typically, such configuration live in a ".groovy" file with the structure shown in the
following example:
[source,groovy,indent=0,subs="verbatim,quotes"]
----
beans {
dataSource(BasicDataSource) {
driverClassName = "org.hsqldb.jdbcDriver"
url = "jdbc:hsqldb:mem:grailsDB"
username = "sa"
password = ""
settings = [mynew:"setting"]
}
sessionFactory(SessionFactory) {
dataSource = dataSource
}
myService(MyService) {
nestedBean = { AnotherBean bean ->
dataSource = dataSource
}
}
}
----
This configuration style is largely equivalent to XML bean definitions and even
supports Spring's XML configuration namespaces. It also allows for importing XML
bean definition files through an `importBeans` directive.
[[beans-factory-client]]
== Using the Container
@@ -309,16 +269,16 @@ Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
import org.springframework.beans.factory.getBean
import org.springframework.beans.factory.getBean
// create and configure beans
val context = ClassPathXmlApplicationContext("services.xml", "daos.xml")
val context = ClassPathXmlApplicationContext("services.xml", "daos.xml")
// retrieve configured instance
val service = context.getBean<PetStoreService>("petStore")
// retrieve configured instance
val service = context.getBean<PetStoreService>("petStore")
// use configured instance
var userList = service.getUsernameList()
// use configured instance
var userList = service.getUsernameList()
----
======
@@ -402,6 +362,3 @@ code should never use them. Indeed, your application code should have no calls t
Spring's integration with web frameworks provides dependency injection for various web
framework components such as controllers and JSF-managed beans, letting you declare
a dependency on a specific bean through metadata (such as an autowiring annotation).
@@ -21,7 +21,6 @@ operate on shared `BeanDefinition` objects as a core metadata representation.
This is the essence of what makes Spring's container so flexible and extensible.
[[context-introduction-ctx-vs-beanfactory]]
== `BeanFactory` or `ApplicationContext`?
@@ -78,7 +78,3 @@ important (at least for singleton beans) that if you have a (parent) bean defini
which you intend to use only as a template, and this definition specifies a class, you
must make sure to set the __abstract__ attribute to __true__, otherwise the application
context will actually (attempt to) pre-instantiate the `abstract` bean.
@@ -1,28 +1,29 @@
[[beans-classpath-scanning]]
= Classpath Scanning and Managed Components
Most examples in this chapter use XML to specify the configuration metadata that produces
each `BeanDefinition` within the Spring container. The previous section
(xref:core/beans/annotation-config.adoc[Annotation-based Container Configuration]) demonstrates how to provide a lot of the configuration
metadata through source-level annotations. Even in those examples, however, the "base"
bean definitions are explicitly defined in the XML file, while the annotations drive only
the dependency injection. This section describes an option for implicitly detecting the
candidate components by scanning the classpath. Candidate components are classes that
match against a filter criteria and have a corresponding bean definition registered with
the container. This removes the need to use XML to perform bean registration. Instead, you
can use annotations (for example, `@Component`), AspectJ type expressions, or your own
Most examples in this chapter use XML to specify the configuration metadata that
produces each `BeanDefinition` within the Spring container. The previous section
(xref:core/beans/annotation-config.adoc[Annotation-based Container Configuration])
demonstrates how to provide a lot of the configuration metadata through source-level
annotations. Even in those examples, however, the "base" bean definitions are explicitly
defined in the XML file, while the annotations drive only the dependency injection.
This section describes an option for implicitly detecting the candidate components by
scanning the classpath. Candidate components are classes that match against filter
criteria and have a corresponding bean definition registered with the container.
This removes the need to use XML to perform bean registration. Instead, you can use
annotations (for example, `@Component`), AspectJ type expressions, or your own
custom filter criteria to select which classes have bean definitions registered with
the container.
[NOTE]
====
You can define beans using Java rather than using XML files. Take a look at the
`@Configuration`, `@Bean`, `@Import`, and `@DependsOn` annotations for examples of how to
use these features.
`@Configuration`, `@Bean`, `@Import`, and `@DependsOn` annotations for examples
of how to use these features.
====
[[beans-stereotype-annotations]]
== `@Component` and Further Stereotype Annotations
@@ -46,7 +47,6 @@ clearly the better choice. Similarly, as stated earlier, `@Repository` is alread
supported as a marker for automatic exception translation in your persistence layer.
[[beans-meta-annotations]]
== Using Meta-annotations and Composed Annotations
@@ -70,7 +70,7 @@ Java::
// ...
}
----
<1> The `@Component` causes `@Service` to be treated in the same way as `@Component`.
<1> The `@Component` meta-annotation causes `@Service` to be treated in the same way as `@Component`.
Kotlin::
+
@@ -85,7 +85,7 @@ Kotlin::
// ...
}
----
<1> The `@Component` causes `@Service` to be treated in the same way as `@Component`.
<1> The `@Component` meta-annotation causes `@Service` to be treated in the same way as `@Component`.
======
You can also combine meta-annotations to create "`composed annotations`". For example,
@@ -97,7 +97,7 @@ meta-annotations to allow customization. This can be particularly useful when yo
want to only expose a subset of the meta-annotation's attributes. For example, Spring's
`@SessionScope` annotation hard codes the scope name to `session` but still allows
customization of the `proxyMode`. The following listing shows the definition of the
`SessionScope` annotation:
`@SessionScope` annotation:
[tabs]
======
@@ -195,7 +195,6 @@ For further details, see the
wiki page.
[[beans-scanning-autodetection]]
== Automatically Detecting Classes and Registering Bean Definitions
@@ -212,7 +211,7 @@ Java::
@Service
public class SimpleMovieLister {
private MovieFinder movieFinder;
private final MovieFinder movieFinder;
public SimpleMovieLister(MovieFinder movieFinder) {
this.movieFinder = movieFinder;
@@ -252,11 +251,11 @@ Kotlin::
----
======
To autodetect these classes and register the corresponding beans, you need to add
`@ComponentScan` to your `@Configuration` class, where the `basePackages` attribute
is a common parent package for the two classes. (Alternatively, you can specify a
comma- or semicolon- or space-separated list that includes the parent package of each class.)
`@ComponentScan` to your `@Configuration` class, where the `basePackages` attribute is
configured with a common parent package for the two classes. Alternatively, you can
specify a comma-, semicolon-, or space-separated list that includes the parent package
of each class.
[tabs]
======
@@ -283,10 +282,10 @@ Kotlin::
----
======
NOTE: For brevity, the preceding example could have used the `value` attribute of the
annotation (that is, `@ComponentScan("org.example")`).
TIP: For brevity, the preceding example could have used the implicit `value` attribute of
the annotation instead: `@ComponentScan("org.example")`
The following alternative uses XML:
The following example uses XML configuration:
[source,xml,indent=0,subs="verbatim,quotes"]
----
@@ -326,17 +325,68 @@ sure that they are 'opened' (that is, that they use an `opens` declaration inste
Furthermore, the `AutowiredAnnotationBeanPostProcessor` and
`CommonAnnotationBeanPostProcessor` are both implicitly included when you use the
component-scan element. That means that the two components are autodetected and
wired together -- all without any bean configuration metadata provided in XML.
`<context:component-scan>` element. That means that the two components are autodetected
and wired together -- all without any bean configuration metadata provided in XML.
NOTE: You can disable the registration of `AutowiredAnnotationBeanPostProcessor` and
`CommonAnnotationBeanPostProcessor` by including the `annotation-config` attribute
with a value of `false`.
[[beans-scanning-placeholders-and-patterns]]
=== Property Placeholders and Ant-style Patterns
The `basePackages` and `value` attributes in `@ComponentScan` support `${...}` property
placeholders which are resolved against the `Environment` as well as Ant-style package
patterns such as `"org.example.+++**+++"`.
In addition, multiple packages or patterns may be specified, either separately or within
a single String — for example, `{"org.example.config", "org.example.service.+++**+++"}`
or `"org.example.config, org.example.service.+++**+++"`.
The following example specifies the `app.scan.packages` property placeholder for the
implicit `value` attribute in `@ComponentScan`.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan("${app.scan.packages}") // <1>
public class AppConfig {
// ...
}
----
<1> `app.scan.packages` property placeholder to be resolved against the `Environment`
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(["\${app.scan.packages}"]) // <1>
class AppConfig {
// ...
}
----
<1> `app.scan.packages` property placeholder to be resolved against the `Environment`
======
The following listing represents a properties file which defines the `app.scan.packages`
property. In the preceding example, it is assumed that this properties file has been
registered with the `Environment` for example, via `@PropertySource` or a similar
mechanism.
[source,properties,indent=0,subs="verbatim,quotes"]
----
app.scan.packages=org.example.config, org.example.service.**
----
[[beans-scanning-filters]]
== Using Filters to Customize Scanning
=== Using Filters to Customize Scanning
By default, classes annotated with `@Component`, `@Repository`, `@Service`, `@Controller`,
`@Configuration`, or a custom annotation that itself is annotated with `@Component` are
@@ -373,8 +423,8 @@ The following table describes the filtering options:
| A custom implementation of the `org.springframework.core.type.TypeFilter` interface.
|===
The following example shows the configuration ignoring all `@Repository` annotations
and using "`stub`" repositories instead:
The following example shows `@ComponentScan` configuration that excludes all
`@Repository` annotations and includes "`Stub`" repositories instead:
[tabs]
======
@@ -426,6 +476,366 @@ annotated or meta-annotated with `@Component`, `@Repository`, `@Service`, `@Cont
`@RestController`, or `@Configuration`.
[[beans-scanning-name-generator]]
=== Naming Autodetected Components
When a component is autodetected as part of the scanning process, its bean name is
generated by the `BeanNameGenerator` strategy known to that scanner.
By default, the `AnnotationBeanNameGenerator` is used. For Spring
xref:core/beans/classpath-scanning.adoc#beans-stereotype-annotations[stereotype annotations],
if you supply a name via the annotation's `value` attribute that name will be used as
the name in the corresponding bean definition. This convention also applies when the
`@jakarta.inject.Named` annotation is used instead of Spring stereotype annotations.
As of Spring Framework 6.1, the name of the annotation attribute that is used to specify
the bean name is no longer required to be `value`. Custom stereotype annotations can
declare an attribute with a different name (such as `name`) and annotate that attribute
with `@AliasFor(annotation = Component.class, attribute = "value")`. See the source code
declaration of `ControllerAdvice#name()` for a concrete example.
[WARNING]
====
As of Spring Framework 6.1, support for convention-based stereotype names is deprecated
and will be removed in a future version of the framework. Consequently, custom stereotype
annotations must use `@AliasFor` to declare an explicit alias for the `value` attribute
in `@Component`. See the source code declaration of `Repository#value()` and
`ControllerAdvice#name()` for concrete examples.
====
If an explicit bean name cannot be derived from such an annotation or for any other
detected component (such as those discovered by custom filters), the default bean name
generator returns the uncapitalized non-qualified class name. For example, if the
following component classes were detected, the names would be `myMovieLister` and
`movieFinderImpl`.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Service("myMovieLister")
public class SimpleMovieLister {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Service("myMovieLister")
class SimpleMovieLister {
// ...
}
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Repository
public class MovieFinderImpl implements MovieFinder {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Repository
class MovieFinderImpl : MovieFinder {
// ...
}
----
======
If you do not want to rely on the default bean-naming strategy, you can provide a custom
bean-naming strategy. First, implement either the
{spring-framework-api}/beans/factory/support/BeanNameGenerator.html[`BeanNameGenerator`] or
{spring-framework-api}/context/annotation/ConfigurationBeanNameGenerator.html[`ConfigurationBeanNameGenerator`]
interface, and be sure to include a default no-arg constructor. Then, provide the fully
qualified class name when configuring the scanner, as the following examples show.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", nameGenerator = MyNameGenerator.class)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], nameGenerator = MyNameGenerator::class)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example"
name-generator="org.example.MyNameGenerator" />
</beans>
----
[TIP]
====
If you run into naming conflicts due to multiple autodetected components having the same
non-qualified class name (for example, classes with identical names but residing in
different packages), you can configure a `BeanNameGenerator` that defaults to the
fully-qualified class name for the generated bean name. The
`FullyQualifiedAnnotationBeanNameGenerator` can be used for such purposes.
As of Spring Framework 7.0, if you encounter naming conflicts among `@Bean` methods in
`@Configuration` classes, you can alternatively configure a
`ConfigurationBeanNameGenerator` that generates unique bean names for `@Bean` methods.
The `FullyQualifiedConfigurationBeanNameGenerator` can be used to generate
fully-qualified default bean names for `@Bean` methods without an explicit `name`
attribute — for example, `com.example.MyConfig.myBean` for an `@Bean` method named
`myBean()` declared in `@Configuration` class `com.example.MyConfig`.
The `FullyQualifiedAnnotationBeanNameGenerator` and
`FullyQualifiedConfigurationBeanNameGenerator` both reside in the
`org.springframework.context.annotation` package.
====
As a general rule, consider specifying the name with the annotation whenever other
components may be making explicit references to it. On the other hand, the
auto-generated names are adequate whenever the container is responsible for wiring.
[[beans-scanning-scope-resolver]]
=== Providing a Scope for Autodetected Components
As with Spring-managed components in general, the default and most common scope for
autodetected components is `singleton`. However, sometimes you need a different scope
that can be specified by the `@Scope` annotation. You can provide the name of the
scope within the annotation, as the following example shows:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Scope("prototype")
@Repository
public class MovieFinderImpl implements MovieFinder {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Scope("prototype")
@Repository
class MovieFinderImpl : MovieFinder {
// ...
}
----
======
NOTE: `@Scope` annotations are only introspected on the concrete bean class (for annotated
components) or the factory method (for `@Bean` methods). In contrast to XML bean
definitions, there is no notion of bean definition inheritance, and inheritance
hierarchies at the class level are irrelevant for metadata purposes.
For details on web-specific scopes such as "`request`" or "`session`" in a Spring context,
see xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other[Request, Session, Application, and WebSocket Scopes].
As with the pre-built annotations for those scopes, you may also compose your own scoping
annotations by using Spring's meta-annotation approach: for example, a custom annotation
meta-annotated with `@Scope("prototype")`, possibly also declaring a custom scoped-proxy mode.
NOTE: To provide a custom strategy for scope resolution rather than relying on the
annotation-based approach, you can implement the
{spring-framework-api}/context/annotation/ScopeMetadataResolver.html[`ScopeMetadataResolver`]
interface. Be sure to include a default no-arg constructor. Then you can provide the
fully qualified class name when configuring the scanner, as the following example of both
an annotation and a bean definition shows:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", scopeResolver = MyScopeResolver.class)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], scopeResolver = MyScopeResolver::class)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example" scope-resolver="org.example.MyScopeResolver"/>
</beans>
----
When using certain non-singleton scopes, it may be necessary to generate proxies for the
scoped objects. The reasoning is described in
xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other-injection[Scoped Beans as Dependencies].
For this purpose, a scoped-proxy attribute is available on the component-scan
element. The three possible values are: `no`, `interfaces`, and `targetClass`. For example,
the following configuration results in standard JDK dynamic proxies:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", scopedProxy = ScopedProxyMode.INTERFACES)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], scopedProxy = ScopedProxyMode.INTERFACES)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example" scoped-proxy="interfaces"/>
</beans>
----
[[beans-scanning-qualifiers]]
=== Providing Qualifier Metadata with Annotations
The `@Qualifier` annotation is discussed in
xref:core/beans/annotation-config/autowired-qualifiers.adoc[Fine-tuning Annotation-based Autowiring with Qualifiers].
The examples in that section demonstrate the use of the `@Qualifier` annotation and
custom qualifier annotations to provide fine-grained control when you resolve autowire
candidates. Because those examples were based on XML bean definitions, the qualifier
metadata was provided on the candidate bean definitions by using the `qualifier` or `meta`
child elements of the `bean` element in the XML. When relying upon classpath scanning for
auto-detection of components, you can provide the qualifier metadata with type-level
annotations on the candidate class. The following three examples demonstrate this
technique:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Qualifier("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Qualifier("Action")
class ActionMovieCatalog : MovieCatalog
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Genre("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Genre("Action")
class ActionMovieCatalog : MovieCatalog {
// ...
}
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Offline
public class CachingMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Offline
class CachingMovieCatalog : MovieCatalog {
// ...
}
----
======
NOTE: As with most annotation-based alternatives, keep in mind that the annotation metadata is
bound to the class definition itself, while the use of XML allows for multiple beans
of the same type to provide variations in their qualifier metadata, because that
metadata is provided per-instance rather than per-class.
[[beans-factorybeans-annotations]]
== Defining Bean Metadata within Components
@@ -649,10 +1059,10 @@ methods anywhere. However, regular `@Bean` methods in `@Configuration` classes n
to be overridable -- that is, they must not be declared as `private` or `final`.
`@Bean` methods are also discovered on base classes of a given component or
configuration class, as well as on Java 8 default methods declared in interfaces
configuration class, as well as on Java default methods declared in interfaces
implemented by the component or configuration class. This allows for a lot of
flexibility in composing complex configuration arrangements, with even multiple
inheritance being possible through Java 8 default methods as of Spring 4.2.
inheritance being possible through Java default methods.
Finally, a single class may hold multiple `@Bean` methods for the same
bean, as an arrangement of multiple factory methods to use depending on available
@@ -661,356 +1071,3 @@ constructor or factory method in other configuration scenarios: The variant with
the largest number of satisfiable dependencies is picked at construction time,
analogous to how the container selects between multiple `@Autowired` constructors.
====
[[beans-scanning-name-generator]]
== Naming Autodetected Components
When a component is autodetected as part of the scanning process, its bean name is
generated by the `BeanNameGenerator` strategy known to that scanner.
By default, the `AnnotationBeanNameGenerator` is used. For Spring
xref:core/beans/classpath-scanning.adoc#beans-stereotype-annotations[stereotype annotations],
if you supply a name via the annotation's `value` attribute that name will be used as
the name in the corresponding bean definition. This convention also applies when the
`@jakarta.inject.Named` annotation is used instead of Spring stereotype annotations.
As of Spring Framework 6.1, the name of the annotation attribute that is used to specify
the bean name is no longer required to be `value`. Custom stereotype annotations can
declare an attribute with a different name (such as `name`) and annotate that attribute
with `@AliasFor(annotation = Component.class, attribute = "value")`. See the source code
declaration of `ControllerAdvice#name()` for a concrete example.
[WARNING]
====
As of Spring Framework 6.1, support for convention-based stereotype names is deprecated
and will be removed in a future version of the framework. Consequently, custom stereotype
annotations must use `@AliasFor` to declare an explicit alias for the `value` attribute
in `@Component`. See the source code declaration of `Repository#value()` and
`ControllerAdvice#name()` for concrete examples.
====
If an explicit bean name cannot be derived from such an annotation or for any other
detected component (such as those discovered by custom filters), the default bean name
generator returns the uncapitalized non-qualified class name. For example, if the
following component classes were detected, the names would be `myMovieLister` and
`movieFinderImpl`.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Service("myMovieLister")
public class SimpleMovieLister {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Service("myMovieLister")
class SimpleMovieLister {
// ...
}
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Repository
public class MovieFinderImpl implements MovieFinder {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Repository
class MovieFinderImpl : MovieFinder {
// ...
}
----
======
If you do not want to rely on the default bean-naming strategy, you can provide a custom
bean-naming strategy. First, implement the
{spring-framework-api}/beans/factory/support/BeanNameGenerator.html[`BeanNameGenerator`]
interface, and be sure to include a default no-arg constructor. Then, provide the fully
qualified class name when configuring the scanner, as the following example annotation
and bean definition show.
TIP: If you run into naming conflicts due to multiple autodetected components having the
same non-qualified class name (i.e., classes with identical names but residing in
different packages), you may need to configure a `BeanNameGenerator` that defaults to the
fully qualified class name for the generated bean name. The
`FullyQualifiedAnnotationBeanNameGenerator` located in package
`org.springframework.context.annotation` can be used for such purposes.
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", nameGenerator = MyNameGenerator.class)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], nameGenerator = MyNameGenerator::class)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example"
name-generator="org.example.MyNameGenerator" />
</beans>
----
As a general rule, consider specifying the name with the annotation whenever other
components may be making explicit references to it. On the other hand, the
auto-generated names are adequate whenever the container is responsible for wiring.
[[beans-scanning-scope-resolver]]
== Providing a Scope for Autodetected Components
As with Spring-managed components in general, the default and most common scope for
autodetected components is `singleton`. However, sometimes you need a different scope
that can be specified by the `@Scope` annotation. You can provide the name of the
scope within the annotation, as the following example shows:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Scope("prototype")
@Repository
public class MovieFinderImpl implements MovieFinder {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Scope("prototype")
@Repository
class MovieFinderImpl : MovieFinder {
// ...
}
----
======
NOTE: `@Scope` annotations are only introspected on the concrete bean class (for annotated
components) or the factory method (for `@Bean` methods). In contrast to XML bean
definitions, there is no notion of bean definition inheritance, and inheritance
hierarchies at the class level are irrelevant for metadata purposes.
For details on web-specific scopes such as "`request`" or "`session`" in a Spring context,
see xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other[Request, Session, Application, and WebSocket Scopes]. As with the pre-built annotations for those scopes,
you may also compose your own scoping annotations by using Spring's meta-annotation
approach: for example, a custom annotation meta-annotated with `@Scope("prototype")`,
possibly also declaring a custom scoped-proxy mode.
NOTE: To provide a custom strategy for scope resolution rather than relying on the
annotation-based approach, you can implement the
{spring-framework-api}/context/annotation/ScopeMetadataResolver.html[`ScopeMetadataResolver`]
interface. Be sure to include a default no-arg constructor. Then you can provide the
fully qualified class name when configuring the scanner, as the following example of both
an annotation and a bean definition shows:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", scopeResolver = MyScopeResolver.class)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], scopeResolver = MyScopeResolver::class)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example" scope-resolver="org.example.MyScopeResolver"/>
</beans>
----
When using certain non-singleton scopes, it may be necessary to generate proxies for the
scoped objects. The reasoning is described in xref:core/beans/factory-scopes.adoc#beans-factory-scopes-other-injection[Scoped Beans as Dependencies].
For this purpose, a scoped-proxy attribute is available on the component-scan
element. The three possible values are: `no`, `interfaces`, and `targetClass`. For example,
the following configuration results in standard JDK dynamic proxies:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = "org.example", scopedProxy = ScopedProxyMode.INTERFACES)
public class AppConfig {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Configuration
@ComponentScan(basePackages = ["org.example"], scopedProxy = ScopedProxyMode.INTERFACES)
class AppConfig {
// ...
}
----
======
[source,xml,indent=0,subs="verbatim,quotes"]
----
<beans>
<context:component-scan base-package="org.example" scoped-proxy="interfaces"/>
</beans>
----
[[beans-scanning-qualifiers]]
== Providing Qualifier Metadata with Annotations
The `@Qualifier` annotation is discussed in
xref:core/beans/annotation-config/autowired-qualifiers.adoc[Fine-tuning Annotation-based Autowiring with Qualifiers].
The examples in that section demonstrate the use of the `@Qualifier` annotation and
custom qualifier annotations to provide fine-grained control when you resolve autowire
candidates. Because those examples were based on XML bean definitions, the qualifier
metadata was provided on the candidate bean definitions by using the `qualifier` or `meta`
child elements of the `bean` element in the XML. When relying upon classpath scanning for
auto-detection of components, you can provide the qualifier metadata with type-level
annotations on the candidate class. The following three examples demonstrate this
technique:
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Qualifier("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Qualifier("Action")
class ActionMovieCatalog : MovieCatalog
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Genre("Action")
public class ActionMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Genre("Action")
class ActionMovieCatalog : MovieCatalog {
// ...
}
----
======
[tabs]
======
Java::
+
[source,java,indent=0,subs="verbatim,quotes"]
----
@Component
@Offline
public class CachingMovieCatalog implements MovieCatalog {
// ...
}
----
Kotlin::
+
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
@Component
@Offline
class CachingMovieCatalog : MovieCatalog {
// ...
}
----
======
NOTE: As with most annotation-based alternatives, keep in mind that the annotation metadata is
bound to the class definition itself, while the use of XML allows for multiple beans
of the same type to provide variations in their qualifier metadata, because that
metadata is provided per-instance rather than per-class.
@@ -24,7 +24,6 @@ package also provides the following functionality:
`HierarchicalBeanFactory` interface.
[[context-functionality-messagesource]]
== Internationalization using `MessageSource`
@@ -273,7 +272,6 @@ See the {spring-framework-api}/context/support/ReloadableResourceBundleMessageSo
javadoc for details.
[[context-functionality-events]]
== Standard and Custom Events
@@ -513,7 +511,7 @@ the classes above:
<property name="notificationAddress" value="blockedlist@example.org"/>
</bean>
<!-- optional: a custom ApplicationEventMulticaster definition -->
<!-- optional: a custom ApplicationEventMulticaster definition -->
<bean id="applicationEventMulticaster" class="org.springframework.context.event.SimpleApplicationEventMulticaster">
<property name="taskExecutor" ref="..."/>
<property name="errorHandler" ref="..."/>
@@ -534,7 +532,6 @@ complete support for building lightweight,
https://www.enterpriseintegrationpatterns.com[pattern-oriented], event-driven
architectures that build upon the well-known Spring programming model.
[[context-functionality-events-annotation]]
=== Annotation-based Event Listeners
@@ -578,7 +575,7 @@ Kotlin::
----
======
NOTE: Do not define such beans to be lazy as the `ApplicationContext` will honour that and will not register the method to listen to events.
NOTE: Do not define such beans to be lazy as the `ApplicationContext` will honor that and will not register the method to listen to events.
The method signature once again declares the event type to which it listens,
but, this time, with a flexible name and without implementing a specific listener interface.
@@ -707,7 +704,6 @@ The `handleBlockedListEvent()` method publishes a new `ListUpdateEvent` for ever
`BlockedListEvent` that it handles. If you need to publish several events, you can return
a `Collection` or an array of events instead.
[[context-functionality-events-async]]
=== Asynchronous Listeners
@@ -754,7 +750,6 @@ Be aware of the following limitations when using asynchronous events:
See xref:integration/observability.adoc#observability.application-events[the `@EventListener` Observability section]
for more information on Observability concerns.
[[context-functionality-events-order]]
=== Ordering Listeners
@@ -786,7 +781,6 @@ Kotlin::
----
======
[[context-functionality-events-generics]]
=== Generic Events
@@ -880,7 +874,6 @@ for example, for processing all events asynchronously and/or for handling listen
----
[[context-functionality-resources]]
== Convenient Access to Low-level Resources
@@ -913,7 +906,6 @@ with special prefixes to force loading of definitions from the classpath or a UR
regardless of the actual context type.
[[context-functionality-startup]]
== Application Startup Tracking
@@ -941,13 +933,12 @@ Java::
[source,java,indent=0,subs="verbatim,quotes"]
----
// create a startup step and start recording
StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan");
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages));
// perform the actual phase we're instrumenting
this.scanner.scan(basePackages);
// end the current step
scanPackages.end();
try (StartupStep scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")) {
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages));
// perform the actual phase we're instrumenting
this.scanner.scan(basePackages);
}
----
Kotlin::
@@ -955,13 +946,12 @@ Kotlin::
[source,kotlin,indent=0,subs="verbatim,quotes"]
----
// create a startup step and start recording
val scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages))
// perform the actual phase we're instrumenting
this.scanner.scan(basePackages)
// end the current step
scanPackages.end()
try (val scanPackages = getApplicationStartup().start("spring.context.base-packages.scan")) {
// add tagging information to the current step
scanPackages.tag("packages", () -> Arrays.toString(basePackages));
// perform the actual phase we're instrumenting
this.scanner.scan(basePackages);
}
----
======
@@ -990,6 +980,7 @@ or ask for the `ApplicationStartup` type on any injection point.
NOTE: Developers should not use the `"spring.*"` namespace when creating custom startup steps.
This namespace is reserved for internal Spring usage and is subject to change.
[[context-create]]
== Convenient ApplicationContext Instantiation for Web Applications
@@ -1022,7 +1013,6 @@ Examples are `/WEB-INF/{asterisk}Context.xml` (for all files with names that end
(for all such files in any subdirectory of `WEB-INF`).
[[context-deploy-rar]]
== Deploying a Spring `ApplicationContext` as a Jakarta EE RAR File
@@ -1053,7 +1043,8 @@ all application classes into a RAR file (which is a standard JAR file with a dif
file extension).
. Add all required library JARs into the root of the RAR archive.
. Add a
`META-INF/ra.xml` deployment descriptor (as shown in the {spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`])
`META-INF/ra.xml` deployment descriptor (as shown in the
{spring-framework-api}/jca/context/SpringContextResourceAdapter.html[javadoc for `SpringContextResourceAdapter`])
and the corresponding Spring XML bean definition file(s) (typically
`META-INF/applicationContext.xml`).
. Drop the resulting RAR file into your
@@ -1066,7 +1057,3 @@ other modules. A RAR-based `ApplicationContext` may also, for example, schedule
or react to new files in the file system (or the like). If it needs to allow synchronous
access from the outside, it could (for example) export RMI endpoints, which may be used
by other application modules on the same machine.
@@ -45,8 +45,5 @@ xref:data-access/orm/jpa.adoc[Spring's JPA support] where load-time weaving may
necessary for JPA class transformation.
Consult the
{spring-framework-api}/orm/jpa/LocalContainerEntityManagerFactoryBean.html[`LocalContainerEntityManagerFactoryBean`]
javadoc for more detail. For more on AspectJ load-time weaving, see xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework].
javadoc for more detail. For more on AspectJ load-time weaving, see
xref:core/aop/using-aspectj.adoc#aop-aj-ltw[Load-time Weaving with AspectJ in the Spring Framework].
@@ -57,9 +57,9 @@ The following table describes these properties:
In addition to bean definitions that contain information on how to create a specific
bean, the `ApplicationContext` implementations also permit the registration of existing
objects that are created outside the container (by users). This is done by accessing the
ApplicationContext's `BeanFactory` through the `getBeanFactory()` method, which returns
the `DefaultListableBeanFactory` implementation. `DefaultListableBeanFactory` supports
this registration through the `registerSingleton(..)` and `registerBeanDefinition(..)`
ApplicationContext's `BeanFactory` through the `getAutowireCapableBeanFactory()` method,
which returns the `DefaultListableBeanFactory` implementation. `DefaultListableBeanFactory`
supports this registration through the `registerSingleton(..)` and `registerBeanDefinition(..)`
methods. However, typical applications work solely with beans defined through regular
bean definition metadata.
@@ -74,7 +74,6 @@ lead to concurrent access exceptions, inconsistent state in the bean container,
====
[[beans-definition-overriding]]
== Overriding Beans
@@ -100,11 +99,10 @@ the `@Bean` factory method in favor of any pre-declared constructor on the bean
****
NOTE: We acknowledge that overriding beans in test scenarios is convenient, and there is
explicit support for this as of Spring Framework 6.2. Please refer to
explicit support for this. Please refer to
xref:testing/testcontext-framework/bean-overriding.adoc[this section] for more details.
[[beans-beanname]]
== Naming Beans
@@ -147,7 +145,6 @@ case when there is more than one character and both the first and second charact
are upper case, the original casing gets preserved. These are the same rules as
defined by `java.beans.Introspector.decapitalize` (which Spring uses here).
[[beans-beanname-alias]]
=== Aliasing a Bean outside the Bean Definition
@@ -197,7 +194,6 @@ See xref:core/beans/java/bean-annotation.adoc[Using the `@Bean` Annotation] for
****
[[beans-factory-class]]
== Instantiating Beans
@@ -209,7 +205,8 @@ If you use XML-based configuration metadata, you specify the type (or class) of
that is to be instantiated in the `class` attribute of the `<bean/>` element. This
`class` attribute (which, internally, is a `Class` property on a `BeanDefinition`
instance) is usually mandatory. (For exceptions, see
xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method] and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].)
xref:core/beans/definition.adoc#beans-factory-class-instance-factory-method[Instantiation by Using an Instance Factory Method]
and xref:core/beans/child-bean-definitions.adoc[Bean Definition Inheritance].)
You can use the `Class` property in one of two ways:
* Typically, to specify the bean class to be constructed in the case where the container
@@ -233,7 +230,6 @@ a bean definition would be `com.example.SomeThing$OtherThing` or
`com.example.SomeThing.OtherThing`.
****
[[beans-factory-class-ctor]]
=== Instantiation with a Constructor
@@ -268,7 +264,6 @@ NOTE: In the case of constructor arguments, the container can select a correspon
constructor among several overloaded constructors. That said, to avoid ambiguities,
it is recommended to keep your constructor signatures as straightforward as possible.
[[beans-factory-class-static-factory-method]]
=== Instantiation with a Static Factory Method
@@ -346,7 +341,6 @@ overloads of the `mock` method. Choose the most specific variant of `mock` possi
----
====
[[beans-factory-class-instance-factory-method]]
=== Instantiation by Using an Instance Factory Method
@@ -478,7 +472,6 @@ xref:core/beans/definition.adoc#beans-factory-class-static-factory-method[static
`FactoryBean` (notice the capitalization) refers to a Spring-specific
xref:core/beans/factory-extension.adoc#beans-factory-extension-factorybean[`FactoryBean`] implementation class.
[[beans-factory-type-determination]]
=== Determining a Bean's Runtime Type
@@ -494,5 +487,3 @@ The recommended way to find out about the actual runtime type of a particular be
a `BeanFactory.getType` call for the specified bean name. This takes all of the above
cases into account and returns the type of object that a `BeanFactory.getBean` call is
going to return for the same bean name.

Some files were not shown because too many files have changed in this diff Show More