Commit Graph

2763 Commits

Author SHA1 Message Date
Sam Brannen
4e7d8a8873 Introduce addSupportedMediaType() in FormHttpMessageConverter
Closes gh-23203
2019-06-27 16:05:38 +03:00
Sam Brannen
8e1cb9a059 Improve diagnostics for all server failures in RestTemplateIntegrationTests 2019-06-27 14:16:19 +03:00
Sam Brannen
d522e9835f Polish AbstractMockWebServerTestCase 2019-06-27 13:45:32 +03:00
Sam Brannen
0b6239cecc Improve diagnostics for failures in RestTemplateIntegrationTests 2019-06-26 15:16:54 +03:00
Sam Brannen
7d6be2e26e Polishing 2019-06-26 15:12:32 +03:00
Sam Brannen
0f1d16bb05 Fix Checkstyle violation 2019-06-24 17:54:04 +03:00
Sam Brannen
d0231cb29a Presort beans in ControllerAdviceBean.findAnnotatedBeans()
Prior to this commit, all clients of
ControllerAdviceBean.findAnnotatedBeans() sorted the returned list
manually. In addition, clients within the core Spring Framework
unnecessarily used AnnotationAwareOrderComparator instead of
OrderComparator to sort the list.

This commit presorts the ControllerAdviceBean list using OrderComparator
directly within ControllerAdviceBean.findAnnotatedBeans().

Closes gh-23188
2019-06-24 16:26:11 +03:00
Sam Brannen
d5a2bdee8d Improve Javadoc for @ControllerAdvice regarding ordering
Closes gh-23163
2019-06-24 14:36:04 +03:00
Sam Brannen
9239ab1891 Support Ordered interface for @ControllerAdvice beans
Closes gh-23163
2019-06-23 19:31:35 +03:00
Sam Brannen
978adbdae7 Avoid duplicate lookups of @ControllerAdvice annotations
See gh-23163
2019-06-23 18:31:04 +03:00
Sam Brannen
7576d0d40c Polishing
See gh-23163
2019-06-22 19:06:58 +03:00
Sam Brannen
4568edf6c4 Simplify ControllerAdviceBean constructors
See gh-23163
2019-06-22 19:02:49 +03:00
Sam Brannen
8f30639a0a Test status quo for Ordered support for @ControllerAdvice beans
See gh-23163
2019-06-22 18:18:57 +03:00
Sam Brannen
21267e56b7 Cache resolved bean instance in ControllerAdviceBean
Prior to this commit, the resolveBean() method in ControllerAdviceBean
looked up the @ControllerAdvice bean instance in the ApplicationContext
by name for every web request that involved lookups for global methods
annotated with @ExceptionHandler, @InitBinder, and @ModelAttribute.

This commit avoids the need for such repeated lookups in the
ApplicationContext by caching the resolved @ControllerAdvice bean
instance within ControllerAdviceBean once it has been resolved.
2019-06-21 18:27:33 +03:00
Sam Brannen
59901592d2 Introduce regression tests for ControllerAdviceBean
This commit introduces unit tests for the status quo in
ControllerAdviceBeanTests to serve as regression tests for future
changes to ControllerAdviceBean.
2019-06-21 17:21:50 +03:00
Sam Brannen
52f1a3aef9 Polish ControllerAdviceBean 2019-06-21 17:11:12 +03:00
Rossen Stoyanchev
030caea9cf Merge branch '5.1.x' 2019-06-21 14:15:26 +01:00
Rossen Stoyanchev
594c5806a6 Handle error in apply of writeFunction
Closes gh-23175
2019-06-21 14:15:14 +01:00
Sam Brannen
0e5a38591f Cache beanType in ControllerAdviceBean 2019-06-21 14:09:05 +03:00
Sam Brannen
2759b4b909 Avoid use of Stream API in ControllerAdviceBean 2019-06-21 13:49:49 +03:00
Sam Brannen
d5554d5d8d Polish @ControllerAdvice and @RestControllerAdvice 2019-06-21 13:26:30 +03:00
Sam Brannen
ad915f4a26 Document that Ordered is not supported for @ControllerAdvice beans
Closes gh-23172
2019-06-21 12:39:34 +03:00
Arjen Poutsma
11c7907a59 Add Flux<Part> ServerWebExchange.getParts()
This commit introduces ServerWebExchange.getParts(), as an alternative,
streaming way of accessing multipart data.
2019-06-21 10:59:12 +02:00
Brian Clozel
cc05608ae9 PathPattern does not use custom separator
Prior to this commit, `PathPattern::extractPathWithinMapping`
would always use the default path pattern separator `/` when extracting
the path within the pattern of a matched route.

This commit ensures that `PathPattern` uses the configured separator
when extracting the path within the matched mapping.

