Commit Graph

28884 Commits

Author SHA1 Message Date
Juergen Hoeller bd65a19d71 Introduce write method fallback step for overloaded setter methods
Closes gh-31872
2023-12-21 14:32:10 +01:00
Sébastien Deleuze 85cb6cc5fb Support Kotlin extensions in web handlers
This commit restores support for Kotlin extensions in
web handlers, and adds support for invoking reflectively
suspending extension functions, as well as the other
features supported as of Spring Framework 6.1 like
value classes and default value for parameters.

Closes gh-31876
2023-12-21 12:16:33 +01:00
Juergen Hoeller 5f8a031c22 Introduce "spring.cache.reactivestreams.ignore" escape hatch
Closes gh-31861
2023-12-21 11:14:33 +01:00
Juergen Hoeller dc564f3ef2 Respect cache hit when empty Mono/Flux response is returned
Closes gh-31868
2023-12-20 22:52:51 +01:00
rstoyanchev d7ce13c763 Revert use of leafBean in MethodValidationAdapter
The goal for #31530 was to support bean validation on Set and other
method parameters that are containers of value(s) for which there is
a registered Jakarta Validation ValueExtractor.

Unfortunately, bean validation does not expose the unwrapped value
for a Path.Node, which we need for a method parameter in order to
create a BindingResult for the specific bean within the container,
and the leafBean that we tried to use is really the node at the
very bottom of the property path (i.e. not what we need).

This change removes the use of beanLeaf, restores the logic as it
was before, adds support for arrays, and a new test class for
scenarios with cascaded violations.

See gh-31746
2023-12-20 17:56:05 +00:00
Stéphane Nicoll 7b9037b054 Merge pull request #31875 from izeye
* pr/31875:
  Polish Javadoc for ClientRequestObservationContext constructors

Closes gh-31875
2023-12-20 17:29:45 +01:00
Johnny Lim 3162afbf16 Polish Javadoc for ClientRequestObservationContext constructors
See gh-31875
2023-12-20 17:26:29 +01:00
Stéphane Nicoll 1bd523f6b6 Polish 2023-12-20 09:52:55 +01:00
Juergen Hoeller 4c0d0ba5b3 Use standard String comparison in PropertyDescriptorComparator
Closes gh-31866
2023-12-20 08:45:53 +01:00
Stéphane Nicoll 212346a86d Polish 2023-12-19 19:48:42 +01:00
Brian Clozel 564803f56a Trigger JDK 22 builds every morning in CI
Closes gh-31459
2023-12-19 18:39:23 +01:00
Brian Clozel df708d16e4 Add missing JDK env variable in CI script 2023-12-19 18:23:22 +01:00
Brian Clozel 848dedb576 Upgrade CI to JDK 22ea28 2023-12-19 18:08:36 +01:00
Brian Clozel 4516e0d413 Ignore XML tests on JDK 22
This is until https://bugs.openjdk.org/browse/JDK-8322216 is resolved.

See gh-31459
2023-12-19 18:06:47 +01:00
Juergen Hoeller a23375c49d Document JDBC driver requirement for KeyHolder-based update methods
Closes gh-31486
2023-12-19 17:53:32 +01:00
Brian Clozel 53b937976d Reject setups with multiple observation conventions
Prior to this commit, the `WebHttpHandlerBuilder` would only configure
a custom observation convention if there is a single convention in the
application context. It would other wise use the default.

This commit aligns with the previous Spring Boot behavior where multiple
conventions setups are rejected as invalid with
`NoUniqueBeanDefinitionException`.

Fixes gh-31864
2023-12-19 17:35:02 +01:00
Sébastien Deleuze 12f01f9b5f Add support for @RequestMapping on Kotlin property accessors
This commit refines InvocableHandlerMethod (both Servlet and
Reactive variants) in order to support annotated property
accessors as they translate into regular Java methods, instead
of throwing a NullPointerException.

Closes gh-31856
2023-12-19 12:29:55 +01:00
Sébastien Deleuze 917978cbc2 Refactor InvocableHandlerMethodKotlinTests
The variant in org.springframework.web.method.support in
order to allow testing with a various classes.

See gh-31856
2023-12-19 12:10:13 +01:00
rstoyanchev 3f5c3b1747 Fix checkstyle violation
See gh-31711
2023-12-18 15:32:18 +00:00
rstoyanchev bec7210b4b Improve check to skip bean validation in DataBinder
DataBinder should skip any jakarta.validation.Validator yielding
to method validation when that is expected. This change improves
the check to skip by unwrapping the validator from in a
SmartValidator before checking if it is for bean validation.

Closes gh-31711
2023-12-18 15:25:18 +00:00
rstoyanchev 0a94dce41d Improve HandlerMethod check when method validation applies
Method validation needs to be used for a container such as a List or
Map, but until now we were only checking for a List container.
Moreover, in gh-31530 we improved method validation to also cover
any Collection.

This change aligns with HandlerMethod check for when method validation
applies with the underlying ability of method validation.
2023-12-18 15:25:18 +00:00
Stéphane Nicoll 9b3afcdac7 Merge pull request #31845 from bohub12
* pr/31845:
  Polish "Replace deprecated usage of project.buildDir"
  Replace deprecated usage of project.buildDir

