Commit Graph

20765 Commits

Author SHA1 Message Date
Juergen Hoeller e46ccd74b1 Consistent abstract declaration of "Abstract" base classes
Closes gh-25240
2020-06-11 23:43:41 +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
Rossen Stoyanchev 1d0fe1223d Fix checkstyle violation 2020-06-09 11:47:05 +01:00
Rossen Stoyanchev b48ddef4c6 Upgrade to RSocket 1.0.1 2020-06-09 08:59:55 +01:00
Spring Buildmaster d0a9e359aa Next Development Version 2020-06-09 06:51:55 +00:00
Rossen Stoyanchev a2d516d526 Replace "whitelist" with alternative words 2020-06-08 21:19:28 +01: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
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 9e1121fd8d Document behavior on reactive tx cancellation
Closes gh-25091
2020-06-08 17:43:52 +01: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 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 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 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 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 847629412f 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 10:53:28 +02:00
Arjen Poutsma eb0aae066c 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 10:52:42 +02:00
Sam Brannen a61ab5d296 Fix @since tags
See gh-25186
2020-06-04 18:51:51 +02:00
Sam Brannen 63e8609f3b Test status quo for 'after' advice invocation order
See gh-25186
2020-06-04 18:37:24 +02:00
Sam Brannen 70b3de4afe Polish AspectJAdvisorFactory tests 2020-06-04 18:37:16 +02:00
Rossen Stoyanchev 8dc8d88f88 Pre-calculated RequestMappingInfo hashcode
See gh-25143
2020-06-03 06:11:35 +01:00
Rossen Stoyanchev 1e25556049 Shared PathPatternParser instance
See gh-25143
2020-06-03 05:58:10 +01:00
Sam Brannen 1ced9370cd Configure Gradle wrapper validation action
This commit configures the Gradle Wrapper Validation Action
for GitHub actions.

See: https://github.com/gradle/wrapper-validation-action

Closes gh-25175
2020-06-02 14:43:45 +02:00
Juergen Hoeller 914425eefa Polishing 2020-05-29 15:52:39 +02:00
Juergen Hoeller cd4ef6f781 Consistently refer to FlushMode.MANUAL instead of outdated NEVER
Closes gh-25158
2020-05-29 15:51:54 +02:00
Juergen Hoeller 08474aa921 Clarify JDBC-defined negative values returned from batchUpdate
Closes gh-25138
2020-05-29 15:51:19 +02:00
Juergen Hoeller 2ff22510d9 Avoid earlyApplicationEvents iteration in case of empty Set
Closes gh-25161
2020-05-29 15:50:10 +02:00
Juergen Hoeller ef626e992d Document that MapPropertySource should not contain null values
Closes gh-25142
2020-05-29 15:49:36 +02:00
Juergen Hoeller bec89dba4c Consistent MultiValueMap behavior for empty list values
This commit extracts MultiValueMapAdapter from CollectionUtils and reuses its implementation as base class of LinkedMultiValueMap.

Closes gh-25140
2020-05-29 15:48:19 +02:00
Sam Brannen 768257567d Make use of custom types configurable in YamlProcessor
Prior to this commit, there was no easy way to restrict what types could
be loaded from a YAML document in subclasses of YamlProcessor such as
YamlPropertiesFactoryBean and YamlMapFactoryBean.

This commit introduces a setSupportedTypes(Class<?>...) method in
YamlProcessor in order to address this. If no supported types are
configured, all types encountered in YAML documents will be supported.
If an unsupported type is encountered, an IllegalStateException will be
thrown when the corresponding YAML node is processed.

Closes gh-25152
2020-05-29 13:32:52 +02:00
Sam Brannen 3201671ceb Polish contribution
See gh-25149
2020-05-28 14:37:18 +02:00
dlsrb6342 fce972eec8 Fix BaseCodecConfigurer clone bug
Prior to this commit, ExchangeStrategies custom codec's reader and
writer were not registered due to a bug in BaseCodecConfigurer.

This commit fixes this by correcting the implementation of the
DefaultCustomCodecs constructor used within BaseCodecConfigurer.

Closes gh-25149
2020-05-28 12:34:29 +02:00
Rossen Stoyanchev a92f425529 Also use constant for custom mapping condition
See gh-25143
2020-05-28 06:51:57 +01:00
Rossen Stoyanchev c0c3c01afd Fix race condition in WriteResultPublisher
between subscription and error from the Publish

Closes gh-25096
2020-05-27 19:11:29 +01:00
Rossen Stoyanchev 955f77bf5d Add error message to MockServerHttpRequest
Closes gh-25109
2020-05-27 18:57:02 +01:00
Rossen Stoyanchev e9a9883aa9 Optimal initialization of empty request mapping conditions
Closes gh-25143
2020-05-27 18:57:02 +01:00