Commit Graph

2329 Commits

Author SHA1 Message Date
Juergen Hoeller
d9ca263065 Merge branch '6.1.x' 2024-05-06 20:11:56 +02:00
Juergen Hoeller
05d9b52b19 Polishing 2024-05-06 20:10:40 +02:00
Juergen Hoeller
69eaf8f828 Merge branch '6.1.x' 2024-05-01 18:07:13 +02:00
Juergen Hoeller
25cedcfb99 Consistently propagate ApplicationStartup to BeanFactory
Closes gh-32747
2024-05-01 18:06:27 +02:00
Stéphane Nicoll
9492d88270 Stop wrapping low-level exceptions in CacheAspectSupport initialization
This commit replaces the IllegalStateException thrown in
CacheAspectSupport when a CacheManager cannot be determined. These were
added to provide a dedicated error message, but it is possible to do
so without hiding the more adequate exception type.

Closes gh-22442
2024-04-29 15:24:36 +02:00
Juergen Hoeller
0402ea13c0 Merge branch '6.1.x' 2024-04-24 13:42:43 +02:00
Juergen Hoeller
387e34d881 Wrap depends-on exception for specifically requested top-level bean
Closes gh-32470
2024-04-24 13:41:48 +02:00
Stéphane Nicoll
6682d75481 Merge branch '6.1.x' 2024-04-24 11:13:27 +02:00
Stéphane Nicoll
4a10bc3288 Refine preDetermineBeanTypes algorithm
This commit refines the preDetermineBeanTypes algorithm that AOT uses
to approximate the order of preInstantiateSingletons more closely.

Previously, the algorithm assumed that all beans where non-lazy
singletons in terms of initialization order, which led to inconsistent
order in CGLIB proxy generation.

We now explicitly park lazy beans so that their types are determined
during a second phase, matching the order of regular initialization
order.

Closes gh-32669

Co-authored-by: Juergen Hoeller <juergen.hoeller@broadcom.com>
2024-04-24 09:23:51 +02:00
Stéphane Nicoll
c21090ad31 Merge branch '6.1.x' 2024-04-22 15:16:50 +02:00
Stéphane Nicoll
8a8c8fe00e Detect target of factory method with AOT
Previously, if a factory method is defined on a parent, the generated
code would blindly use the method's declaring class for both the target
of the generated code, and the signature of the method.

This commit improves the resolution by considering the factory metadata
in the BeanDefinition.

Closes gh-32609
2024-04-22 15:13:56 +02:00
Juergen Hoeller
6a1ec0ed73 Merge branch '6.1.x' 2024-04-22 13:43:57 +02:00
Juergen Hoeller
ec1f5ca600 Polishing 2024-04-22 13:43:07 +02:00
Simon Baslé
43b5c81dad Merge branch '6.1.x' 2024-04-16 16:29:53 +02:00
xumengqi
bf3278596c Include actual cause's message in various parsing exception messages
This change improves the message of several parsing-related exceptions
that would previously entirely swallow the original exception's message
and sometimes have a slightly misleading message as a result.

This is done by appending the cause's `toString` representation to the
IllegalArgumentException messages instead of an hardcoded "cause".

Closes gh-32636
2024-04-16 16:25:42 +02:00
Juergen Hoeller
77c6f160fe Merge branch '6.1.x'
# Conflicts:
#	spring-aop/src/main/java/org/springframework/aop/framework/CglibAopProxy.java
#	spring-web/src/test/java/org/springframework/web/method/annotation/RequestParamMethodArgumentResolverTests.java
#	spring-webflux/src/test/java/org/springframework/web/reactive/result/method/annotation/RequestParamMethodArgumentResolverTests.java
2024-04-10 18:29:48 +02:00
Juergen Hoeller
39cd31613b Polishing 2024-04-10 18:06:32 +02:00
Sébastien Deleuze
711ddd1ac6 Merge branch '6.1.x' 2024-04-10 17:55:09 +02:00
Sébastien Deleuze
ca2b3c170c Add Kotlin hints for enclosing class
This is needed by Kotlin reflection in order to be able to list
class members on native.

Closes gh-32472
2024-04-10 17:53:12 +02:00
Juergen Hoeller
a9fffa844f Merge branch '6.1.x' 2024-04-09 16:15:19 +02:00
Juergen Hoeller
39b551c334 Document hand-off to execution thread (including ScheduledFuture impact)
Closes gh-32589
2024-04-09 16:14:38 +02:00
Sébastien Deleuze
0c42874629 Merge branch '6.1.x' 2024-04-05 14:33:20 +02:00
Stéphane Nicoll
6f95af978e Merge branch '6.1.x' 2024-04-01 12:14:56 +02:00
Yanming Zhou
23d89362b0 Polish javadoc of AnnotatedBeanDefinitionReader
See gh-32560
2024-04-01 12:12:02 +02:00
Sébastien Deleuze
8b51b36729 Perform NullAway build-time checks in more modules
This commit enables null-safety build-time checks in
all remaining modules except spring-test.

See gh-32475
2024-03-26 15:53:01 +01:00
Sébastien Deleuze
2fea3d7921 Merge branch '6.1.x' 2024-03-26 15:41:46 +01:00
Sébastien Deleuze
290a41d398 Refine null-safety in more modules
This commit refines the null-safety in all remaining modules
except spring-test.

