Commit Graph

3459 Commits

Author SHA1 Message Date
Sébastien Deleuze
e9701a9ce3 Remove support for Aware interfaces in BeanRegistrar
Closes gh-34562
2025-03-10 12:14:11 +01:00
Phillip Webb
789791e186 Allow chained BeanRegistry registration
Add a `register(BeanRegistry registry)` method to `BeanRegistry`
to allow registration chaining.

See gh-34557
2025-03-10 10:38:50 +01:00
Sébastien Deleuze
a0e2d3a221 Add support for target type to BeanRegistry
Closes gh-34560
2025-03-10 10:14:28 +01:00
Sam Brannen
80df88bd4f Clean up warnings in Gradle build 2025-03-07 16:58:52 +01:00
Sébastien Deleuze
fda9b9a696 Polishing
See gh-18353
2025-03-07 09:00:06 +01:00
Sébastien Deleuze
682e2d6d84 Introduce BeanRegistrarDsl
This commit introduces a new BeanRegistrarDsl that supersedes
BeanDefinitionDsl which is now deprecated.

See BeanRegistrarDslConfigurationTests for a concrete example.

See gh-18353
2025-03-06 19:15:56 +01:00
Sébastien Deleuze
496be9ca98 Introduce first-class support for programmatic bean registration
This commit introduces a new BeanRegistrar interface that can be
implemented to register beans programmatically in a concise and
flexible way.

Those bean registrar implementations are typically imported with
an `@Import` annotation on `@Configuration` classes.

See BeanRegistrarConfigurationTests for a concrete example.

See gh-18353
2025-03-06 19:14:03 +01:00
Sébastien Deleuze
7bc712e304 Upgrade NullAway to 0.12.4
This commit also slightly refines nullness but without
significant user-side impact expected.

Closes gh-34525
2025-03-03 08:45:54 +01:00
Juergen Hoeller
533ecf0244 Merge branch '6.2.x' 2025-03-01 22:21:39 +01:00
Juergen Hoeller
d2733cea36 Notify lenientCreationFinished condition after locked creation as well
Closes gh-34522
2025-03-01 22:20:23 +01:00
Brian Clozel
72afd4b9bd Merge branch '6.2.x' 2025-02-27 18:58:16 +01:00
Ryan Prayogo
aae2952a32 Replace DefaultKeyGenerator with SimpleKeyGenerator
DefaultKeyGenerator has been deprecated and replaced with SimpleKeyGenerator

Signed-off-by: Ryan Prayogo <57620+ryanprayogo@users.noreply.github.com>
2025-02-27 18:53:10 +01:00
Sam Brannen
5f98db6ffe Use new features introduced in JUnit Jupiter 5.11 and 5.12
See gh-34416
2025-02-26 15:18:16 +01:00
Juergen Hoeller
dc580740c0 Merge branch '6.2.x' 2025-02-25 16:21:09 +01:00
Juergen Hoeller
aff9ac72ec Avoid unnecessary CGLIB processing on configuration classes
Closes gh-34486
2025-02-25 16:20:12 +01:00
Brian Clozel
466ac6b703 Improve SimpleKey hashing function
Prior to this commit, `SimpleKey` would be used in Spring Framework's
caching support and its `hashCode` value would be used to efficiently
store this key in data structures.

While the current hashcode strategy works, the resulting values don't
spread well enough when input keys are sequential (which is often the
case). This can have negative performance impacts, depending on the
data structures used by the cache implementation.

This commit improves the `hashCode` function with a mixer to better
spread the hash values. This is using the mixer function from the
MurMur3 hash algorithm.

Closes gh-34483
2025-02-25 16:09:01 +01:00
Juergen Hoeller
63f6c33db6 Merge branch '6.2.x' 2025-02-18 20:45:34 +01:00
Juergen Hoeller
6786e1c3e5 Apply fallback in case of initial SmartClassLoader mismatch as well
See gh-34423
2025-02-18 20:40:13 +01:00
Juergen Hoeller
48aa94be46 Merge branch '6.2.x' 2025-02-18 15:18:01 +01:00
Juergen Hoeller
93134fd4d1 Apply fallback in case of any exception coming out of createClass
Closes gh-34423
2025-02-18 15:16:25 +01:00
Juergen Hoeller
2e4fbd1ff3 Merge branch '6.2.x' 2025-02-18 13:14:38 +01:00
Juergen Hoeller
d0ceefedc6 Mark XML-configured executor/scheduler as infrastructure bean
Closes gh-34015
2025-02-18 13:13:34 +01:00
Juergen Hoeller
9bc7229a1c Merge branch '6.2.x' 2025-02-12 23:07:37 +01:00
Juergen Hoeller
dfc10c1a8d Wait for lenient bean creation in non-locked threads as well
Closes gh-34349
2025-02-12 23:06:22 +01:00
Sam Brannen
f42e886f03 Polishing 2025-02-12 17:10:22 +01:00
Sam Brannen
de4db3812a Merge branch '6.2.x' 2025-02-12 16:46:58 +01:00
Sam Brannen
440a259b71 Clean up warnings in Gradle build 2025-02-12 16:46:41 +01:00
Juergen Hoeller
b07ff1c2d4 Merge branch '6.2.x' 2025-02-12 12:17:54 +01:00
Juergen Hoeller
b336bbe539 Wait for lenient bean creation in locked thread when necessary
Closes gh-34349
2025-02-12 12:17:02 +01:00
Juergen Hoeller
39bd530461 Consistently use @Nullable annotation from JSpecify 2025-02-11 22:16:13 +01:00
Juergen Hoeller
dce3f71b7d Merge branch '6.2.x'
# Conflicts:
#	framework-platform/framework-platform.gradle
2025-02-11 22:11:45 +01:00
Juergen Hoeller
f53da04717 Align with SmartClassLoader handling for AOP proxy classes
Closes gh-34274
2025-02-11 22:10:02 +01:00
rstoyanchev
bae12e739d Merge branch '6.2.x' 2025-02-11 11:18:23 +00:00
rstoyanchev
9f55296049 Nested list/map/array with constructor binding
Closes gh-34305
2025-02-11 11:11:05 +00:00
rstoyanchev
4591a67641 Handle [] leniently in constructor binding
See gh-34305
2025-02-11 11:11:05 +00:00
Sam Brannen
7557967f9e Stop using explicitly aliased value attribute as @⁠Component name
Prior to this commit, if a custom stereotype annotation was
meta-annotated with @⁠Component and declared a local String `value`
attribute that was explicitly configured (via @⁠AliasFor) as an
override for an attribute other than @⁠Component.value, the local
`value` attribute was still used as a convention-based override for
@⁠Component.value.

