Commit Graph

18087 Commits

Author SHA1 Message Date
Rossen Stoyanchev
dd22b8fd39 Fix race condition with onCompletion/onError
Closes gh-23096
2019-08-27 21:43:33 +03:00
Sam Brannen
8189c90741 Allow Set-Cookie header to be overwritten in MockHttpServletResponse
Prior to this commit, there was no way to replace the Set-Cookie header
via MockHttpServletResponse. Specifically, an invocation of setHeader()
for the Set-Cookie header resulted in an additional Set-Cookie header
instead of replacing the existing one, which is in violation of the
contract for javax.servlet.http.HttpServletResponse.setHeader(...).

This commit refactors the internals of MockHttpServletResponse to ensure
that an existing Set-Cookie header is overwritten when set via an
invocation of setHeader(). This commit also verifies the expected
behavior for addHeader() and addCookie() with regard to multiple cookies.

Closes gh-23512
2019-08-27 17:20:38 +02:00
Sam Brannen
9d2a874e3f Introduce getOriginalBeanName(String) in ScopedProxyUtils
This commit introduces a utility method for retrieving the original
bean name for the target of a scoped proxy.

Closes gh-23514
2019-08-27 15:46:34 +02:00
Rossen Stoyanchev
a7bb5ca473 Remove unnecessary iteration over headers
The use of LinkedCaseInsensitiveMap, going back to 3.0, makes it
unnecessary to iterate over keys which can cause
ConcurrentModificationException.

Closes gh-23460
2019-08-21 13:34:17 +03:00
Rossen Stoyanchev
6d8bf3466c Suppress decoding error for resource path
Closes gh-23463
2019-08-21 10:02:15 +03:00
Rossen Stoyanchev
b86c11cc9b Respect existing content-length for HTTP HEAD
Closes gh-23484
2019-08-21 02:28:19 +03:00
Stephane Nicoll
122e2ca2ac Merge pull request #23437 from wyhasany
* pr/23437:
  Fix typo

Closes gh-23437
2019-08-09 09:37:00 +02:00
Michał Rowicki
806fcb3839 Fix typo
See gh-23437
2019-08-09 09:36:46 +02:00
Sam Brannen
30ebc3b8e2 Remove superfluous AnnotationAttributes#putIfAbsent implementation
Since Java 8, putIfAbsent() is a standard method in java.util.Map. We
therefore no longer need the custom implementation that overrides the
standard implementation in HashMap.
2019-08-06 18:10:13 +02:00
Sam Brannen
a092dc055e Check for instanceof Throwable in AnnotationAttributes#assertNotException
Prior to this commit, AnnotationAttributes#assertNotException checked if
the attribute value was an instance of Exception. Although this was
typically sufficient, the scope was not always broad enough -- for
example, if AnnotationReadingVisitorUtils#convertClassValues stored a
Throwable in the map (such as a LinkageError).

This commit fixes this by checking for an instance of Throwable in
AnnotationAttributes#assertNotException.

Closes gh-23424
2019-08-06 18:06:00 +02:00
Rossen Stoyanchev
70be7117f3 Fix link to Spring AMQP and polish
Optimize section headings for dispaly in left hand navigation.
2019-08-02 16:32:01 +01:00
Spring Buildmaster
f13a6d4f32 Next Development Version 2019-08-02 09:02:14 +00:00
Juergen Hoeller
7c2e2d40af Polishing 2019-08-02 01:39:02 +02:00
Juergen Hoeller
d8e624e97e Consistent suppression of get/clearWarnings without target connection
See gh-23346
2019-08-02 01:19:16 +02:00
Juergen Hoeller
762ea3ea90 Document all remaining public methods on BeanDefinitionParserDelegate
Closes gh-23349
2019-08-01 15:26:11 +02:00
Juergen Hoeller
871bb57e02 TransactionAwareDataSourceProxy locally handles get/clearWarnings call
Closes gh-23346
2019-08-01 15:26:00 +02:00
Juergen Hoeller
aebc485eda MethodParameter.equals properly checks overridden containing class
Closes gh-23352
2019-08-01 14:34:39 +02:00
Juergen Hoeller
ea4f7d365f Deprecate logger field in HandlerMethodArgumentResolverComposite 2019-07-31 23:48:21 +02:00
Juergen Hoeller
438b40f6d7 Consistent ordering of WebClient.Builder methods 2019-07-31 23:48:14 +02:00
Juergen Hoeller
59064f0780 Upgrade to Undertow 2.0.23 and Apache Johnzon 1.1.12 2019-07-30 22:27:09 +02:00
Juergen Hoeller
960079e5f5 Retain non-null HttpStatus return value in Client(Http)Response
See gh-23366
2019-07-30 22:26:46 +02:00
Arjen Poutsma
29ef985411 Add support for non-standard status codes
Added support for status codes that do not occur in HttpStatus in
DefaultClientResponseBuilder and made ClientResponse::statusCode
ClientHttpResponse::getStatusCode @Nullable.

Closed gh-23366
2019-07-30 17:44:47 +02:00
Juergen Hoeller
b2c56590dd Upgrade to Netty 4.1.38 and Checkstyle 8.23 2019-07-30 16:59:23 +02:00
Juergen Hoeller
c4622dbebc Polishing 2019-07-30 16:59:01 +02:00
Juergen Hoeller
9a36027ae1 MethodParameter.equals checks nesting level and containing class
Closes gh-23352
2019-07-30 16:58:45 +02:00
Arjen Poutsma
6cb4b8bd43 Add onRawStatus to WebClient
- Add onRawStatus to WebClient.ResponseSpec, allowing users to deal with
  raw status codes that are not in HttpStatus.
- No longer throw an exception status codes not in HttpStatus.

