Commit Graph

17547 Commits

Author SHA1 Message Date
Arjen Poutsma
fedbb09ad9 Improve RouterFunctions reference documentation
Changed WebFlux.fn docs to use router function builder.

Issue: SPR-17016
2018-11-23 17:48:11 +01:00
Sam Brannen
81fde5ec41 Ensure that MethodParameter.findParameterIndex() is thread-safe
Prior to this commit, parallel invocations of
MethodParameter.findParameterIndex() (invoked indirectly via
SynthesizingMethodParameter.forParameter() and
MethodParameter.forParameter()) could intermittently lead to an
IllegalArgumentException being thrown due to a race condition in the
internal implementation of the JDK's
java.lang.reflect.Executable.getParameters() method.

This commit addresses this issue by introducing a fallback for-loop
that iterates over the candidate parameters a second time using
equality checks instead of identity checks.

Issue: SPR-17534
2018-11-23 17:37:20 +01:00
Sam Brannen
aa7f69a5d1 Ensure that parameter resolution in SpringExtension is thread-safe
Prior to this commit, parallel execution of @BeforeEach and @AfterEach
methods that accepted @Autowired arguments would fail intermittently
due to a race condition in the internal implementation of the JDK's
java.lang.reflect.Executable.getParameters() method.

This commit addresses this issue by creating instances of
SynthesizingMethodParameter via
SynthesizingMethodParameter.forExecutable(Executable, int) instead of
SynthesizingMethodParameter.forParameter(Parameter), since the latter
looks up the parameter index by iterating over the array returned by
Executable.getParameters() (which is not thread-safe).

Issue: SPR-17533
2018-11-23 16:35:19 +01:00
Sebastien Deleuze
91de8d265e Fix ProtobufDecoder handling of split message size
This commit introduces a new readMessageSize(DataBuffer input) private
method, inspired from CodedInputStream#readRawVarint32(int, InputStream)
and adapted for DataBuffer using MessageDecoderFunction fields in
order to support use cases where the message size is split between
distinct chunks.

It also fixes handling of end of streams by using
DataBuffer#readableByteCount instead of -1 which is only relevant with
InputStream.

Issue: SPR-17429
2018-11-23 14:22:58 +01:00
Juergen Hoeller
77ab88b144 Polishing 2018-11-23 13:56:02 +01:00
Juergen Hoeller
738097def2 DefaultResponseErrorHandler detects non-standard error code as well
Issue: SPR-17439
2018-11-23 13:55:50 +01:00
Juergen Hoeller
b90553db5c Upgrade to Reactor Californium SR3 2018-11-22 22:03:56 +01:00
Juergen Hoeller
56234fe877 Polishing 2018-11-22 22:03:36 +01:00
Juergen Hoeller
c16f36b537 Upgrade to Mockito 2.23.4, Selenium 3.141.59, JSON-P 1.1.4 2018-11-22 18:24:18 +01:00
Juergen Hoeller
ae8f680d2e Polishing 2018-11-22 18:21:56 +01:00
Juergen Hoeller
bf272b0b21 Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection
Issue: SPR-15540
2018-11-22 16:12:38 +01:00
Juergen Hoeller
b1b28d4641 ToStringVisitor consistently returns platform-independent line breaks
Issue: SPR-17322
2018-11-22 16:11:59 +01:00
Johnny Lim
17b2b8af86 Remove an unnecessary local variable 2018-11-22 13:56:22 +01:00
Juergen Hoeller
262c702da4 CachingMetadataReaderFactory releases shared cache Map on clearCache()
LocalResourceCache properly initializes cacheLimit on construction.

Issue: SPR-17527
2018-11-22 11:20:47 +01:00
Rossen Stoyanchev
548126ddd8 Consistently pass param info to ServerWebInputException
Issue: SPR-17232
2018-11-21 14:41:42 -05:00
Rossen Stoyanchev
7e9857a663 ForwardedHeaderTransformer handles encoding correctly
Issue: SPR-17525
2018-11-21 10:54:39 -05:00
Rossen Stoyanchev
0134c9d608 Update @since version after backport 2018-11-21 09:35:33 -05:00
Brian Clozel
5fe628a811 Polish 2018-11-21 10:27:49 +01:00
Rossen Stoyanchev
759013eb17 Consistent isEmpty check in WebTestClient
Issue: SPR-17522
2018-11-20 23:02:53 -05:00
Rossen Stoyanchev
a55ca56e34 BEST_MATCHING_HANDLER_ATTRIBUTE for spring-webmvc
Issue: SPR-17518
2018-11-20 22:31:02 -05:00
Rossen Stoyanchev
d6a5c3428b Improve docs on STOMP / WebSocket frame max size
Issue: SPR-17514
2018-11-20 21:59:47 -05:00
Rossen Stoyanchev
24848ec1bc Configurable TcpClient for ReactorNettyTcpClient
Issue: SPR-17523
2018-11-20 21:20:21 -05:00
Juergen Hoeller
fef0e21d8b Remove unused LinkedList import 2018-11-20 22:16:51 +01:00
Juergen Hoeller
8c7579eba8 Polishing 2018-11-20 22:06:44 +01:00
Juergen Hoeller
a3d763d137 Consistent parameter resolution for batch updates (IN clauses etc)
Includes deprecation of (NamedParameter)BatchUpdateUtils in favor of inlined code in (NamedParameter)JdbcTemplate itself.

