Commit Graph

1515 Commits

Author SHA1 Message Date
Juergen Hoeller
0ff200b2f1 Trigger cancellation on context close for non-managed objects only
Specifically for prototype/scoped beans and FactoryBean-exposed objects.

Closes gh-33009
2024-06-12 13:31:00 +02:00
Juergen Hoeller
2451bd62b0 Polishing 2024-06-06 20:43:31 +02:00
Juergen Hoeller
624d6dd167 Expose actual result value for @CacheEvict condition
Closes gh-32960
2024-06-06 20:43:04 +02:00
Juergen Hoeller
cd33b4e35a Polishing 2024-05-21 18:25:57 +02:00
Juergen Hoeller
20dea0dae2 Polishing 2024-05-21 17:39:11 +02:00
Juergen Hoeller
fee17e11ba Default fallback parsing for UTC without milliseconds
Closes gh-32856
2024-05-21 17:39:06 +02:00
Juergen Hoeller
617833bec9 Defensively catch and log pointcut parsing exceptions
Closes gh-32838
See gh-32793
2024-05-17 12:27:59 +02:00
Juergen Hoeller
ec1f5ca600 Polishing 2024-04-22 13:43:07 +02:00
Juergen Hoeller
fec4f9b8cb Add test for pre-resolved target type on RootBeanDefinition
See gh-32649
2024-04-18 12:17:17 +02:00
Juergen Hoeller
f2889b1b43 Consistent support for generic FactoryBean type matching
Closes gh-32590
See gh-32489
2024-04-08 22:39:29 +02:00
Stéphane Nicoll
802967fc98 Add reproducer
See gh-32489
2024-04-08 11:09:56 +02:00
Stéphane Nicoll
c7c9da56da Consistent atMost period for Awaitility-based tests
Closes gh-32537
2024-03-26 17:45:14 +01:00
Juergen Hoeller
d2000efbd8 Polishing 2024-03-15 21:17:01 +01:00
Juergen Hoeller
c1287d48e2 Polishing 2024-03-08 19:31:01 +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
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
e9110c0729 Polishing 2024-03-04 22:48:52 +01:00
Juergen Hoeller
7ffeb59b40 Polishing 2024-02-21 22:45:39 +01:00
Juergen Hoeller
8d4953d8d6 Add test for cleanup after configuration class creation failure
See gh-23343
2024-02-21 22:45:32 +01:00
Juergen Hoeller
93f0ec2fa1 Polishing 2024-02-20 15:42:15 +01:00
Juergen Hoeller
7bb9e85723 Avoid trivial static import 2024-02-16 22:43:56 +01:00
Juergen Hoeller
3aae7a66e6 Polishing 2024-02-16 22:27:09 +01:00
Sam Brannen
db535863dd Consistently use class literals for primitive types
To improve consistency and avoid confusion regarding primitive types
and their wrapper types, this commit ensures that we always use class
literals for primitive types.

For example, instead of using the `Void.TYPE` constant, we now
consistently use `void.class`.
2024-01-30 15:26:12 +01:00
Juergen Hoeller
969b18b0e8 Polishing 2024-01-29 15:25:43 +01:00
Juergen Hoeller
a738e4d5fd Explicit documentation note on cron-vs-quartz parsing convention
Closes gh-32128
2024-01-29 13:02:43 +01:00
Sam Brannen
2e56361fe4 Simplify implementation of internal VariableNotAvailableException
Since VariableNotAvailableException is not a public type, there is no
need to store the variable name in a field/property.
2024-01-28 17:05:30 +01:00
Sam Brannen
0e45f4cec4 Polishing 2024-01-26 11:08:58 +01:00
Juergen Hoeller
c6121da151 Polishing 2024-01-24 22:30:33 +01:00
Juergen Hoeller
c5a75219ce Compare qualifier value arrays with equality semantics
Closes gh-32106
2024-01-24 22:30:28 +01:00
Juergen Hoeller
6bd7f0231d Avoid double exists() call for common resource resolution
See gh-30369
See gh-18990
2024-01-22 13:40:51 +01:00
Stéphane Nicoll
0c42965fc3 Polish 2024-01-15 11:17:19 +01:00
Juergen Hoeller
4d11307b84 Polishing 2024-01-09 11:55:04 +01:00
Sam Brannen
785598629a Make max length of SpEL expressions in an ApplicationContext configurable
This commit introduces support for a Spring property named
`spring.context.expression.maxLength`. When set, the value of that
property is used internally in StandardBeanExpressionResolver to
configure the SpelParserConfiguration used when evaluating String
values in bean definitions, @⁠Value, etc.

