Commit Graph

32536 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
Sam Brannen
18645022e9 Merge branch '6.2.x' 2025-03-31 12:13:23 +02:00
Sam Brannen
36d9357f94 Fix Kotlin compilation errors 2025-03-31 12:02:51 +02:00
Sébastien Deleuze
dcb9383ba1 Add a requiredExchange extension to RestClient
Closes gh-34692
2025-03-31 11:55:41 +02:00
Tobias Hänel
f8a3077da9 Fix typo in Bean Validation section of reference manual
This commit fixes a minor typo in  the "Java Bean Validation - Customizing
Validation Errors" section of the reference manual.

Closes gh-34686

Signed-off-by: Tobias Hänel <contact@tobias-haenel.de>
2025-03-31 11:55:30 +02:00
rstoyanchev
87fa9a5acb Polishing in GroupsMetadata
See gh-33992
2025-03-31 10:23:57 +01:00
Sébastien Deleuze
85bc6350ce Merge branch '6.2.x' 2025-03-31 11:16:01 +02:00
Sébastien Deleuze
d771d02119 Add a requiredExchange extension to RestClient
Closes gh-34692
2025-03-31 11:15:40 +02:00
rstoyanchev
302f04ecf3 Replace Map argument with GroupsMetadata
In preparation for HTTP Service registry AOT support.

See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev
1c0bcba587 Add HTTP Service registrar tests
Closes gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev
42409e21fa Lazy loading of HTTP Service classes
To help with AOT support, update AbstractHttpServiceRegistrar to store
HTTP Service types by name, and avoid loading classes during the bean
definition registration phase.

See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev
49e24b7dfa Add author tags to HTTP Service registry
See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev
9721cbad5c Further simplify GroupAdapter initialization
See gh-33992
2025-03-31 10:11:42 +01:00
Phillip Webb
39c4cc537d Apply HTTP Service group configurers in order
See gh-33992
2025-03-31 10:11:42 +01:00
Phillip Webb
7c3618de7c Fixup checkstyle violations
See gh-33992
2025-03-31 10:11:42 +01:00
rstoyanchev
92b0eb7f8b Add HTTP Service registry support
See gh-33992
2025-03-31 10:11:42 +01:00
Tobias Hänel
a63c5ad305 Fix typo in Bean Validation section of reference manual
This commit fixes a minor typo in  the "Java Bean Validation - Customizing
Validation Errors" section of the reference manual.

Closes gh-34686

Signed-off-by: Tobias Hänel <contact@tobias-haenel.de>
2025-03-30 20:28:12 +02:00
Sam Brannen
551f6c0c66 Polishing 2025-03-29 13:27:32 +01:00
Sam Brannen
9956cc11bb Merge branch '6.2.x' 2025-03-29 12:57:49 +01:00
Sam Brannen
9fd1d0c6a3 Polish Javadoc
This commit also reverts the change to ASM's SymbolTable class.

See gh-34679
2025-03-29 12:57:08 +01:00
Tran Ngoc Nhan
30fcaef813 Remove unnecessary closing curly brackets in Javadoc
Closes gh-34679

Signed-off-by: Tran Ngoc Nhan <ngocnhan.tran1996@gmail.com>
2025-03-29 12:37:48 +01:00
Sam Brannen
8379ac772a Introduce OptionalToObjectConverter
We have had an ObjectToOptionalConverter since Spring Framework 4.1;
however, prior to this commit we did not have a standard Converter for
the inverse (Optional to Object).

To address that, this commit introduces an OptionalToObjectConverter
that unwraps an Optional, using the ConversionService to convert the
object contained in the Optional (potentially null) to the target type.

This allows for conversions such as the following.

- Optional.empty()                             -> null
- Optional.of(42) with Integer target          -> 42
- Optional.of(42) with String target           -> "42"
- Optional.of(42) with Optional<String> target -> Optional.of("42")

The OptionalToObjectConverter is also registered by default in
DefaultConversionService, alongside the existing
ObjectToOptionalConverter.

