Commit Graph

29646 Commits

Author SHA1 Message Date
Juergen Hoeller ea596aa211 Select most specific advice method in case of override
Closes gh-32865
2024-05-22 10:00:31 +02:00
Juergen Hoeller 58da30cd30 Upgrade to Jetty Reactive HttpClient 4.0.4 2024-05-21 19:22:20 +02:00
Juergen Hoeller cd33b4e35a Polishing 2024-05-21 18:25:57 +02:00
Juergen Hoeller 20dea0dae2 Polishing 2024-05-21 17:39:11 +02:00
Juergen Hoeller fee17e11ba Default fallback parsing for UTC without milliseconds
Closes gh-32856
2024-05-21 17:39:06 +02:00
Juergen Hoeller 65e1337d35 Polishing 2024-05-21 11:16:25 +02:00
Juergen Hoeller a4c2f291d9 Avoid creation of SAXParserFactory for every read operation
Includes JAXBContext locking revision (avoiding synchronization) and consistent treatment of DocumentBuilderFactory (in terms of caching as well as locking).

Closes gh-32851
2024-05-21 11:16:19 +02:00
Stéphane Nicoll f26483d272 Detect deprecated element in generic types
This commit updates Spring AOT to suppress a deprecation warning for
a generic type that has a deprecated element. Previously we only were
checking for the raw class.

Closes gh-32850
2024-05-21 08:53:18 +02:00
Stéphane Nicoll 481d036f7a Avoid reader on empty content to be shared by multiple requests
This commit avoids several instances of MockHttpServletRequest to
have a common reader for empty content as closing it will have an
unwanted side effect on the others.

Closes gh-32820
2024-05-20 13:58:36 +02:00
Sébastien Deleuze 2a2ef443a5 Refine CDS documentation
Closes gh-32843
2024-05-20 10:24:29 +02:00
Juergen Hoeller 617833bec9 Defensively catch and log pointcut parsing exceptions
Closes gh-32838
See gh-32793
2024-05-17 12:27:59 +02:00
Spring Builds 4d633c2ea8 Next development version (v6.1.8-SNAPSHOT) 2024-05-16 09:04:43 +00:00
rstoyanchev 010e8a303b Polishing contribution
Closes gh-32799
2024-05-15 20:06:48 +01:00
Matteo Cristoforo 78549d4963 Fix cookie management in reactive JdkClientHttpRequest
Prevent cookies to be set to empty in the HTTP request if no cookie
is present

See gh-32799
2024-05-15 20:02:04 +01:00
Juergen Hoeller e4e6910122 Polishing 2024-05-15 14:15:52 +02:00
Juergen Hoeller 2270df515b Enforce cleaned URL for root resource from ClassLoader
Closes gh-32828
2024-05-15 14:15:47 +02:00
Juergen Hoeller 70886e32c0 Upgrade to Reactor 2023.0.6
Includes AspectJ 1.9.22.1, Tomcat 10.1.24, Jetty 12.0.9, Mockito 5.12

Closes gh-32786
2024-05-14 22:01:07 +02:00
Juergen Hoeller e509385eae Add InputStreamResource(InputStreamSource) constructor for lambda expressions
Includes notes for reliable InputStream closing, in particular with Spring MVC.

Closes gh-32802
2024-05-14 21:59:42 +02:00
Juergen Hoeller b7aafda872 Polishing 2024-05-14 13:43:35 +02:00
Brian Clozel a89a88d17c Upgrade to Micrometer 1.12.6
Closes gh-32810
2024-05-13 21:25:09 +02:00
Brian Clozel c6b6ccdc89 Close ResponseBodyEmitter in case of write errors
Prior to this commit, the `ReactiveTypeHandler` would handle `Flux`-like
return types from controller methods and adapt them to SSE streams using
the `SseEmitter`/`ResponseBodyEmitter` APIs. In case an `IOException` is
thrown while writing to the HTTP response stream, the
`ReactiveTypeHandler` would rely on the Servlet container to call
`AsyncListener#onError` - this would be the signal for Spring MVC to
complete the async exchange. To prevent racing issues between this
signal and the actual handling of the exception, changes like  gh-20173
were applied. Since then, robust checks were added with gh-32340 in
`StandardServletAsyncWebRequest.LifecycleHttpServletResponse`.

With Jetty 12, `AsyncListener#onError` would not be called as the error
would happen while writing in blocking mode to the response (so, not
using the Servlet WriteListener contract). But still, such `IOException`
would still result in the closing of the HTTP connection. As of Jetty
12.0.4, this is no longer the case and the party managing the async
lifecycle is in charge of completing the exchange, as it should. This
means that the current behavior leaks HTTP connections for these cases
and causes memory issues.

This commit ensures that such exceptions happening during response
writes are caught and result in the completion of the `SSEEmitter` and
the closing of the exchange. Even if other Servlet containers still
propagate the error `AsyncListener#onError`, competing signals are still
managed with gh-32340.

Closes gh-32629
2024-05-13 20:30:13 +02:00
Brian Clozel 09b8feadc2 Document streaming/collecting behavior for Flux return values
Closes gh-32630
2024-05-13 13:12:53 +02:00
rstoyanchev d03ea0bf19 Update docs on HandlerInterceptor
Closes gh-32729
2024-05-13 11:40:32 +01:00
rstoyanchev a5a1ef6b30 Use instance field for ProblemDetail in ErrorResponse's
Closes gh-32644
2024-05-13 11:40:32 +01:00
rstoyanchev 1b60b86bb2 Update MockMvc section on Streaming in the docs
Closes gh-32687
2024-05-13 11:40:32 +01:00
Brian Clozel 89ce63f1f3 Replace RFC7807 by RFC9457 in documentation
This commit updates all references to RFC7807 by RFC9457 since the
former is now obsolete.