Issue: SPR-17402
2018-11-20 22:05:53 +01:00
Juergen Hoeller
2a5d7690b6 CglibAopProxy skips method proxy for equals/hashCode/toString override
Issue: SPR-17500
2018-11-20 22:04:28 +01:00
Juergen Hoeller
f5aeb81473 SerializedBeanFactoryReference falls back to dummy with specific id
Issue: SPR-17508
2018-11-20 22:02:10 +01:00
stsypanov
02d3cfa42d Use ArrayList instead of LinkedList 2018-11-20 21:54:51 +01:00
Vojtech Janota
12f168290d SPR-17492: FastByteArrayOutputStream.read byte-to-int conversion 2018-11-20 17:08:01 +01:00
Arjen Poutsma
88cb126511 Add RequestPredicate Visitor to WebFlux.fn
This commit introduces RequestPredicates.Visitor, an implementation of
the visitor pattern for RequestPredicates.

Issue: SPR-17322
2018-11-20 14:05:17 +01:00
Arjen Poutsma
f3c29fe2e6 Add test for UriUtils.encode(String, Charset)
Issue: SPR-17451
2018-11-20 10:51:19 +01:00
Rossen Stoyanchev
abf9ce8a34 Improve handling of empty response with Mono<T>
Issue: SPR-17560
2018-11-19 16:48:38 -05:00
Arjen Poutsma
63275ae2b7 Add Test for LeakAwareDataBufferFactory 2018-11-19 16:56:25 +01:00
Brian Clozel
3203d39821 Remove Content-Length response header from errors
Prior to this commit, when errors happened before the response was
committed, the `Content-Length` response header would be left as is.
This can be problematic since the error can be handled later in the
chain and the response body changed accordingly. For example, Spring
Boot renders error pages in those cases. If the `Content-Length` is set,
HTTP clients can get confused and only consider part of the error
response body.

This commit ensures that any `Content-Length` response header is removed
in case of errors, if the response is not already committed.

This is done at the `AbstractServerHttpResponse` level, since errors can
be handled in multiple places and the response itself is the safest
place to handle this case.

As a consequence, this commit also removes `Content-Length` checks in
`EncoderHttpMessageWriter` since we now consider that we should rely on
the response body we're about to write rather than any previously set
value.

Issue: SPR-17502
2018-11-19 15:49:54 +01:00
Juergen Hoeller
ce5c65c0b0 Upgrade to JAXB 2.3.1, Groovy 2.5.4, Jetty 9.4.14, Tomcat 9.0.13
Includes JAX-WS 2.3.1, Awaitility 3.1.3, OkHttp 3.12, Woodstox 5.2.
2018-11-19 12:41:26 +01:00
Stephane Nicoll
afa38f5f97 Merge pull request #2019 from Hanope
* pr/2019:
  Polish contribution
  Fix typos
2018-11-19 08:50:49 +01:00
Stephane Nicoll
7b6f2f8fb3 Polish contribution
Closes gh-2019
2018-11-19 08:45:33 +01:00
Hanope
bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
HeemangHan
729ce4108d Correct typos (#2018) 2018-11-17 16:31:01 +01:00
Rossen Stoyanchev
1a37345e84 Fix checkstyle violation and polish 2018-11-16 19:42:42 -05:00
Rossen Stoyanchev
c89e6c616a Improve logging of request mapping information
Issue: SPR-17450
2018-11-16 17:30:18 -05:00
Arjen Poutsma
539cfc24c6 Refactor AbstractEncoderTestCase
Refactor AbstractEncoderTestCase to resemble AbstractDecoderTestCase

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Arjen Poutsma
39ce989d1a Add and use AbstractDecoderTestCase
Introduce new base test case for decoder tests, and use it.

Issue: SPR-17449
2018-11-16 14:33:26 +01:00
Brian Clozel
0f2d9df79f Upgrade to Reactor Californium SNAPSHOTs 2018-11-16 11:13:17 +01:00
Jay Bryant
b9603680bc Fixing typoes
Jim Showalter found two typoes in the web section. This PR fixes them. Thanks, Jim.
2018-11-14 16:10:17 -05:00
Rossen Stoyanchev
7bbd4c681f Merge pull request #2010 from dimitrisli/SPR-17459 2018-11-13 23:05:07 -05:00
Rossen Stoyanchev
ba3fef3e8a Refactor media types parsing improvements
Issue: SPR-17459
2018-11-13 23:02:09 -05:00
Dimitrios Liapis
f4b05dc2e7 MediaType parsing supports comma inside quotes
Issue: SPR-17459
2018-11-13 16:59:57 -05:00
Rossen Stoyanchev
46a5fb7a91 Configurable Marshaller/Unmarshaller in JAXB2 codecs
Issue: SPR-17388
2018-11-13 16:56:56 -05:00
Juergen Hoeller
093254b2b3 Jackson2ObjectMapperBuilder stores visibility declarations in order
Issue: SPR-17489
2018-11-13 21:17:55 +01:00