See gh-20433
Closes gh-34544
2025-03-29 12:15:46 +01:00
Sam Brannen
b8c2780bfe Simplify SpEL ExpressionWithConversionTests 2025-03-29 12:15:46 +01: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
9bf01df230 Evaluate lenientLockingAllowed flag per DefaultListableBeanFactory instance
See gh-34303
2025-03-28 20:45:06 +01:00
Sam Brannen
51c084ffb6 Polishing 2025-03-28 14:54:43 +01:00
Yanming Zhou
5be83e9223 Stop calling deprecated JdbcOperations methods
Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-28 14:40:51 +01:00
Sam Brannen
e41487492d Merge branch '6.2.x' 2025-03-27 16:06:11 +01:00
Sam Brannen
8d2166139f Update SpringCoreTestSuite to include AOT 2025-03-27 16:04:51 +01:00
Sam Brannen
8edda5c768 Remove java24 classpath entries in Eclipse for the time being 2025-03-27 16:03:39 +01:00
Sam Brannen
2fa7b30831 Merge branch '6.2.x' 2025-03-27 15:32:42 +01:00
Sam Brannen
374c3b4545 Provide complete support for qualifier annotations with Bean Overrides
Prior to this commit, the Test Bean Override feature provided support
for overriding beans based on qualifier annotations in several
scenarios; however, qualifier annotations got lost if they were
declared on the return type of the @⁠Bean method for the bean being
overridden and the @⁠BeanOverride (such as @⁠MockitoBean) was based on
a supertype of that return type.

To address that, this commit sets the @⁠BeanOverride field as the
"qualified element" in the RootBeanDefinition to ensure that qualifier
annotations are available for subsequent autowiring candidate
resolution.

Closes gh-34646
2025-03-27 15:29:14 +01:00
Sam Brannen
d7e470d3e0 Polishing 2025-03-27 14:05:25 +01:00
Stéphane Nicoll
7ab108a321 Merge branch '6.2.x' 2025-03-27 12:12:54 +01:00
Stéphane Nicoll
2862c87601 Make sure the generated values are available from a static context
This commit updates the tests of property values code generated to
invoke the generated code from a `static` context. This ensures that
the test fails if that's not the case.

This commit also updated LinkedHashMap handling that did suffer from
that problem.

Closes gh-34659
2025-03-27 12:06:18 +01:00
Juergen Hoeller
f55ca3058b Merge branch '6.2.x'
# Conflicts:
#	spring-beans/src/main/java/org/springframework/beans/factory/support/DefaultListableBeanFactory.java
2025-03-26 23:49:54 +01:00
Juergen Hoeller
aa56b5001a Detect late-set primary markers for autowiring shortcut algorithm
Closes gh-34658
2025-03-26 23:47:42 +01:00
Sébastien Deleuze
7e9c33f50e Polishing
See gh-34555
2025-03-26 10:56:34 +01:00
Dmitry Sulman
00b88ec76f Propagate CoroutineContext to WebClient filter
This commit introduces a new ResponseSpec.awaitEntityOrNull() extension
function to replace ResponseSpec.toEntity(...).awaitFirstOrNull() and
pass the CoroutineContext to the CoExchangeFilterFunction.

CoroutineContext propagation is implemented via ReactorContext and
ClientRequest attribute.

Closes gh-34555
Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-26 10:54:53 +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
84430a8db2 Polishing 2025-03-25 17:09:24 +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
Juergen Hoeller
20736bd06f Introduce acknowledgeAfterListener flag for custom acknowledge handling
Closes gh-34635
2025-03-25 17:06:28 +01:00
Brian Clozel
fb423d66e3 Add ClassFile variant for class metadata reading
Prior to this commit, Spring Framework would use its own ASM fork to
read class/method/annotation metadata from bytecode. This is typically
used in configuration class parsing to build bean definitions without
actually loading classes at runtime at that step.

This commit adds support for a new metadata reading implementation that
uses the ClassFile API available as of Java 24. For now, this is turned
on by default for Java 24+.

Closes gh-33616
2025-03-25 15:33:53 +01:00
Brian Clozel
20b35f068a Add visibility and return type to SimpleMethodMetadata toString
Closes gh-34649
2025-03-25 15:32:42 +01:00
Juergen Hoeller
7d0cc6c83a Merge branch '6.2.x' 2025-03-25 00:11:30 +01:00
Juergen Hoeller
37fb79e8ff Fix qualifier resolution for aliased name against parent factory
Closes gh-34644
2025-03-25 00:08:42 +01:00
Sam Brannen
d1a1364231 Reinstate links to JUnit 5 Javadoc APIs
Now that we are using JDK 18+ (currently JDK 24 -- see JavaConventions
in buildSrc for details), we can reinstate links to JUnit 5 Javadoc APIs.

Closes gh-27497
2025-03-24 16:58:53 +01:00