Commit Graph

20637 Commits

Author SHA1 Message Date
Brian Clozel
dc4cda1b13 WARN against invalid patterns with PathPatternParser
As of gh-24952, `PathPatternParser` will strictly reject patterns with
`"**"` in the middle of them. `"**"` is only allowed at the end of the
pattern for matching multiple path segments until the end of the path.

Currently, if `"**"` is used in the middle of a pattern it will be
considered as a single `"*"` instead. Rejecting such cases should
clarify the situation.

This commit prepares for that upcoming change and:

* logs a warning message if such a case is used by an application
* expands the MVC and WebFlux documentation about URI matching in
general

Closes gh-24958
2020-04-23 13:03:05 +02:00
Sam Brannen
5eba1ae73c Avoid deprecation warning in DefaultRSocketRequesterBuilderTests 2020-04-22 19:19:34 +02:00
Sam Brannen
a9cc7b3edc Improve tests for synthesized array of annotations 2020-04-22 15:17:33 +02:00
Sam Brannen
5721c747b2 Polishing 2020-04-21 18:47:28 +02:00
Sam Brannen
31fa1569c5 Avoid synthesizing annotations unnecessarily
Prior to Spring Framework 5.2, some of our annotation utilities would
not synthesize an annotation if it was already synthesized or not
synthesizable (i.e., did not declare local aliases via @AliasFor and
did not declare attributes that could override attributes in the
meta-annotation hierarchy above the given annotation); however, we lost
most of this functionality with the introduction of the new
MergedAnnotations API.

This commit revises the implementation of createSynthesized() in
TypeMappedAnnotation so that, for invocations of
MergedAnnotation.synthesize() and indirectly for invocations of
AnnotatedElementUtils.findMergedAnnotation(), etc.:

1. An annotation that was previously synthesized will not be
   synthesized again.

2. An annotation that is not "synthesizable" will not be synthesized.

For both of the above use cases, the original annotation is now
returned from createSynthesized().

Closes gh-24861
2020-04-21 13:31:06 +02:00
Rossen Stoyanchev
8d31dcaa29 Clarification on path extension deprecations
Closes gh-24642
2020-04-20 14:43:07 +01:00
Rossen Stoyanchev
4b85b44bbd Update Javadoc of InputStreamResource#contentLength
Closes gh-20990
2020-04-20 12:53:42 +01:00
Rossen Stoyanchev
fa5e8485ab Update StackOverflow link 2020-04-20 12:32:11 +01:00
Rossen Stoyanchev
1904e9b7e7 Disable failing test temporarily 2020-04-20 10:16:40 +01:00
Sébastien Deleuze
6d5080825c Remove potentially confusing kotlin-reflect related log message
Closes gh-24935
2020-04-20 11:00:29 +02:00
Rossen Stoyanchev
ed8c61a852 Upgrade to RSocket 1.0 RC7 snapshots 2020-04-20 09:42:28 +01:00
Sam Brannen
376434eb75 Polishing 2020-04-19 19:17:02 +02:00
Sam Brannen
f42955c31b Polishing 2020-04-19 17:49:08 +02:00
Mikael
d6c9c7d642 Simplify substring() usage in MimeTypeUtils
Closes gh-24933
2020-04-19 17:39:06 +02:00
Sam Brannen
3dadcaeb2d Polishing 2020-04-17 19:07:49 +02:00
Johnny Lim
87fa2c3b97 Avoid unnecessary String instantiation in StringUtils.deleteAny()
This commit avoids unnecessary String instantiation in
StringUtils.deleteAny() if nothing was deleted from the
input string.

Closes gh-24924
2020-04-17 18:44:16 +02:00
Deycoesr
87f28ce48e Simplify some control flow code
Closes gh-24925
2020-04-17 18:32:02 +02:00
Sam Brannen
b8835c9f32 Copy MockHttpServletRequest changes to spring-web
See gh-24916
2020-04-17 16:20:42 +02:00
Sam Brannen
6b410df45b Retain brackets for IPV6 address in MockHttpServletRequest
According to the Javadoc for ServletRequest's getServerName() method,
when the `Host` header is set, the server name is "the value of the
part before ':' in the Host header value ...". For a value representing
an IPV6 address such as `[::ffff:abcd:abcd]`, the enclosing square
brackets should therefore not be stripped from the enclosed IPV6
address.

However, the changes made in conjunction with gh-16704 introduced a
regression in Spring Framework 4.1 for the getServerName() method in
MockHttpServletRequest by stripping the enclosing brackets from the
IPV6 address in the `Host` header. Similarly, the changes made in
conjunction with gh-20686 introduced a regression in Spring Framework
4.3.13 and 5.0.2 in the getRequestURL() method in
MockHttpServletRequest by delegating to the getServerName() method
which strips the enclosing brackets.

This commit fixes the implementation of getServerName() so that the
enclosing brackets are no longer stripped from an IPV6 address in the
`Host` header. The implementation of getRequestURL() is therefore also
fixed.

In addition, in order to avoid a NullPointerException, the
implementations of getServerName() and getServerPort() now assert that
an IPV6 address present in the `Host` header correctly contains an
opening and closing bracket and throw an IllegalStateException if that
is not the case.

