Commit Graph

20962 Commits

Author SHA1 Message Date
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
Sam Brannen
aaa7c6c422 Merge branch '5.2.x' 2020-06-05 15:35:05 +02:00
Sam Brannen
fbeecf3bf8 Test status quo for invocation order of all advice types
Prior to this commit we did not have tests in place to verify the status
quo for the invocation order of all advice types when declared within
a single aspect, either via the <aop:aspect> XML namespace or AspectJ
auto-proxy support.

This commit introduces such tests that demonstrate where such ordering
is broken or suboptimal.

The only test for which the advice invocation order is correct or at
least as expected is the afterAdviceTypes() test method in
ReflectiveAspectJAdvisorFactoryTests, where an AOP proxy is hand crafted
using ReflectiveAspectJAdvisorFactory without the use of Spring's
AspectJPrecedenceComparator.

See gh-25186
2020-06-05 15:30:57 +02:00
Sam Brannen
04c8de4e50 Polishing 2020-06-05 15:22:41 +02:00
Arjen Poutsma
5f1326f233 Respect MimeType charset in Jackson codecs
Before this commit, Jackson2CodecSupport and subclasses
did not check media type encoding in the supportsMimeType
method (called from canEncode/canDecode).
As a result, the encoder reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

Closes: gh-25076
2020-06-05 15:09:05 +02:00
Arjen Poutsma
6a829a322a Respect MediaType charset in Jackson converters
Before this commit, AbstractJackson2HttpMessageConverter and subclasses
did not check media type encoding in the canRead and canWrite
methods. As a result, the converter reported that it can write
(for instance) "application/json;charset=ISO-8859-1", but in practice
wrote the default charset (UTF-8).

This commit fixes that bug.

See: gh-25076
2020-06-05 15:09:05 +02:00
Martin Macko
e11da64e9c Fix obsolete link in Kotlin docs
Closes gh-25192
2020-06-05 14:12:38 +02:00