Commit Graph

2192 Commits

Author SHA1 Message Date
Juergen Hoeller
18f2e6a12d AnnotationConfigRegistry exposes registerBean with supplier/qualifiers
Closes gh-22457
2019-03-05 18:26:04 +01:00
www
ef91313342 Use String::isEmpty instead of "".equals(arg) when arg is not null 2019-03-05 14:32:56 +01:00
Juergen Hoeller
b2b0df893a Merge branch '5.1.x' 2019-03-05 14:20:02 +01:00
Juergen Hoeller
d034c053b3 Jackson2Tokenizer passes DeserializationContext into all TokenBuffers
See gh-22510
2019-03-05 13:47:26 +01:00
Juergen Hoeller
013c0bca92 Polishing 2019-03-05 13:08:11 +01:00
Juergen Hoeller
f6693e790a Jackson2Tokenizer passes DeserializationContext into TokenBuffer
Closes gh-22510
2019-03-05 13:08:04 +01:00
Sam Brannen
a9f251db42 Fix broken Javadoc links 2019-03-03 17:18:18 +01:00
Sam Brannen
abda6a6c66 Polishing 2019-03-02 16:17:58 +01:00
Sam Brannen
02be21d0dc Polishing 2019-03-02 14:22:28 +01:00
Johnny Lim
e21d94f91b Polish
Closes gh-22472
2019-02-26 08:57:03 +01:00
Juergen Hoeller
bc0317af3b Merge branch '5.1.x' 2019-02-25 17:57:49 +01:00
Juergen Hoeller
9eb7f7e294 Polishing 2019-02-25 17:36:37 +01:00
Johnny Lim
625e210676 Polish 2019-02-25 12:17:53 +01:00
Sebastien Deleuze
dc8fb8bc5e Use StringJoiner where possible to simplify String joining 2019-02-25 12:11:57 +01:00
Brian Clozel
afbe7b31bb Polish
See gh-22341
2019-02-11 10:46:27 +01:00
Brian Clozel
fb4a28f904 Polish
See gh-22340
2019-02-11 10:45:50 +01:00
Brian Clozel
1bf3b36ce8 Polish
See gh-22340
2019-02-05 15:06:33 +01:00
Brian Clozel
ba8849dda3 Avoid MimeType garbage creation
Prior to this commit, calls to `MimeType` and `MediaType` would create a
significant amount of garbage:

* during startup time, in the static sections of `MimeType` and
`MediaType` when creating well-known types
* at runtime, when parsing media types for content negotiation or
writing known media types as strings in HTTP response headers

This commit does the following:

* Avoid parsing the well-known types and use regular constructors
instead
* Cache types in a simple LRU cache once they've been parsed, since an
application is likely to deal with a limited set of types
* Avoid using `java.util.stream.Stream` in hot code paths

Benchmarks show that a complete revision of the `MimeTypeUtils` parser
is not required, since the LRU cache is enough there.

Closes gh-22340
2019-02-05 14:33:43 +01:00
Rossen Stoyanchev
b8f7c37cc4 Merge branch '5.1.x' 2019-01-25 17:01:51 -05:00
Rossen Stoyanchev
4560dc2818 Improve empty body check
Fixes gh-22265
2019-01-25 15:48:04 -05:00
Juergen Hoeller
05f1ea8515 Merge branch '5.1.x' 2019-01-25 15:46:01 +01:00
Juergen Hoeller
85ec9b9df2 Avoid Class.getPackage() in favor of plain Class.getName() checks
Fixes #22306
2019-01-25 15:35:49 +01:00
Juergen Hoeller
160ecdf956 Merge branch '5.1.x' 2019-01-24 15:35:28 +01:00
Juergen Hoeller
7cc700435b HandlerMethod skips interface parameter introspection for return value
Fixes #22303
2019-01-24 15:18:55 +01:00
Arjen Poutsma
a5cef3845c Improve message for HttpStatusCodeException with empty status text
This commit improves the message for HttpStatusCodeException so that it
defaults to the HttpStatus reason phrase if a status text is not
provided.

This commit also fixes SimpleClientHttpResponse so that it does not
return null for getStatusText().

Fixed #22162
2019-01-23 11:44:00 +01:00
Rossen Stoyanchev
e373b46660 Jackson2JsonDecoder tolerates null literal
Fixes #22042
2019-01-18 18:27:40 -05:00
Rossen Stoyanchev
5dcde9e7d7 Trim decoded SSE data
Fixes #22043
2019-01-18 18:13:58 -05:00
Rossen Stoyanchev
a77eee899a Document synchronous use of the WebClient
Fixes #22173
2019-01-18 17:46:16 -05:00
Juergen Hoeller
72dddfbc7b Polishing 2019-01-09 12:26:58 +01:00
Rossen Stoyanchev
dc3f953f4b Correction for commit #b219c6c
Issue: SPR-17630
2019-01-08 22:43:42 -05:00
Juergen Hoeller
a82f049083 FormHttpMessageConverter officially supports non-String form values
Issue: SPR-17645
2019-01-08 17:11:07 +01:00
Rossen Stoyanchev
b219c6ce15 Adjust UriComponentsBuilder#toUriString behavior
Commit #93b7a4 added support for pre-configuring URI variables at the
UriComponentsBuilder level, and also changed toUriString to encode
template and URI variables separately. However this went a bit too far
causing side effects for URLs with curly braces that don't represent
URI variables.