Fixes gh-23168
2019-06-20 20:27:22 +02:00
Brian Clozel
5787fc16fb PathPatternRouteMatcher should use custom separator
Prior to this commit, the `PathPatternRouteMatcher` would always use the
default path pattern separator when parsing incoming route strings to
`RouteMatcher.Route` instances.
When the `PathPatternRouteMatcher` is configured with a
`PathPatternParser` that has a custom separator (e.g., `.`), then the
matching algorithm can't match routes against parsed patterns.

This commit ensures that the route matcher uses the configured separator
at all times.

Fixes gh-23167
2019-06-20 20:23:04 +02:00
Sam Brannen
f56c54dfc8 Polishing 2019-06-20 18:09:22 +03:00
Sam Brannen
d2e6d0269b Preliminary tests for multipart/related & multipart/mixed in RestTemplate
See gh-23159
2019-06-20 11:35:18 +03:00
Sebastien Deleuze
341385acfc Merge branch '5.1.x' 2019-06-19 13:59:59 +02:00
Sebastien Deleuze
bcad276adb Fix Jackson documentation broken links
Closes gh-23153
2019-06-19 13:59:36 +02:00
Sam Brannen
4000b244ff Forbid null converters in RestTemplate & HttpMessageConverterExtractor
Prior to this commit, RestTemplate and HttpMessageConverterExtractor did
not validate that the supplied HttpMessageConverter list contained no
null elements, which can lead to a NullPointerException when the
converters are accessed.

This commit improves the user experience by failing immediately if the
supplied HttpMessageConverter list contains a null element. This applies
to constructors for RestTemplate and HttpMessageConverterExtractor as
well as to RestTemplate#setMessageConverters().

Note, however, that RestTemplate#getMessageConverters() returns a mutable
list. Thus, if a user modifies that list so that it contains null values,
that will still lead to a NullPointerException when the converters are
accessed.

This commit also introduces noNullElements() variants for collections in
org.springframework.util.Assert.

Closes gh-23151
2019-06-18 16:13:20 +03:00
Sam Brannen
da903904c9 Fix Javadoc reference to MediaType#APPLICATION_CBOR_VALUE
{@value ...} cannot be used outside of the current type.
2019-06-18 13:00:00 +03:00
Sam Brannen
aa0a8d66a8 Polishing 2019-06-18 10:19:03 +03:00
Johnny Lim
7f67cecd10 Polish MappingMediaTypeFileExtensionResolver.addFileExtension()
Closes gh-23145
2019-06-18 10:10:30 +03:00
Arjen Poutsma
30af01fd4e Use DataBufferUtils.write in DefaultFilePart.transferTo
This commit makes sure that in DefaultMultipartMessageReader's
DefaultFilePart, the file is not closed before all bytes are written,
by using DataBufferUtils.write (see c1b6885191d6a50347aeaa14da994f0db88f26fe).

The commit also improves on the logging of the
DefaultMultipartMessageReader.

Closes gh-23130
2019-06-14 14:13:18 +02:00
Sam Brannen
99d10a671c Merge branch '5.1.x' 2019-06-14 14:51:08 +03:00
Sam Brannen
d18d4d865e Update Javadoc for HtmlUtils regarding Apache Commons Text
Closes gh-23122
2019-06-14 14:48:24 +03:00
Johnny Lim
293506013d Add since declarations for JettyClientHttpConnector constructor change
Closes gh-23128
2019-06-14 14:31:37 +03:00
Rossen Stoyanchev
14e2c6803e Support for RSocket composite metadata
Closes gh-22798
2019-06-12 17:11:30 -04:00
Juergen Hoeller
0a77477d32 Merge branch '5.1.x' 2019-06-12 18:16:30 +02:00
Juergen Hoeller
fc46abf0b7 Polishing 2019-06-12 18:04:06 +02:00
Juergen Hoeller
42c0d8ec7f Merge branch '5.1.x' 2019-06-12 14:14:40 +02:00
Juergen Hoeller
627d37f73b Thread-safe removal of destruction callbacks in web scopes
Closes gh-23117
2019-06-12 14:11:13 +02:00
Juergen Hoeller
bd76a160bb Merge branch '5.1.x' 2019-06-12 00:58:51 +02:00
Juergen Hoeller
4877736794 Polishing 2019-06-12 00:58:04 +02:00
Juergen Hoeller
a89bfffd8c Merge branch '5.1.x' 2019-06-11 23:16:03 +02:00
Juergen Hoeller
7dc92aa05d Polishing 2019-06-11 20:57:27 +02:00
Juergen Hoeller
1956cb1e57 Defensive concurrent access to shared file extension data structures
Closes gh-23064
2019-06-11 20:57:17 +02:00
Rossen Stoyanchev
1f05bd4ef3 Merge branch '5.1.x' 2019-06-07 16:08:29 -04:00
Rossen Stoyanchev
9f8148419f Separate "filtered" attribute for ERROR dispatch
Closes gh-22989
2019-06-07 16:07:56 -04:00
Sam Brannen
61bf45c86f Merge branch '5.1.x' 2019-06-06 17:40:51 +03:00