Commit Graph

20123 Commits

Author SHA1 Message Date
Arjen Poutsma 9f7dd9f352 Add test for usage of bodyToMono in WebClient.ResponseSpec::onStatus
See gh-23365
2019-11-19 10:22:54 +01:00
Sam Brannen 3a39b7fe82 Support scoped @ControllerAdvice beans again
Spring Framework 5.2 introduced support for implementing the Ordered
interface in a @ControllerAdvice bean. This support requires that
@ControllerAdvice beans be eagerly resolved from the BeanFactory in
order to invoke the getOrder() method defined in the Ordered interface.
Unfortunately doing so resulted in a regression in that an attempt to
eagerly resolve a scoped @ControllerAdvice bean throws a
BeanCreationException due to the lack of an active scope (e.g., request
or session scope).

This commit fixes this regression by avoiding eager resolution of scoped
@ControllerAdvice beans. As a direct consequence, the Ordered interface
is not supported for scoped @ControllerAdvice beans.

Closes gh-23985
2019-11-18 22:29:00 +01:00
Sam Brannen f0b2f7186a Polishing 2019-11-18 22:29:00 +01:00
Rossen Stoyanchev 842b424acd Use method signature to refine RSocket @MessageMapping
Before this change an @MessageMapping could be matched to any RSocket
interaction type, which is arguably too flexible, makes it difficult to
reason what would happen in case of a significant mismatch of
cardinality, e.g. request for Fire-And-Forget (1-to-0) mapped to a
method that returns Flux, and could result in payloads being ignored,
or not seen unintentionally.

This commit checks @ConnectMapping method on startup and rejects them
if they return any values (sync or async). It also refines each
@MessageMapping to match only the RSocket interaction type it fits
based on the input and output cardinality of the handler method.
Subsequently if a request is not matched, we'll do a second search to
identify partial matches (by route only) and raise a helpful error that
explains which interaction type is actually supported.

The reference docs has been updated to explain the options.

Closes gh-23999
2019-11-18 17:27:41 +00:00
Sam Brannen 769a15cb82 Polishing 2019-11-18 13:01:26 +01:00
denisgalaybo 9526e39f88 Fix errors in reference manual
Closes gh-24008
2019-11-17 13:50:50 +01:00
Sam Brannen d397baa559 Polish Javadoc for AutowiredAnnotationBeanPostProcessor 2019-11-15 12:43:55 +01:00
Juergen Hoeller 1607f1db0b Fix Checkstyle nohttp violation 2019-11-15 10:50:28 +01:00
Juergen Hoeller a43ae63f17 Upgrade to SLF4J 1.7.29, Jackson 2.10.1, WebJars Locator 0.43 2019-11-15 10:21:58 +01:00
Rossen Stoyanchev 9ec67bac82 Merge pull request #1885
Closes gh-1885
2019-11-14 17:38:15 +00:00
Rossen Stoyanchev c33cb26a73 Polishing contribution
See gh-1885
2019-11-14 17:38:01 +00:00
Mark Hobson 46fe74d2f9 Preserve media type parameters when setting charset
Issue: SPR-17040
2019-11-14 17:38:01 +00:00
Rossen Stoyanchev 905e3c1f9f Avoid indefinite wait in JettyWebSocketClient
Closes gh-23994
2019-11-14 17:37:10 +00:00
Juergen Hoeller 830f81210f Revise getElementTypeDescriptor javadoc (no IllegalStateException)
Closes gh-23996
2019-11-14 18:31:32 +01:00
Sam Brannen d38b07b450 Move JavaUtilLoggingConfigurer to web.reactive.fixtures package 2019-11-14 15:50:04 +01:00
Sébastien Deleuze 029e61f54a Refine MethodParameter#isOptional Kotlin implementation
This commit adds support for Continuation parameter that is now
considered as an optional parameter since it is never provided by
the user.

It also simplifies and optimizes the implementation.

Closes gh-23991
2019-11-14 15:28:06 +01:00
Sam Brannen 7991066345 Fix classpath 2019-11-14 15:25:26 +01:00
Sam Brannen 89b3a9cef2 Introduce JavaUtilLoggingConfigurer to configure JUL for tests 2019-11-14 14:30:21 +01:00
Stephane Nicoll 1b7ef7fce5 Merge pull request #23995 from izeye
* pr/23995:
  Polish CorsAbstractHandlerMappingTests

Closes gh-23995
2019-11-14 14:13:23 +01:00
Johnny Lim 56670ebec8 Polish CorsAbstractHandlerMappingTests
See gh-23995
2019-11-14 14:13:05 +01:00
Sam Brannen 8df3afd0b6 Polish contribution
See gh-23895
2019-11-14 13:26:38 +01:00
SchutzeHades 834ebc44f8 Fix inappropriate eager init. 2019-11-14 10:13:55 +01:00
Sam Brannen 8186b77b58 Polish contribution
See gh-23895
2019-11-14 09:59:42 +01:00
monosoul a0e4ac39bf Inverse condition to fix ISO-formatted Instant parsing
Prior to this commit, InstantFormatter was able to properly serialize
an Instant that is far in the future (or in the past), but it could not
properly deserialize it, because in such scenarios an ISO-formatted
Instant starts with a +/- sign.