See gh-32475
2024-03-26 15:39:18 +01:00
Juergen Hoeller
e58ea0d945 Merge branch '6.1.x'
# Conflicts:
#	spring-core/src/main/java/org/springframework/core/CoroutinesUtils.java
2024-03-19 10:06:48 +01:00
Juergen Hoeller
c531a8a705 Nullability refinements and related polishing
See gh-32475
2024-03-19 09:58:44 +01:00
Juergen Hoeller
2086cda296 Merge branch '6.1.x' 2024-03-15 21:30:55 +01:00
Juergen Hoeller
d2000efbd8 Polishing 2024-03-15 21:17:01 +01:00
Juergen Hoeller
c23fd784a0 Consistently apply TaskDecorator to ManagedExecutorService as well
Closes gh-32455
2024-03-15 21:16:37 +01:00
Juergen Hoeller
66235fa8c8 Consistent TaskDecorator and ErrorHandler support in schedulers
Closes gh-23755
Closes gh-32460
2024-03-15 21:07:59 +01:00
Sam Brannen
e1b1435a00 Stop referring to JDK 1.5 plus polishing 2024-03-14 16:00:51 +01:00
Stéphane Nicoll
13679bb906 Reject use of component scan with REGISTER_BEAN condition
This commit introduce a change of behaviour when component scan is used
with conditions. Previously, any condition in the REGISTER_BEAN phase
were ignored and the scan was applied regardless of the outcome of
those conditions. This is because REGISTER_BEAN condition evaluation
happens later in the bean factory preparation.

Rather than ignoring those conditions, this commit fails fast when it
detects such use case. Code will have to be adapted accordingly.

Closes gh-23206
2024-03-12 08:39:53 +01:00
Juergen Hoeller
19fec0633f Local root directory and jar caching in PathMatchingResourcePatternResolver
Closes gh-21190
2024-03-08 19:12:14 +01:00
Sam Brannen
ac1176af53 Use Map#computeIfAbsent in SpEL support classes
Closes gh-32385
2024-03-07 13:55:35 +01:00
Sam Brannen
dcbc2ef134 Polishing 2024-03-07 13:55:35 +01:00
Simon Baslé
7f0ab22c47 Merge branch '6.1.x' 2024-03-07 12:10:07 +01:00
Simon Baslé
6d9a2eb9b8 Improve fix of duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a
Flux (or multi-value publisher) will be invoked once, but the returned
publisher is actually subscribed twice.

The previous fix 988f3630c would cause the cached elements to depend on
the first usage pattern / request pattern, which is likely to be too
confusing to users. This fix reintroduces the notion of exhausting the
original Flux by having a second subscriber dedicated to that, but uses
`refCount(2)` to ensure that the original `Flux` returned by the cached
method is still only subscribed once.

Closes gh-32370
2024-03-07 12:08:28 +01:00
Juergen Hoeller
13221ac0ef Merge branch '6.1.x'
# Conflicts:
#	spring-tx/src/test/java/org/springframework/transaction/annotation/EnableTransactionManagementTests.java
#	spring-tx/src/test/java/org/springframework/transaction/interceptor/TransactionInterceptorTests.java
2024-03-06 18:09:32 +01:00
Juergen Hoeller
e5e61dfa3f Ignore scheduled task exceptions after shutdown
Includes suppression after logging, not propagating exceptions to the thread itself.

Closes gh-32381
See gh-32298
2024-03-06 18:03:31 +01:00
Simon Baslé
19b5f11734 Merge branch '6.1.x' 2024-03-05 18:33:48 +01:00
Simon Baslé
988f3630c4 Avoid duplicate upstream subscription during reactive cache put
This commit fixes an issue where a Cacheable method which returns a
Flux (or multi-value publisher) will be invoked once, but the returned
publisher is actually subscribed twice.

By using the Reactor `tap` operator, we ensure that we can emit values
downstream AND accumulate emitted values into the List with a single
subscription.

The SignalListener additionally handles scenarios involving cancel,
for instance in case of a `take(1)` in the chain. In that case values
emitted up until that point will have been stored into the List buffer,
so we can still put it in the cache. In case of error, no caching occurs
and the internal buffer is cleared. This implementation also protects
against competing onComplete/onError signals and cancel signals.

Closes gh-32370
2024-03-05 18:32:32 +01:00
Juergen Hoeller
6f7f032ced Merge branch '6.1.x' 2024-03-05 18:24:01 +01:00
Juergen Hoeller
a0ae849856 Polishing 2024-03-05 18:23:13 +01:00
Juergen Hoeller
7d4c8a403e Introduce configurable default rollback rules
Includes rollbackOn annotation attribute on @EnableTransactionManagement and addDefaultRollbackRule method on AnnotationTransactionAttributeSource, as well as publicMethodsOnly as instance-level flag (also on AnnotationCacheOperationSource).

Closes gh-23473
2024-03-05 18:08:08 +01:00
Juergen Hoeller
30e75e4a09 Enable efficient pointcut checks for composite sources as well
Closes gh-20072
2024-03-05 13:34:48 +01:00
ali dandach
1cb2dfa459 enh: use isEmpty() instead of length() 2024-03-04 23:55:33 +01:00
Juergen Hoeller
dc6c96de0a Merge branch '6.1.x'
# Conflicts:
#	spring-context-support/src/main/java/org/springframework/cache/jcache/interceptor/AbstractFallbackJCacheOperationSource.java
#	spring-context/src/main/java/org/springframework/cache/interceptor/AbstractFallbackCacheOperationSource.java
#	spring-tx/src/main/java/org/springframework/transaction/interceptor/AbstractFallbackTransactionAttributeSource.java
2024-03-04 22:50:22 +01:00