This commit restores the original toUriString behavior which is to
encode template and URI variables sepraately only if URI variables have
been pre-configured.

Issue: SPR-17630
2019-01-08 11:06:33 -05:00
王诗峣
b94e8c4bef Fix ClassCastException in FormHttpMessageConverter
We should not cast MultiValueMap<String, ?> to MultiValueMap<String, String>
2019-01-08 12:19:51 +01:00
Juergen Hoeller
6e3f974951 HttpHeaders.writableHttpHeaders properly handles HttpHeaders.EMPTY
Issue: SPR-17633
2019-01-08 00:32:27 +01:00
Juergen Hoeller
1faeeaea14 HandlerMethodParameter defensively handles interface annotation arrays
Issue: SPR-17629
2019-01-08 00:32:09 +01:00
Rossen Stoyanchev
673a20cb10 Defensive initialization of AsyncXMLInputFactory
Aalto's InputFactoryImpl already disables loading of external entities
by default (property "javax.xml.stream.isSupportingExternalEntities").
This commit goes further by applying the same defensive measures as we
do elsewhere for XMLInputFactory, which disables DTD completely.
Arguably there is no good reason to enable that by default in WebFlux.
2019-01-07 13:52:46 -05:00
Rossen Stoyanchev
63984800e4 Lenient URI template encoding
URI template encoding ignores mismatched curly braces, treating them as
literal parts instead.

Issue: SPR-17630
2019-01-02 16:36:08 -05:00
Rossen Stoyanchev
4b24bcb799 More accurate checks for presence of MediaType.ALL
Typically a straight up equals as well as Collections#contains
checks for MediaType.ALL is susceptible to the presence of
media type parameters.

This commits adds equalsTypeAndSubtype as well as an
isPresentIn(Collection<MimeType>) methods to MimeType to faciliate
with checks for MediaType.ALL.

Issue: SPR-17550
2019-01-02 14:32:50 -05:00
Brian Clozel
6361b0cb23 Write CharSequence instances to DataBuffers
Prior to this commit, one could write a `CharSequence` to an existing
`DataBuffer` instance by turning it into a byte array or `ByteBuffer`
first. This had the following disadvantages:

1. Memory allocation was not efficient (not leveraging pooled memory
when available)
2. Dealing with `CharsetEncoder` is not always easy
3. `DataBuffer` implementations, like `NettyDataBuffer` can use
optimized implementations in some cases

This commit adds a new `DataBuffer#write(CharSequence, Charset)` method
for those cases and also an `ensureCapacity` method useful for checking
that the current buffer has enough capacity to write to it..

Issue: SPR-17558
2018-12-20 21:33:33 +01:00
Arjen Poutsma
5e4a8966ee Make TomcatHttpHandlerAdapter aware of request/response wrappers
This commit makes TomcatServerHttpRequest aware of
HttpServletRequestWrappers, and TomcatServerHttpResponse aware of
HttpServletResponseWrappers.

Issue: SPR-17611
2018-12-19 12:16:14 +01:00
Violeta Georgieva
09da10cc6c Propagate the cancel signal to the downstream
Issue: SPR-17609
2018-12-18 15:04:08 -05:00
Juergen Hoeller
0e8ed5931d Revised backport version 5.0.11
Issue: SPR-17410
Issue: SPR-17433
2018-12-17 18:19:21 +01:00
Juergen Hoeller
a240cfcf2f Consistent support for if-(un)modified-since as ZonedDateTime/Instant
Includes DefaultRequestBodyUriSpec pre-resolving URI for HttpRequest.

Issue: SPR-17571
2018-12-17 16:21:39 +01:00
Rossen Stoyanchev
05d616240a StringHttpMessageConverter defaults to UTF-8 for JSON
Issue: SPR-17568
2018-12-12 11:40:33 -05:00
Rossen Stoyanchev
8eef97da33 HTTP header adapters print header values
Issue: SPR-17546
2018-12-12 11:40:33 -05:00
Juergen Hoeller
7b7a8196f5 Revised HttpHeaders javadoc 2018-12-12 13:20:58 +01:00
Juergen Hoeller
6eb0a60df9 Polishing 2018-12-12 11:16:53 +01:00
Juergen Hoeller
5bbbc82e19 Consistent handling of null header values in HttpHeaders
Issue: SPR-17588
2018-12-12 11:16:45 +01:00
wonwoo
9a13d93a6b Fix typo in javadoc
Closes gh-2049
2018-12-12 08:00:15 +01:00
Juergen Hoeller
6a012147c4 Consistent support for last-modified argument as Instant/ZonedDateTime
Issue: SPR-17571
2018-12-06 15:53:47 +01:00