Commit Graph

32412 Commits

Author SHA1 Message Date
Brian Clozel 536f115c37 Release v7.0.0-M3 v7.0.0-M3 2025-03-13 10:04:02 +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