Closes gh-31845
2023-12-18 16:24:11 +01:00
Stéphane Nicoll 8eb524dc4d Polish "Replace deprecated usage of project.buildDir"
See gh-31845
2023-12-18 16:24:02 +01:00
bohub12 dee8108bbc Replace deprecated usage of project.buildDir
See gh-31845
2023-12-18 16:24:02 +01:00
Juergen Hoeller 045c5dc1b4 Detect Jetty 12 "max length exceeded" message in handleParseFailure
Closes gh-31850
2023-12-18 16:18:27 +01:00
Arjen Poutsma 24f8eac12a Improve ByteBuffer copy method
This commit improves JettyWebSocketHandlerAdapter::copyByteBuffer so
that it allocates a buffer large enough for the remaining bytes
contained in the source, instead of allocating one with the capacity of
the source.

Closes gh-31857
2023-12-18 15:23:27 +01:00
Stéphane Nicoll eaf7a28250 Write runtime hints with deterministic order
This commit updates the JSON writers to use a deterministic order for
arrays. Previously, the order could change with the same content,
breaking caching.

Closes gh-31852
2023-12-18 14:57:13 +01:00
Stéphane Nicoll 7965c1969f Merge pull request #31802 from Drezir
* pr/31802:
  Polish "Use String.repeat instead of explicit cycle"
  Use String.repeat instead of explicit cycle

Closes gh-31802
2023-12-18 14:11:35 +01:00
Stéphane Nicoll d0574197ea Polish "Use String.repeat instead of explicit cycle"
See gh-31802
2023-12-18 14:10:16 +01:00
Adam Ostrožlík 63b2787da6 Use String.repeat instead of explicit cycle
See gh-31802
2023-12-18 13:54:03 +01:00
Arjen Poutsma 1ff683b259 Correctly set capacity of remainder in DefaultDataBuffer::split
This commit ensures that the capacity of the remainder buffer after a
split operation is set directly on the field. Calling capacity(int)
caused a new buffer to be allocated.

Closes gh-31848
2023-12-18 11:45:02 +01:00
Stéphane Nicoll 22bf4df290 Polish 2023-12-16 19:19:33 +01:00
Yaklede b56fc50c27 Update copyright headers in spring-test
Closes gh-31853
2023-12-16 14:23:37 +01:00
Sébastien Deleuze d2aa6a98f2 Polishing
Closes gh-31846
2023-12-15 10:12:15 +01:00
T45K bf0819390f Support Kotlin value classes as suspending function arguments
Similar to gh-31698 but for Coroutines.

See gh-31846
2023-12-15 10:11:59 +01:00
dogglezz 503ccb577c Remove unused imports
Closes gh-31851
2023-12-15 09:35:17 +01:00
Stéphane Nicoll 2f7e650122 Merge pull request #31847 from achhibi
* pr/31847:
  Upgrade copyright year of changed file
  Combine conditions for better readability and simplicity

Closes gh-31847
2023-12-15 07:37:26 +01:00
Stéphane Nicoll 68931a2091 Upgrade copyright year of changed file
See gh-31847
2023-12-15 07:36:50 +01:00
achhibi 7f79ccbec0 Combine conditions for better readability and simplicity 2023-12-14 20:29:09 +01:00
Sébastien Deleuze 43c2e51d6e Document BytecodeProviderImpl substitution related issue
See gh-29549
See gh-31051
2023-12-14 15:37:43 +01:00
Spring Builds 66b8f369dc Next development version (v6.1.3-SNAPSHOT) 2023-12-14 10:42:10 +00:00
Juergen Hoeller d4406507d0 Polishing 2023-12-14 00:12:22 +01:00
Juergen Hoeller a612518f96 Check startup/shutdown thread state for close bypass in shutdown hook
See gh-31811
2023-12-14 00:12:12 +01:00
rstoyanchev ec0ec7a0d6 Avoid nested constructor binding if there are no request parameters
Closes gh-31821
2023-12-13 18:06:16 +00:00
Brian Clozel 0970b1dc7a Optimize ContentCachingRequestWrapper allocation
This commit builds on top of changes made in gh-29775 and gh-31737.
Before this change, we would allocate several byte arrays even in cases
of known request size. This could decrease performance when getting the
cached content as it requires merging several arrays and data is not
colocated in memory.

This change ensures that we create a `FastByteArrayOutputStream`
instance with the known request size so that the first allocated segment
can contain the entire content.
If the request size is not know, we will default back on the default
allocation size for the `FastByteArrayOutputStream`.

Closes gh-31834
2023-12-13 18:47:32 +01:00
Sébastien Deleuze a01c6d57bb Inherit parent context in coRouter DSL
This commit also allows context override, as it
is useful for the nested router use case.

Closes gh-31831
2023-12-13 16:00:22 +01:00
Sam Brannen 8d4deca2a6 Introduce test for XML replaced-method element without explicit arg-type
This commit introduces an integration test for the regression fixed in
the previous commit (cd64e6676c).

Closes gh-31826
2023-12-13 15:04:15 +01:00
Juergen Hoeller cd64e6676c Prepare method overrides when bean class gets resolved
See gh-31826
2023-12-13 14:33:13 +01:00
rstoyanchev 2acc7c609f Refine RequestMappingInfo path initialization
Refining the change from 43700302c6 so that
we consistently pick a PathPatternParser (a) if it is provided, and (b)
if both PathPatternParser and PathMatcher are not provided. Also applying
the same in the mutate builder.

See gh-31662
2023-12-13 12:10:53 +00:00
Stéphane Nicoll 409cecfff9 Add custom code generation for bean definition property values
This commits allows ValueCodeGenerator$Delegate implementations to be
loaded from `META-INF/spring/aot.factories` and considered for code
generation of bean definition property values. This default behavior
in DefaultBeanRegistrationCodeFragments can be customized as usual.

Closes gh-31427
2023-12-13 07:14:55 +01:00