Commit Graph

24828 Commits

Author SHA1 Message Date
Sam Brannen 5689395678 Deprecate "enclosing classes" search strategy for MergedAnnotations
The TYPE_HIERARCHY_AND_ENCLOSING_CLASSES search strategy for
MergedAnnotations was originally introduced to support @Nested test
classes in JUnit Jupiter (see #23378).

However, while implementing #19930, we determined that the
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES search strategy unfortunately
could not be used since it does not allow the user to control when to
recurse up the enclosing class hierarchy. For example, this search
strategy will automatically search on enclosing classes for static
nested classes as well as for inner classes, when the user probably
only wants one such category of "enclosing class" to be searched.
Consequently, TestContextAnnotationUtils was introduced in the Spring
TestContext Framework to address the shortcomings of the
TYPE_HIERARCHY_AND_ENCLOSING_CLASSES search strategy.

Since this search strategy is unlikely to be useful to general users,
the team has decided to deprecate this search strategy in Spring
Framework 5.3.x and remove it in 6.0.

Closes gh-28079
2022-02-19 16:51:00 +01:00
Sam Brannen be8224a590 Polish contribution
See gh-27818
2022-02-19 16:04:55 +01:00
Guirong Hu 01214b3473 Allow @Async qualifier to be declared with a placeholder or SpEL expression
Closes gh-27818
2022-02-19 15:09:40 +01:00
Sam Brannen 6a73d2655f Polishing 2022-02-19 14:59:54 +01:00
Sam Brannen 8c6d59aaaf Polish contribution
See gh-28014
2022-02-19 14:43:26 +01:00
a.yazychyan c5c926726d Use enhanced switch expressions where feasible
Closes gh-28014
2022-02-19 14:34:05 +01:00
Phillip Webb 42d114534b Polish BeanDefinitionRegistrar 2022-02-18 17:13:07 +01:00
Sam Brannen 8c5a407a7d Suppress deprecation warnings in tests in build 2022-02-18 16:22:43 +01:00
Sam Brannen 968efb34f6 Merge branch '5.3.x' 2022-02-18 16:18:36 +01:00
Sam Brannen 071c2988d5 Suppress deprecation warnings in tests in build 2022-02-18 16:18:13 +01:00
Sam Brannen 6c832598c9 Merge branch '5.3.x' 2022-02-18 15:32:58 +01:00
Sam Brannen 94af2ca06b Recover from error during SpEL MIXED mode compilation
Prior to this commit, SpEL was able to recover from an error that
occurred while running a CompiledExpression; however, SpEL was not able
to recover from an error that occurred while compiling the expression
(such as a java.lang.VerifyError). The latter can occur when multiple
threads concurrently change types involved in the expression, such as
the concrete type of a custom variable registered via
EvaluationContext.setVariable(...), which can result in SpEL generating
invalid bytecode.

This commit addresses this issue by catching exceptions thrown while
compiling an expression and updating the `failedAttempts` and
`interpretedCount` counters accordingly. If an exception is caught
while operating in SpelCompilerMode.IMMEDIATE mode, the exception will
be propagated via a SpelEvaluationException with a new
SpelMessage.EXCEPTION_COMPILING_EXPRESSION error category.

Closes gh-28043
2022-02-18 15:31:59 +01:00
Juergen Hoeller 4a470e0a37 Prevent @Bean method overloading by default (with enforceUniqueMethods flag)
Closes gh-22609
2022-02-17 22:37:34 +01:00
Juergen Hoeller 41ee23345d Support for registering multiple init/destroy methods on AbstractBeanDefinition
Closes gh-28013
2022-02-17 18:14:09 +01:00
Arjen Poutsma 8506778608 Use JDK 17 on main branch in .sdkmanrc
This commit makes sure that JDK 17 is used on the main branch.
2022-02-17 11:55:25 +01:00
Arjen Poutsma 0814c67913 Merge branch '5.3.x' 2022-02-17 11:53:26 +01:00
Arjen Poutsma ff20a06876 Added .sdkmanrc file
This commit adds a .sdkmanrc file, so that we can automatically switch
to JDK 8 when building the 5.3. branch.
2022-02-17 11:51:14 +01:00
Stephane Nicoll b96474707b Merge branch '5.3.x' 2022-02-17 10:07:31 +01:00
Stephane Nicoll 2ffefbb211 Downgrade to concourse-release-scripts 0.3.2
This commit reverts partially "0ab054c7b943d65bb9034d1d7987f556e9d54d05"
as 0.3.3 is breaking promition.
2022-02-17 09:44:22 +01:00
Spring Builds 4571626839 Next development version (v5.3.17-SNAPSHOT) 2022-02-17 07:45:38 +00:00
Juergen Hoeller 3c0a5fd063 Upgrade to POI 5.2 2022-02-16 20:12:59 +01:00
Juergen Hoeller 69db0f7b45 Merge branch '5.3.x'
# Conflicts:
#	build.gradle
2022-02-16 20:07:55 +01:00
Juergen Hoeller f8a59c267f Polishing 2022-02-16 20:04:51 +01:00
Juergen Hoeller 1166577d2c Upgrade to Netty 4.1.74, Jetty 9.4.45, Undertow 2.2.16, Hibernate Validator 6.2.2, Apache Johnzon 1.2.16, EclipseLink 2.7.10 2022-02-16 20:04:27 +01:00
Stephane Nicoll 7f5110a549 Merge branch '5.3.x' 2022-02-16 14:36:50 +01:00
Phillip Webb 36dc4e4c5f Add mavenCentral() to pluginManagement repositories
Update the pluginManagement repositories used by Grade to include
`mavenCentral()` since `gradlePluginPortal()` has been suffering
from timeouts recently.
2022-02-16 14:35:50 +01:00
Sam Brannen c1987e5b8c Merge branch '5.3.x' 2022-02-16 12:12:37 +01:00
Sam Brannen 3ac60147f3 Improve documentation for uri(URI) method in WebTestClient
Prior to this commit, it was not clear that a configured base URI would
not be applied when invoking uri(URI).

This commit adds a note to the Javadoc to clarify that behavior.

Closes gh-28058
2022-02-16 12:11:33 +01:00
Sam Brannen e3ceb9b23d Polish @Target declarations for stereotype annotations 2022-02-16 12:01:14 +01:00
Arjen Poutsma 3463106532 Merge branch '5.3.x' 2022-02-16 11:24:10 +01:00
Arjen Poutsma 5ab966fbde Polish contribution
See gh-28038
2022-02-16 11:16:38 +01:00
vikey 7276752e7c Fix CronExpression issue with DST
This commit fixes an issue with CronExpression fails to calculate next
execution on the day of daylight saving time.

Closes gh-28038
2022-02-16 11:16:38 +01:00
Phillip Webb b3306f4e3d Suppress deprecation warning in WebAsyncManagerTests
See gh-27959
2022-02-15 15:11:31 -08:00
Phillip Webb 18b8e4ec5c Add mavenCentral() to pluginManagement repositories
Update the pluginManagement repositories used by Grade to include
`mavenCentral()` since `gradlePluginPortal()` has been suffering
from timeouts recently.
2022-02-15 15:11:31 -08:00
Sam Brannen 2cee63491d Remove deprecated SocketUtils
Closes gh-28052
2022-02-15 16:19:11 +01:00
Sam Brannen bbd35ded91 Stop using SocketUtils in ActiveMQ STOMP broker tests
See gh-28052
2022-02-15 15:53:43 +01:00
Stephane Nicoll 5fbd01f28f Polish 2022-02-15 15:25:45 +01:00
Sam Brannen d2d54c826f Increase max memory for Gradle to 2048m 2022-02-15 14:59:26 +01:00
Sam Brannen c42023f20e Stop using SocketUtils in WebClientIntegrationTests
See gh-28052
2022-02-15 14:59:26 +01:00
Sam Brannen 552e02cb44 Polishing 2022-02-15 14:44:46 +01:00
Sam Brannen 7412625929 Merge branch '5.3.x'
# Conflicts:
#	spring-web/src/test/java/org/springframework/remoting/caucho/CauchoRemotingTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/function/client/WebClientIntegrationTests.java
2022-02-15 14:35:25 +01:00
Sam Brannen 685a195ba1 Deprecate SocketUtils
SocketUtils was introduced in Spring Framework 4.0, primarily to assist
in writing integration tests which start an external server on an
available random port. However, these utilities make no guarantee about
the subsequent availability of a given port and are therefore
unreliable. Instead of using SocketUtils to find an available local
port for a server, it is recommended that users rely on a server's
ability to start on a random port that it selects or is assigned by the
operating system. To interact with that server, the user should query
the server for the port it is currently using.

SocketUtils is now deprecated in 5.3.16 and will be removed in 6.0.

Closes gh-28052
2022-02-15 14:28:58 +01:00
Sam Brannen 11de64d609 Merge branch '5.3.x' 2022-02-15 13:48:22 +01:00
Sam Brannen 3188c0f7db Ensure fix for gh-28012 is actually tested
In 3ec612aaf8, I accidentally removed tests that verified support for
non-synthesizable merged annotations for recursive annotations in
Kotlin.

This commit reinstates those non-synthesizable tests while retaining
the synthesizable tests.
2022-02-15 13:47:03 +01:00
Stephane Nicoll c732b56edd Merge branch '5.3.x' 2022-02-15 13:40:47 +01:00
Stephane Nicoll 3ea540adbc Upgrade to Reactor 2020.0.16
Closes gh-28039
2022-02-15 13:37:08 +01:00
Stephane Nicoll 2141373c43 Introduce AOT variant of BeanPostProcessor
This commit introduces an optional interface that a BeanPostProcessor
can implement to opt-in for providing a generated code equivalent of
what it does with a regular runtime.

This commit has a first implementation of this interface with
AutowiredAnnotationBeanPostProcessor replacing its processing of
autowired annotations by generated code.

Closes gh-27921
2022-02-15 13:27:07 +01:00
Stephane Nicoll 5bbc7dbce2 Polish ProtectedAccess options
This commit improves how protected access analysis operates. Rather than
providing a static boolean, a function callback for the member to
analyse is used. This permits to change the decision whether reflection
can be used, or if the return type is assigned.

Both of those are already applicable, with InjectionGenerator relying
on reflection for private fields, and DefaultBeanInstanceGenerator
assigning the bean instance if additional contributors are present.

This commit also moves the logic of computing the options where the code
is actually generated.

See gh-28030
2022-02-15 13:16:39 +01:00
rstoyanchev 4782d4c080 Merge branch '5.3.x' into main 2022-02-14 20:52:09 +00:00
rstoyanchev ec03e8830e Remove path variables from pathWithinMapping
Closes gh-27913
2022-02-14 20:51:02 +00:00