Commit Graph

32657 Commits

Author SHA1 Message Date
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
Sam Brannen
02c7719eef Update Javadoc regarding convention-based annotation attribute overrides
This commit updates the Javadoc in various places to reflect the fact
that support for convention-based annotation attribute overrides has
been removed.

See gh-28761
2025-03-24 14:13:45 +01:00
Sam Brannen
d5bfd7ff8b Polishing 2025-03-24 14:13:45 +01:00
Sam Brannen
065692237c Document that @⁠AliasFor(attribute) is optional in override use cases
This commit documents that `attribute` is optional in @⁠AliasFor for
meta-annotation attribute overrides with the same name.

Closes gh-34641
2025-03-24 14:13:31 +01:00
Brian Clozel
603e559397 Update Java runtime in SDKMan! env file
See gh-34639
2025-03-24 10:17:08 +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
Sam Brannen
274a689a10 Revise RepeatableContainers API to better guide developers
Historically, the Spring Framework first had support for repeatable
annotations based on convention and later added explicit support for
Java 8's @⁠Repeatable facility. Consequently, the support for both
types of repeatable annotations has grown a bit intertwined over the
years. However, modern Java applications typically make use of
@⁠Repeatable, and convention-based repeatable annotations have become
more of a niche.

The RepeatableContainers API supports both types of repeatable
annotations with @⁠Repeatable support being the default. However,
RepeatableContainers.of() makes it very easy to enable support for
convention-based repeatable annotations while accidentally disabling
support for @⁠Repeatable, which can lead to subtle bugs – for example,
if convention-based annotations are combined with @⁠Repeatable
annotations. In addition, it is not readily clear how to combine
@⁠Repeatable support with convention-based repeatable annotations.

In light of the above, this commit revises the RepeatableContainers API
to better guide developers to use @⁠Repeatable support for almost all
use cases while still supporting convention-based repeatable
annotations for special use cases.

Specifically:

- RepeatableContainers.of() is now deprecated in favor of the new
  RepeatableContainers.explicitRepeatable() method.

- RepeatableContainers.and() is now deprecated in favor of the new
  RepeatableContainers.plus() method which declares the repeatable and
  container arguments in the same order as the rest of Spring
  Framework's repeated annotation APIs.

For example, instead of the following confusing mixture of
repeatable/container and container/repeatable:

RepeatableContainers.of(A.class, A.Container.class)
    .and(B.Container.class, B.class)

Developers are now be able to use:

RepeatableContainers.explicitRepeatable(A.class, A.Container.class)
    .plus(B.class, B.Container.class)

This commit also overhauls the Javadoc for RepeatableContainers and
explicitly points out that the following is the recommended approach to
support convention-based repeatable annotations while retaining support
for @⁠Repeatable.

RepeatableContainers.standardRepeatables()
    .plus(MyRepeatable1.class, MyContainer1.class)
    .plus(MyRepeatable2.class, MyContainer2.class)

See gh-20279
Closes gh-34637
2025-03-23 18:38:45 +01:00
Juergen Hoeller
7d5b3892c4 Add since 7.0 tags for stream methods
See gh-34623
2025-03-21 18:44:57 +01:00
Yanming Zhou
8819c749ce Introduce Stream variant methods for SqlQuery
Closes GH-34474

Signed-off-by: Yanming Zhou <zhouyanming@gmail.com>
2025-03-21 18:38:28 +01:00
Sam Brannen
b7a9bee020 Polishing 2025-03-21 17:43:26 +01:00
Juergen Hoeller
58246ec5ec Merge branch '6.2.x' 2025-03-21 15:54:43 +01:00
Juergen Hoeller
d8f8e76791 Check potentially more specific HibernateException cause as well
Closes gh-34633
2025-03-21 15:53:24 +01:00
Juergen Hoeller
dc41ff569e Add javadoc notes on potential exception suppression in getBeansOfType
Closes gh-34629
2025-03-21 15:52:42 +01:00
Sébastien Deleuze
07ae1853ff Upgrade to Kotlin 2.1.20
Closes gh-34632
2025-03-21 15:01:17 +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
3e788e4ca1 Consistent parameter declaration order 2025-03-21 11:31:43 +01:00
Juergen Hoeller
66c94bb4a2 Merge branch '6.2.x' 2025-03-21 11:06:59 +01:00
Juergen Hoeller
47651350f3 Polishing 2025-03-21 10:58:40 +01:00
Juergen Hoeller
0e1422820f JdbcClient holds ConversionService for queries with mapped classes
Closes gh-33467
2025-03-21 10:43:37 +01:00
rstoyanchev
a145f6205e Merge branch '6.2.x' 2025-03-21 09:05:58 +00:00
rstoyanchev
15c20c3e65 Fix regression with opaque URI determination
Before RfcUriParser we expected opaque URI's to not have ":/"
after the scheme while the new parser expect opaque URI's to
not have a slash anywhere after the scheme. This commit
restores the previous behavior.

Closes gh-34588
2025-03-21 09:05:41 +00:00
Juergen Hoeller
d710f73c47 Log public final method at warn level for non-interface case as well
Closes gh-33939
2025-03-21 09:40:52 +01:00
Sam Brannen
6505c4b839 Refine use of isArray() and componentType() 2025-03-20 17:28:37 +01:00
Sam Brannen
cc9b39b53f Extract AnnotatedElementAdapter to public type
This commit extracts AnnotatedElementAdapter from TypeDescriptor and
introduces it as a public, top-level type in the
org.springframework.core.annotation package, and
AnnotatedElementUtils.forAnnotations() now returns an instance of
AnnotatedElementAdapter instead of AnnotatedElementForAnnotations which
has been removed.

In addition, this commit adds missing Javadoc for
AnnotatedElementAdapter and refines some of the implementation.

Closes gh-34628
2025-03-20 16:20:47 +01:00
Sam Brannen
a376ef36e4 Merge branch '6.2.x' 2025-03-20 10:24:39 +01:00
Dmitry Sulman
5455c645f0 Update deprecated Gradle task creation
This commit replaces use of the deprecated Gradle `task` method with
the new `tasks.register` method.

Closes gh-34617

Signed-off-by: Dmitry Sulman <dmitry.sulman@gmail.com>
2025-03-20 10:22:55 +01:00
Brian Clozel
cacc63da20 Merge branch '6.2.x' 2025-03-19 18:19:12 +01:00
Brian Clozel
adb4b675fc Next development version (v6.2.6-SNAPSHOT) 2025-03-19 18:18:50 +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