Closes gh-23367
2019-07-30 15:10:33 +02:00
Rossen Stoyanchev
7b697266be PathPatternParser allows '-' in variables
The isJavaIdentifier check is not really required, but also seems
intuitive for variables to be Java identifier-like. This commit relaxes
the constraint a bit by also allowing "-".

Closes gh-23101
2019-07-30 12:04:47 +01:00
Rossen Stoyanchev
1d92755cc7 Remove custom handling of byte[] in DefaultStompSession
Closes gh-23358
2019-07-30 10:52:51 +01:00
Stephane Maldini
50a909908c Remove unnecessary flushOnEach (since reactor-netty 0.9) 2019-07-30 10:54:51 +02:00
Stephane Nicoll
da54121ee0 Upgrade to Reactor Californium-SR10 2019-07-30 09:51:32 +02:00
Sam Brannen
5034d1e7b3 Introduce ServerHttpRequest.Builder.header() variant for setting headers
Prior to this commit, the `header(String, String)` method in the
ServerHttpRequest.Builder API actually added a header value instead of
setting or overriding a header value. Since this conflicted with the
stated behavior in the Javadoc as well as the original intention of the
method, we have decided to introduce an overloaded variant
`header(String, String...)` which accepts a var-args list of header
values to set or override.

In addition, this commit deprecates the existing `header(String, String)`
method for removal in Spring Framework 5.2.

In order not to be a breaking change for custom implementations of the
builder API, this commit implements the new `header(String, String...)`
method as an interface `default` method, with the intent to remove the
default implementation in Spring Framework 5.2

closes gh-23333
2019-07-25 13:02:09 +02:00
Stephane Nicoll
0f9c7934bb Merge pull request #23353 from izeye
* pr/23353:
  Add Javadoc since for Jaxb2XmlDecoder(MimeType...)

Closes gh-23353
2019-07-25 08:39:13 +02:00
Johnny Lim
946fc39d42 Add Javadoc since for Jaxb2XmlDecoder(MimeType...)
See gh-23353
2019-07-25 08:38:46 +02:00
Ryan Burke
78802d4277 Fix typo in webflux.adoc 2019-07-22 18:35:53 +02:00
Juergen Hoeller
92890232df Upgrade to OpenPDF 1.2.21, Rome 1.12.1, XStream 1.4.11.1
Includes updated javadoc links for 5.1.x branch.
2019-07-20 18:20:03 +02:00
Juergen Hoeller
b1e8ed182e Polishing 2019-07-20 17:53:54 +02:00
Juergen Hoeller
0d37209b78 Document default message handling in MessageSource.getMessage variants 2019-07-20 16:23:31 +02:00
Juergen Hoeller
4a09b323b6 Apply getInterfaceMethodIfPossible without SecurityManager as well
Closes gh-23323
2019-07-20 16:11:17 +02:00
Juergen Hoeller
209c8505e6 Align forRawClassAssignableFromTypeVariable with 5.1 assertion style
See gh-23321
2019-07-20 16:10:49 +02:00
Phillip Webb
e5bef10d85 Fix ResolvableType raw class isAssignable checks
Fix `isAssignable` for `ResolvableType.forRawClass` so that it can be
used with types backed by a `TypeVarible`. Prior to this commit the
rawClass value was used, which wouldn't always work.

Closes gh-23321
2019-07-20 13:23:21 +01:00
zheng.ren01@mljr.com
f92b60c08f Only invoke getInterfaceMethodIfPossible() when security manager is used
Prior to this commit, AbstractAutowireCapableBeanFactory's
invokeCustomInitMethod() method invoked
ClassUtils.getInterfaceMethodIfPossible() even if the security manager
was not being used.

This commit ensures that getInterfaceMethodIfPossible() is only invoked
if the security manager is used.

Closes gh-23323
2019-07-20 13:30:57 +02:00
Rossen Stoyanchev
a244675630 Merge pull request #23305' from AndreasKl/fowarded-prefix-causes-invalid-path into 5.1.x 2019-07-19 10:44:42 +01:00
Rossen Stoyanchev
153ac82380 Polish 2019-07-19 10:44:23 +01:00
Andreas Kluth
4973e110ee An empty X-Forwarded-Prefix with a path containing escape sequences leads to exceptions. 2019-07-19 10:44:23 +01:00
Rossen Stoyanchev
2b94205ba9 Update docs on multipart with RestTemplate
Replace docs on using MultipartBodyBuilder for the RestTemplate with
examples that show MultiValueMap. Originally the idea was to make
MultipartBodyBuilder accessible to the RestTemplate too, but with
support for async parts that's no longer a good fit.

Closes gh-23295
2019-07-19 10:43:50 +01:00
Juergen Hoeller
46e5b6f7af Upgrade to Tomcat 9.0.22, Checkstyle 8.22, Mockito 2.28.2 2019-07-17 23:26:07 +02:00
Juergen Hoeller
f5daa657f4 Polishing 2019-07-17 23:25:50 +02:00
Juergen Hoeller
9ffdf05d77 Explicit javadoc note on publishEvent hand-off semantics
See gh-21025
2019-07-17 23:25:21 +02:00
Juergen Hoeller
18bfa6b003 Consider Hibernate Query.list() as query-terminating method
Closes gh-23248
2019-07-17 23:24:52 +02:00
Sam Brannen
74ddf1bee5 Improve documentation for @Autowired constructors
Prior to this commit, there was some ambiguity surrounding semantics
for @Autowired constructors and `required = true`, especially for
multiple @Autowired constructors.

This commit improves the documentation in the Javadoc for @Autowired as
well as in the reference manual.

Closes gh-23263
2019-07-17 18:55:58 +02:00