Commit Graph

21168 Commits

Author SHA1 Message Date
Sam Brannen bc4945d677 Ensure non-null condition comes 1st in ternary operator
See gh-25232
2020-06-11 15:11:48 +02:00
GardenLee e866fac8e7 Wrap ternary operator within parentheses as outlined in Code Style
Closes gh-25232
2020-06-11 15:11:48 +02:00
Juergen Hoeller 663f2e8afd Merge branch '5.2.x' 2020-06-10 22:53:06 +02:00
Juergen Hoeller ae1ed9d458 Document exception handling limitations in TaskDecorator implementations
Closes gh-25231
2020-06-10 22:52:01 +02:00
Juergen Hoeller 8697026987 Support for custom cache registration in CaffeineCacheManager
Closes gh-25230
2020-06-10 22:50:11 +02:00
Sam Brannen b0e07cc7e3 Delete dead code in spring-webmvc 2020-06-10 18:35:03 +02:00
Sam Brannen 335ca75ec2 Polish contribution
See gh-25078
2020-06-10 18:25:31 +02:00
liym@home 8fb7399a0c Upgrade to Dom4j 2.1.3 and Jaxen 1.2.0
Closes gh-25078
2020-06-10 16:38:43 +02:00
Arjen Poutsma 202799e6fe Rethrow XMLStreamExceptions as DecodingExceptions
Prior to this commit, Jaxb2XmlDecoder and XmlEventDecoder threw
XMLStreamExceptions instead of DecodingExceptions (as the Decoder
contract defines).

This commit resolves this issue.

Closes: gh-24778
2020-06-10 15:56:45 +02:00
GardenLee eb3be3ad88 Refactor method name dispatching to switch statements in AutowireUtils
Closes gh-25199
2020-06-09 23:46:29 +02:00
Sam Brannen b9e52a8089 Delete dead code in MockServerHttpRequest 2020-06-09 17:38:34 +02:00
Sam Brannen 905483be30 Polish Javadoc for @PropertySource 2020-06-09 16:39:58 +02:00
Rossen Stoyanchev 33181daeac Merge branch '5.2.x' 2020-06-09 11:57:40 +01:00
Rossen Stoyanchev 1d0fe1223d Fix checkstyle violation 2020-06-09 11:47:05 +01:00
Rossen Stoyanchev 3cc7efc841 Merge branch '5.2.x' 2020-06-09 09:02:52 +01:00
Rossen Stoyanchev b48ddef4c6 Upgrade to RSocket 1.0.1 2020-06-09 08:59:55 +01:00
Stephane Nicoll e0d712946c Merge branch '5.2.x' 2020-06-09 09:56:49 +02:00
Spring Buildmaster d0a9e359aa Next Development Version 2020-06-09 06:51:55 +00:00
Rossen Stoyanchev 1984cfe9d7 Merge branch '5.2.x' 2020-06-08 21:20:44 +01:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01:00
Juergen Hoeller 21b1f30660 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
2020-06-08 20:26:14 +02:00
Juergen Hoeller 4c29bbb77f Upgrade to Reactor Dysprosium-SR8
Closes gh-25210
2020-06-08 20:23:37 +02:00
Juergen Hoeller d2cd4c50f4 Upgrade to Tomcat 9.0.36 2020-06-08 19:38:23 +02:00
Juergen Hoeller c777468056 Polishing 2020-06-08 19:37:58 +02:00
Juergen Hoeller 9c1c787ee9 Polishing 2020-06-08 19:27:38 +02:00
Sam Brannen edbc54fe78 Merge branch '5.2.x' 2020-06-08 19:17:01 +02:00
Sam Brannen 721fd20708 Document advice precedence in reference manual
This commit documents the precedence for advice declared within the
same @Aspect class or within the same <aop:aspect> element.

See gh-25186
2020-06-08 19:06:46 +02:00
Sam Brannen 0b760c15ea Polish AOP chapter in reference manual 2020-06-08 19:06:46 +02:00
Rossen Stoyanchev 150fe96a98 Merge branch '5.2.x' 2020-06-08 17:44:42 +01:00
Rossen Stoyanchev 9e1121fd8d Document behavior on reactive tx cancellation
Closes gh-25091
2020-06-08 17:43:52 +01:00
Arjen Poutsma 8b59b6a7f4 Merge branch '5.2.x' 2020-06-08 15:43:49 +02:00
Arjen Poutsma 0ccf5e19aa Undo MockServerRequest deprecation
Setting path variables (and making sure they are available in a
HandlerFunction) is more convenient with MockServerRequest than
having to set attributes in MockServerWebExchange.

This commit removes MockServerRequest's deprecation.

Closes gh-25087
2020-06-08 15:40:09 +02:00
Sam Brannen 0bfcabebf3 Merge branch '5.2.x' 2020-06-08 14:21:50 +02:00
Sam Brannen 0998bd49ef Implement reliable advice invocation order within an @Aspect
The AspectJPrecedenceComparator was designed to mimic the precedence
order enforced by the AspectJ compiler with regard to multiple 'after'
methods defined within the same aspect whose pointcuts match the same
joinpoint. Specifically, if an aspect declares multiple @After,
@AfterReturning, or @AfterThrowing advice methods whose pointcuts match
the same joinpoint, such 'after' advice methods should be invoked in
the reverse order in which they are declared in the source code.