Closes gh-32806
2024-05-13 10:42:35 +02:00
Sam Brannen 7536980be9 Fix Dokka links to Spring Framework and Servlet APIs
This commit fixes links from Spring Framework's Dokka HTML to Javadoc
for Spring Framework and Servlet APIs by explicitly configuring the
`element-list` page as the `package-list` in the Dokka Gradle plugin.

Closes gh-32797
2024-05-12 12:29:52 +02:00
Sam Brannen c1229b03a7 Polishing 2024-05-11 16:01:08 +02:00
Juergen Hoeller a4135bac5c Leniently ignore unsupported pointcut expression
See gh-32793
2024-05-10 13:52:39 +02:00
Juergen Hoeller bf08e0c1b4 Polishing 2024-05-10 12:27:29 +02:00
Juergen Hoeller 9202c0ad41 Accept ajc-compiled @Aspect classes for Spring AOP proxy usage
Closes gh-32793
2024-05-10 12:27:12 +02:00
Juergen Hoeller 22b6d66a28 Document @Order behavior on @Configuration classes versus @Bean methods
Includes brief note on self injection (extracted from qualifiers section).

Closes gh-30177
Closes gh-28299
2024-05-08 17:52:02 +02:00
Juergen Hoeller 9376e6322d Revise IoC container introduction for modern configuration styles
Includes @Configuration(proxyBeanMethods=false) documentation.

Closes gh-32429
2024-05-08 17:51:25 +02:00
Juergen Hoeller 0eb937a866 Document limitations of CGLIB proxy class generation in JPMS module setups
Includes extended exception messages with common hints and explanations.

Closes gh-32671
2024-05-08 17:51:17 +02:00
Stéphane Nicoll 6250b64766 Add support for form data in MockHttpServletRequestBuilder
Closes gh-32757
2024-05-08 11:56:16 +02:00
Stéphane Nicoll 5b1278d03c Refine exception message to include bean name
Closes gh-32775
2024-05-08 10:27:34 +02:00
Juergen Hoeller 4f02be263f Polishing 2024-05-07 15:52:13 +02:00
Juergen Hoeller 05d9b52b19 Polishing 2024-05-06 20:10:40 +02:00
Juergen Hoeller 59a125d06f Unwrap raw target Query instance in case of proxy mismatch
Closes gh-32766
2024-05-06 20:09:43 +02:00
Sam Brannen aebc48ee8d Revise contribution
See gh-32704
2024-05-03 17:04:11 +03:00
Mikaël Francoeur f51be0a17e Support varargs invocations in SpEL for varargs array subtype
Closes gh-32704
2024-05-03 17:04:11 +03:00
Sam Brannen 1d2b5a15c3 Polishing 2024-05-03 17:04:11 +03:00
Sam Brannen 4baad16437 Include repeatable annotation container in MergedAnnotations results
A bug has existed in Spring's MergedAnnotations support since it was
introduced in Spring Framework 5.2. Specifically, if the
MergedAnnotations API is used to search for annotations with "standard
repeatable annotation" support enabled (which is the default), it's
possible to search for a repeatable annotation but not for the
repeatable annotation's container annotation.

The reason is that MergedAnnotationFinder.process(Object, int, Object,
Annotation) does not process the container annotation and instead only
processes the "contained" annotations, which prevents a container
annotation from being included in search results.

In #29685, we fixed a bug that prevented the MergedAnnotations support
from recognizing an annotation as a container if the container
annotation declares attributes other than the required `value`
attribute. As a consequence of that bug fix, since Spring Framework
5.3.25, the MergedAnnotations infrastructure considers such an
annotation a container, and due to the aforementioned bug the container
is no longer processed, which results in a regression in behavior for
annotation searches for such a container annotation.

This commit addresses the original bug as well as the regression by
processing container annotations in addition to the contained
repeatable annotations.

See gh-29685
Closes gh-32731
2024-05-03 12:18:04 +03:00
Stéphane Nicoll abcc1dfc6c Review usage of BindingReflectionHintsRegistrar#registerReflectionHints
Closes gh-32753
2024-05-02 16:53:59 +02:00
Brian Clozel 47c5cd208c Add missing "Content-Length: 0" header with HttpComponents
Prior to this commit, HTTP requests sent with the
`HttpComponentsClientHttpRequestFactory` would not set a
"Content-Length" header for empty request bodies. Setting a request
entity is the expected behavior for unsafe HTTP methods, and this would
align the behavior with other HTTP clients.
Developers would often rely on `BufferingClientHttpRequestFactory` to
set this information on the request.

This commit ensures that a `NullEntity` is used for unsafe HTTP methods,
when no body has been set for the request. This result in a
"Content-Length:0" request header.

Fixes gh-32678
2024-05-02 15:42:35 +02:00
Sam Brannen 5a24e94d2e Polish tests 2024-05-02 13:28:48 +03:00
Stéphane Nicoll f90bdbef42 Add noop implementation for ResponseErrorHandler
Closes gh-32750
2024-05-02 11:44:42 +02:00
Sébastien Deleuze f17527a48b Use expectBody<Person>() in WebTestClient documentation
Closes gh-32733
2024-05-02 11:07:36 +02:00
Brian Clozel 64b0283042 Revert "Do not set 0 Content-Length header in BufferingClientHttpRequestFactory"
This reverts commit b3a45670f9.

See gh-32650
2024-05-02 09:11:54 +02:00
Juergen Hoeller 25cedcfb99 Consistently propagate ApplicationStartup to BeanFactory
Closes gh-32747
2024-05-01 18:06:27 +02:00