This commit fixes this issue, while maintaining the previous contract,
and also introduces tests for InstantFormatter.

Closes gh-23895
2019-11-14 09:59:42 +01:00
Juergen Hoeller 3dc5e7b1d5 Avoid String concatenation for lookup in StaticMessageSource
Closes gh-22451
2019-11-13 23:41:26 +01:00
Sébastien Deleuze 6fa9871a70 Provide orNull extensions for WebFlux ServerRequest
Closes gh-23761
2019-11-13 17:59:51 +01:00
Juergen Hoeller 22211a01ce Polishing 2019-11-13 17:23:23 +01:00
Juergen Hoeller 32532a88c1 Polishing 2019-11-13 16:17:08 +01:00
Juergen Hoeller 55011e7a0f Note on injecting results from local @Bean methods (self references)
Closes gh-23934
2019-11-13 16:17:01 +01:00
Rossen Stoyanchev 2c1afca9c5 Reject null form data names
...or skip if there are no values either.

Closes gh-22372
2019-11-13 15:03:22 +00:00
Rossen Stoyanchev f2b9264674 Remove Jetbrains annotations 2019-11-13 14:42:32 +00:00
Rossen Stoyanchev e6a65804f5 Merge pull request #1956
Closes gh-1956
2019-11-13 14:24:23 +00:00
Rossen Stoyanchev 04aa3d05da Refactor solution for respones error details
See gh-1956
2019-11-13 14:24:12 +00:00
jerzykrlk 91ec274b10 SPR-17130 http error details in the exception message 2019-11-13 14:24:12 +00:00
JohnGrib 8bb165e55c Fix typo in EventSourceTransportHandler
Closes gh-23984

* 3a0f309e2c/spring-web/src/main/java/org/springframework/http/codec/ServerSentEvent.java (L24)
* 3a0f309e2c/spring-web/src/main/java/org/springframework/http/codec/ClientCodecConfigurer.java (L88)
* ef14d76d36/spring-web/src/main/java/org/springframework/http/codec/ServerCodecConfigurer.java (L94)
* 3a0f309e2c/spring-websocket/src/main/java/org/springframework/web/socket/sockjs/transport/handler/EventSourceTransportHandler.java (L33)
2019-11-13 14:23:58 +00:00
YuDongYing 4e5ae54417 Fix schemaZip Gradle task on MS Windows
Prior to this commit, the schemaZip Gradle task failed to find Spring
schema files on MS Windows due to path separators hard coded to forward
slashes that are not compatible with the Windows operating system.

Consequently, a full build failed on Windows since the distZip task was
not able to locate the zipped schema archive that the schemaZip task
failed to create.

This commit fixes this by updating the schemaZip task to search for
schema files using backslashes as well as forward slashes.

Closes gh-23933
2019-11-13 14:49:25 +01:00
Sébastien Deleuze 7646895fd4 Support Kotlin synthetic classes in MethodParameter and SpEL
Closes gh-23812
2019-11-13 14:22:53 +01:00
stsypanov f2b3953d76 Use array.clone() instead of manual array creation 2019-11-13 13:53:42 +01:00
Juergen Hoeller f61d728db9 Fallback Locale other than the system Locale through setDefaultLocale
Closes gh-23977
2019-11-13 13:48:08 +01:00
Rossen Stoyanchev f4c847b723 MockHttpServletRequestBuilder sets content-length
Closes gh-23978
2019-11-12 17:33:14 +00:00
GungnirLaevatain 4bbf2d5785 polish 2019-11-12 17:40:28 +01:00
Rossen Stoyanchev a0cdbf5153 Merge pull request #23980
Closes gh-23980
2019-11-12 16:14:46 +00:00
Rossen Stoyanchev 16c7a40c53 Minor refactoring
See gh-23296
2019-11-12 16:14:02 +00:00
Johannes Teklote 879b2df052 queryParam options for MockMVC requeusts
See gh-23296
2019-11-12 16:13:51 +00:00
Sam Brannen a26d37b407 Polishing 2019-11-12 14:01:13 +01:00
Sam Brannen a276c667d1 Polishing 2019-11-12 13:48:48 +01:00
Juergen Hoeller 9cc06454aa Restore findAnnotation superclass traversal for java.lang annotations
Closes gh-23929
2019-11-12 11:51:44 +01:00
Rossen Stoyanchev fac9ca891a Fix copy-and-paste error in docs 2019-11-11 17:31:51 +00:00
Juergen Hoeller c4ec6aea68 Fix Checkstyle violations
See gh-23784
2019-11-11 17:18:52 +01:00
Arjen Poutsma a7a88371e7 Allow for decode method to return null in AbstractJackson2Decoder
Prior to this commit, the decoder did not allow for a null value
returned from the Jackson object reader.

Closes: gh-23935
2019-11-11 16:48:30 +01:00