When the AspectJPrecedenceComparator was introduced in Spring Framework
2.0, it achieved its goal of mimicking the AspectJ compiler since the
JDK at that time (i.e., Java 5) ensured that an invocation of
Class#geDeclaredMethods() returned an array of methods that matched the
order of declaration in the source code. However, Java 7 removed this
guarantee. Consequently, in Java 7 or higher,
AspectJPrecedenceComparator no longer works as it is documented or as
it was designed when sorting advice methods in a single @Aspect class.
Note, however, that AspectJPrecedenceComparator continues to work as
documented and designed when sorting advice configured via the
<aop:aspect> XML namespace element.

PR gh-24673 highlights a use case where AspectJPrecedenceComparator
fails to assign the highest precedence to an @After advice method
declared last in the source code. Note that an @After advice method
with a precedence higher than @AfterReturning and @AfterThrowing advice
methods in the same aspect will effectively be invoked last due to the
try-finally implementation in AspectJAfterAdvice.invoke() which invokes
proceed() in the try-block and invokeAdviceMethod() in the
finally-block.

Since Spring cannot reliably determine the source code declaration
order of annotated advice methods without using ASM to analyze the byte
code, this commit introduces reliable invocation order for advice
methods declared within a single @Aspect. Specifically, the
getAdvisors(...) method in ReflectiveAspectJAdvisorFactory now hard
codes the declarationOrderInAspect to `0` instead of using the index of
the current advice method. This is necessary since the index no longer
has any correlation to the method declaration order in the source code.
The result is that all advice methods discovered via reflection will
now be sorted only according to the precedence rules defined in the
ReflectiveAspectJAdvisorFactory.METHOD_COMPARATOR. Specifically, advice
methods within a single @Aspect will be sorted in the following order
(with @After advice methods effectively invoked after @AfterReturning
and @AfterThrowing advice methods): @Around, @Before, @After,
@AfterReturning, @AfterThrowing.

The modified assertions in AspectJAutoProxyAdviceOrderIntegrationTests
demonstrate the concrete effects of this change.

Closes gh-25186
2020-06-08 14:18:28 +02:00
Sam Brannen d6525cfb97 Polishing 2020-06-08 14:17:39 +02:00
Juergen Hoeller a34f1e3759 Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
#	spring-webflux/src/main/java/org/springframework/web/reactive/function/client/DefaultWebClientBuilder.java
2020-06-06 18:52:51 +02:00
Juergen Hoeller d01830355d Upgrade to Jetty Reactive HttpClient 1.1.3 2020-06-06 18:49:47 +02:00
Juergen Hoeller 65154170d3 Polishing 2020-06-06 18:49:32 +02:00
Juergen Hoeller d71957ce7c Polishing 2020-06-06 17:45:12 +02:00
Juergen Hoeller 7244f03064 Avoid unnecessary creation of not-found entity in ResponseEntity#of
Closes gh-25183
2020-06-06 17:44:30 +02:00
Juergen Hoeller 98030f3794 Avoid unnecessary copy of cookies map in DefaultWebClientBuilder
See gh-25034
2020-06-06 17:44:02 +02:00
Juergen Hoeller f860b35df8 Upgrade to Undertow 2.1.3 2020-06-06 16:10:49 +02:00
Juergen Hoeller 65b09be669 Polishing 2020-06-06 16:10:20 +02:00
Juergen Hoeller 5051d7302d Merge branch '5.2.x'
# Conflicts:
#	build.gradle
#	spring-test/src/main/java/org/springframework/mock/http/server/reactive/MockServerHttpRequest.java
#	spring-web/src/main/java/org/springframework/http/HttpHeaders.java
#	spring-web/src/testFixtures/java/org/springframework/web/testfixture/http/server/reactive/MockServerHttpRequest.java
2020-06-06 15:27:15 +02:00
Juergen Hoeller f3d4df2fd4 Consistently check available local/remote addresses for non-null 2020-06-06 15:15:16 +02:00
Juergen Hoeller 9cd9a8e86b Extend readOnlyWebSocketHttpHeaders deprecation to 5.1.16 2020-06-06 14:41:06 +02:00
Juergen Hoeller 7b7d0a353d Upgrade to Hibernate ORM 5.4.17 and Checkstyle 8.33 2020-06-06 13:22:55 +02:00
Juergen Hoeller d14140da69 Polishing 2020-06-06 13:21:46 +02:00
Juergen Hoeller 196bb6fe32 Support for shared GroovyClassLoader in GroovyScriptFactory
Exposes setClassLoader method in ConfigurableApplicationContext interface as obvious first-class configuration option.

Closes gh-25177
2020-06-06 13:21:20 +02:00
Juergen Hoeller ad5710c1d1 Restore original readOnlyHttpHeaders signature for binary compatibility
Closes gh-25034
2020-06-06 13:14:47 +02:00