Closes gh-24916
2020-04-17 15:01:35 +02:00
Sam Brannen
0017256968 Test that @TestConstructor can be used as a meta-annotation 2020-04-17 13:29:33 +02:00
Oliver Degener
df291a39b1 Fix Javadoc link in DefaultCorsProcessor
Closes gh-24921
2020-04-17 09:26:53 +02:00
Brian Hartung
1658223e58 Fixed typo
Fixed another small documentation typo.
2020-04-15 14:20:35 +01:00
Brian Hartung
89775844ed Fixed typos
Fixed a couple of minor documentation typos
2020-04-15 14:20:35 +01:00
Juergen Hoeller
d211381b58 Upgrade to Tomcat 9.0.34, Jetty 9.4.28, Hibernate ORM 5.4.14, Hibernate Validator 6.1.3 2020-04-15 13:05:02 +02:00
Sébastien Deleuze
a33a6c310a Upgrade to Kotlin 1.3.72 2020-04-15 12:12:59 +02:00
Sébastien Deleuze
67955dfb35 Prevent duplicated Vary headers in CORS processing
Closes gh-24829
2020-04-15 11:23:59 +02:00
Stephane Nicoll
ae8f333d36 Merge pull request #24908 from chenqimiao
* pr/24908:
  Fix typo in Javadoc

Closes gh-24908
2020-04-15 08:37:58 +02:00
陈其苗
1e1ea34e87 Fix typo in Javadoc
See gh-24908
2020-04-15 08:36:33 +02:00
onnadi-sa
75457c440c Fix typo in webflux-functional.adoc
Closes gh-24906
2020-04-14 15:42:50 +02:00
Sébastien Deleuze
884c7696ce Make it possible to run Spring MVC without kotlin-reflect
Closes gh-24828
2020-04-14 14:56:47 +02:00
Sam Brannen
3aa7f45738 Upgrade to JUnit 5.6.2 2020-04-14 14:49:11 +02:00
Sam Brannen
154fa29471 Upgrade to spring-doc-resources 0.2.1
See gh-24865
2020-04-14 13:36:11 +02:00
Stephane Nicoll
4523d9586f Start building against Reactor Dysprosium-SR7 snapshots
See gh-24892
2020-04-10 17:16:31 +02:00
Brian Clozel
39536acf9f Fix potential leak in MimeTypeUtils LRUCache
Prior to this commit, the `MimeTypeUtils` LRUCache would maintain a
queue to track least recently used cached values. In some cases,
concurrent access could create more entries in that unbounded queue than
expected and spend a significant amount of time removing entries in that
queue (i.e. iterating over a long list of elements).

This commit ensures that recently used entries are only added to the
queue if they've been removed by the current thread, in case of
concurrent access.

Fixes gh-24886
2020-04-09 15:38:01 +02:00
Juergen Hoeller
de0d06fab5 Polishing 2020-04-09 11:49:35 +02:00
Lars Grefer
8682a5d89a Honor overriden AccepptHeaderLocaleContextResolver.getDefaultLocale() 2020-04-09 11:37:50 +02:00
Сергей Цыпанов
e1951a098b Improve performance of StringUtils.deleteAny() 2020-04-09 11:36:32 +02:00
Sam Brannen
8c0aaf4863 Delete meaningless "performance" test
The test deleted in this commit didn't even assert anything to begin
with.

See gh-24830
2020-04-08 15:21:32 +02:00
Sam Brannen
9628038c58 Upgrade to BeanShell 2.0b6 2020-04-07 18:06:43 +02:00
Sébastien Deleuze
3c354a9b18 Avoid using Mockito argument matcher in Mockk test 2020-04-07 16:38:09 +02:00
Sam Brannen
6c26765985 Document default constructor as fallback for non-@Autowired constructors
Prior to this commit, it was unclear in the documentation that a default
constructor will be used by default for autowiring if multiple
constructors are present and none of them is annotated with @Autowired.

This commit improves the documentation in this regard.

Closes gh-24838
2020-04-07 14:35:40 +02:00
Sam Brannen
a5498ba2ad Test status quo for @Primary + TransactionManagementConfigurer in TCF
This commit introduces an integration test for the status quo in the
Spring TestContext Framework (TCF) for multiple transaction managers
registered as @Primary and via the TransactionManagementConfigurer API.

In Spring Framework 5.3 we will revise the transaction manager lookup in
TestContextTransactionUtils so that the transaction manager configured
via the TransactionManagementConfigurer API is favored over a @Primary
transaction manager.

See gh-24869
2020-04-06 19:11:53 +02:00
Sam Brannen
a42944d364 Consolidate TxMgr lookup tests in the TCF
This commit consolidates TransactionManager lookup tests in the Spring
TestContext Framework (TCF), migrates some to JUnit Jupiter, simplifies
their implementations, and removes duplicated test cases.
2020-04-06 18:21:48 +02:00
Sam Brannen
1d0c5195bc Polish Javadoc for TransactionManagementConfigurer 2020-04-06 15:31:48 +02:00
Sam Brannen
144b0e1437 Test status quo for @Primary + TransactionManagementConfigurer
This commit introduces tests for the status quo in production support
for multiple transaction managers registered as @Primary and via the
TransactionManagementConfigurer API.

See gh-24869
2020-04-06 15:16:31 +02:00
Sam Brannen
dc5ddffd03 Polishing 2020-04-06 14:42:23 +02:00
Sam Brannen
f8ab19dc68 Ensure @EnableTxMgmt tests actually test something 2020-04-06 14:32:34 +02:00
Qimiao Chen
fd8d11c7e3 Use single String instead of String[] for varargs argument
Closes gh-24864
2020-04-04 20:05:19 +02:00
Juergen Hoeller
251501587b Consistent nullability of arguments array in JdbcOperations/Template
Closes gh-24839
2020-04-03 21:15:00 +02:00
Juergen Hoeller
6177e38eb6 Close-suppressing Connection proxy exposes target isClosed() state
Closes gh-24853
2020-04-03 21:13:53 +02:00