Closes gh-31952
2024-01-09 11:15:32 +01:00
Stéphane Nicoll
1f2d29ee08 Polish 2024-01-08 17:12:33 +01:00
rstoyanchev
8552e149b5 Improve method validation for container elements
This change moves container element properties from ParameterErrors
to base class ParameterValidationResult, and makes that support
independent of whether violations are nested within a container
element bean or through constraints on container elements, e.g.
`List<@NotBlank String>`.

Closes gh-31887
2024-01-05 16:32:14 +00:00
Sam Brannen
f6b36a689a Introduce processInjection() in CommonAnnotationBeanPostProcessor
To align with the existing processInjection() method in
AutowiredAnnotationBeanPostProcessor, this commit introduces an analogous
method in CommonAnnotationBeanPostProcessor.

Closes gh-31956
2024-01-05 16:05:07 +01:00
Sam Brannen
4b6126c057 Polishing 2024-01-05 15:17:51 +01:00
Juergen Hoeller
07097976ef Polishing 2024-01-05 10:08:57 +01:00
Juergen Hoeller
fb4fbeab50 Allow CronTrigger to resume from specified timestamp
Includes differentiation between lenient and fixed execution.
Includes default time zone resolution from scheduler-wide Clock.

Closes gh-19475
Closes gh-31948
2024-01-05 10:08:01 +01:00
Stéphane Nicoll
05ebca8677 Polish 2024-01-03 17:03:58 +01:00
Stéphane Nicoll
bf3a478990 Add support for functional registration of application listener
This commit adds a functional style registration of an application
listener for a particular event. Rather than introducing another method
at the ConfigurableApplicationContext interface level, this commit
provides a factory method in GenericApplicationListener.

Closes gh-21411
2024-01-03 13:38:08 +01:00
Sam Brannen
ffddbb586e Upgrade to AssertJ 3.25.0 2024-01-02 16:45:04 +01:00
Sam Brannen
a3c11fc033 Clean up warnings in tests in Gradle build 2024-01-02 16:44:52 +01:00
Brian Clozel
ec5f566ba5 Fix Scheduled observation convention for lambdas
Prior to this commit, the `DefaultScheduledTaskObservationConvention`
would fail as it tried to add a `KeyValue` to the observation context
that is `null`. This is rejected by the observation registry and should
be prevented. This happened when registered scheduled methods were
lambdas or part of anonymous classes. Those types do not have a
canonical name and return `null` as a value there.

This commit ensures that for these cases, the default convetion uses a
`"ANONYMOUS"` value as the `"code.namespace"` keyvalue.

Fixes gh-31918
2024-01-02 15:12:26 +01:00
Stéphane Nicoll
e22d1efdc0 Update copyright year of changed files
See gh-31930
2024-01-01 11:00:56 +01:00
Johnny Lim
ff8097d37c Polish
See gh-31930
2024-01-01 10:59:35 +01:00
Stéphane Nicoll
a6e87b40c7 Polish "Use diamond operator where feasible"
See gh-31916
2023-12-28 13:14:26 +01:00
Yanming Zhou
094479b55f Use diamond operator where feasible
See gh-31916
2023-12-28 13:08:08 +01:00
Yanming Zhou
db2c532c07 Use auto boxing and unboxing where feasible
See gh-31916
2023-12-28 13:01:44 +01:00
Yanming Zhou
4a450c6fab Use enhanced for loop where feasible
See gh-31916
2023-12-28 13:01:44 +01:00