Commit Graph

3524 Commits

Author SHA1 Message Date
Sam Brannen
b2af1af50f Merge branch '6.2.x' 2025-03-31 12:19:43 +02:00
Sam Brannen
044258f085 Support abstract @⁠Configuration classes without @⁠Bean methods again
Historically, @⁠Configuration classes that did not declare @⁠Bean
methods were allowed to be abstract. However, the changes made in
76a6b9ea79 introduced a regression that prevents such classes from
being abstract, resulting in a BeanInstantiationException. This change
in behavior is caused by the fact that such a @⁠Configuration class is
no longer replaced by a concrete subclass created dynamically by CGLIB.

This commit restores support for abstract @⁠Configuration classes
without @⁠Bean methods by modifying the "no enhancement required" check
in ConfigurationClassParser.

See gh-34486
Closes gh-34663
2025-03-31 12:18:55 +02:00
Juergen Hoeller
ac7c7ff5b2 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-03-28 20:47:57 +01:00
Juergen Hoeller
75e5a75da5 Enforce circular reference exception within non-managed thread
Closes gh-34672
2025-03-28 20:46:09 +01:00
Juergen Hoeller
3872c1a762 Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
#	spring-jms/src/main/java/org/springframework/jms/config/AbstractJmsListenerContainerFactory.java
#	spring-jms/src/main/java/org/springframework/jms/listener/AbstractMessageListenerContainer.java
2025-03-25 17:13:02 +01:00
Juergen Hoeller
6905dff660 Introduce spring.locking.strict=true flag for 6.1.x style bean creation locking
Closes gh-34303
2025-03-25 17:08:55 +01:00
Brian Clozel
20b35f068a Add visibility and return type to SimpleMethodMetadata toString
Closes gh-34649
2025-03-25 15:32:42 +01:00
Brian Clozel
b8b279d3e0 Use Java 24 to build Spring Framework
This commit also adapts tests for a Java 24 runtime.

Closes gh-34639
2025-03-24 09:51:19 +01:00
Sébastien Deleuze
5ce64f47b2 Add support for ImportAware in BeanRegistrar
Closes gh-34627
2025-03-21 11:49:15 +01:00
Sam Brannen
92ee20c896 Adhere to new Checkstyle rule 2025-03-19 16:29:03 +01:00
Sam Brannen
8db1340263 Merge branch '6.2.x' 2025-03-19 16:24:18 +01:00
Sam Brannen
208d52d852 Introduce Checkstyle rule for separator symbol location 2025-03-19 15:35:44 +01:00
Sébastien Deleuze
2bc213d703 Allow registering aliases with BeanRegistry
Closes gh-34599
2025-03-19 15:11:32 +01:00
Sam Brannen
84ba6b4b26 Add package to Javadoc link 2025-03-18 16:52:12 +01:00
Sam Brannen
37a135447c Rely on standard @Repeatable support in AnnotationJmxAttributeSource
This commit removes the use of RepeatableContainers.of() in
AnnotationJmxAttributeSource since that is unnecessary when using the
MergedAnnotations API with @⁠Repeatable annotations such as
@⁠ManagedOperationParameter and @⁠ManagedNotification.

Closes gh-34606
2025-03-15 16:56:56 +01:00
Sam Brannen
13efc2205b Test status quo for @⁠Repeatable annotation support in AnnotationJmxAttributeSource 2025-03-15 16:42:40 +01:00
Sam Brannen
6e1706a8a4 Polish [Annotation]JmxAttributeSource 2025-03-15 15:15:45 +01:00
Sébastien Deleuze
762831e742 Add BeanRegistrarDsl.register
See gh-34557
2025-03-12 12:34:04 +01:00
Juergen Hoeller
86b21d9b5c Add support for BeanRegistrar registration on GenericApplicationContext
Closes gh-34574
2025-03-11 21:18:20 +01:00
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