Consequently, a local `value` attribute was used as a custom
@⁠Component name, even when that is clearly not the intent.

To address that, this commit revises the logic in
AnnotationBeanNameGenerator so that a `value` attribute which is
explicitly aliased to something other than @⁠Component.value is no
longer used as an explicit @⁠Component name.

See gh-34317
Closes gh-34346
2025-02-10 18:21:29 +01:00
Sam Brannen
b78d371746 Merge branch '6.2.x' 2025-02-10 13:30:30 +01:00
Sam Brannen
17a94fb110 Improve warning for unexpected use of value attribute as @⁠Component name
Prior to this commit, if a String 'value' attribute of an annotation
was annotated with @⁠AliasFor and explicitly configured to alias an
attribute other than @⁠Component.value, the value was still used as the
@⁠Component name, but the warning message that was logged stated that
the 'value' attribute should be annotated with
@⁠AliasFor(annotation=Component.class). However, it is not possible to
annotate an annotation attribute twice with @⁠AliasFor.

To address that, this commit revises the logic in
AnnotationBeanNameGenerator so that it issues a log message similar to
the following in such scenarios.

WARN o.s.c.a.AnnotationBeanNameGenerator - Although the 'value'
attribute in @⁠example.MyStereotype declares @⁠AliasFor for an
attribute other than @⁠Component's 'value' attribute, the value is
still used as the @⁠Component name based on convention. As of Spring
Framework 7.0, such a 'value' attribute will no longer be used as the
@⁠Component name.

See gh-34346
Closes gh-34317
2025-02-10 13:29:40 +01:00
Sam Brannen
2fcae65853 Polishing 2025-02-10 13:29:33 +01:00
Sam Brannen
bb7a8006c5 Fix @⁠Nullable declaration in DataBinder on 6.2.x 2025-02-07 18:33:03 +01:00
Brian Clozel
0c739016d4 Merge branch '6.2.x' 2025-02-06 18:33:42 +01:00
Brian Clozel
174d0e4576 Fix "Nth day of week" Quartz-style cron expressions
Prior to this commit, `CronExpression` would support Quartz-style
expressions with "Nth occurence of a  dayOfWeek" semantics by using the
`TemporalAdjusters.dayOfWeekInMonth` JDK support. This method will
return the Nth occurence starting with the month of the given temporal,
but in some cases will overflow to the next or previous month.
This behavior is not expected for our cron expression support.

This commit ensures that when an overflow happens (meaning, the
resulting date is not in the same month as the input temporal), we
should instead have another attempt at finding a valid month for this
expression.

Fixes gh-34360
2025-02-06 18:27:07 +01:00
rstoyanchev
03984bacf4 Merge branch '6.2.x' 2025-02-05 14:34:11 +00:00
rstoyanchev
462c2bd538 Enhance constructor binding for List/Map/Array
Support List/Map/Array of simple values, or values supported
by type conversion.

Closes gh-34305
2025-02-05 14:26:12 +00:00
rstoyanchev
7f29f0e663 Revert commit 3505c4bcad
The fix did not address the issue. It only made the constructor not
fail with tests succeeding due to setter binding instead.

See gh-34043
2025-02-05 14:26:12 +00:00
Sam Brannen
e997e16cd1 Merge branch '6.2.x' 2025-02-05 13:43:46 +01:00
Sam Brannen
819a7c86c1 Clarify component scanning of abstract classes with @⁠Lookup methods
Due to changes in gh-19118, classes that contain @⁠Lookup methods are
no longer required to be concrete classes for use with component
scanning; however, the reference documentation still states that such
classes must not be abstract.

This commit therefore removes the outdated reference documentation and
updates the corresponding Javadoc.

See gh-19118
Closes gh-34367
2025-02-05 13:39:29 +01:00
Juergen Hoeller
088d53adb4 Merge branch '6.2.x' 2025-02-03 15:24:59 +01:00
Juergen Hoeller
1b18928bf0 Explicitly set custom ClassLoader on CGLIB Enhancer
Closes gh-34274
2025-02-03 15:23:51 +01:00
Juergen Hoeller
121be15004 Merge branch '6.2.x' 2025-01-31 15:17:44 +01:00