Commit Graph

2031 Commits

Author SHA1 Message Date
Juergen Hoeller
0a71df7aee Polishing 2025-04-10 18:55:34 +02:00
Juergen Hoeller
2548d44f3b Include cause in MethodInvocationException message
Closes gh-34691

(cherry picked from commit 203ca30a64)
2025-04-01 22:28:39 +02:00
Juergen Hoeller
b73ca60811 Only attempt load for CGLIB classes in AOT mode
Closes gh-34677

(cherry picked from commit 743f32675d)
2025-03-31 17:23:46 +02:00
Stéphane Nicoll
b7654dd984 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-34661
2025-03-27 12:09:29 +01:00
Juergen Hoeller
564d3f6f5e Enable qualifier annotation tests including backported precedence tests
See gh-34644
2025-03-25 00:24:23 +01:00
Juergen Hoeller
19257f4fdb Add javadoc notes on potential exception suppression in getBeansOfType
Closes gh-34629

(cherry picked from commit dc41ff569e)
2025-03-21 16:02:01 +01:00
Juergen Hoeller
f06167ea01 Polishing 2025-03-21 11:06:10 +01:00
Sam Brannen
c333946b0b Restore property binding support for a Map that implements Iterable
The changes in commit c20a2e4763 introduced a regression with regard to
binding to a Map property when the Map also happens to implement
Iterable.

Although that is perhaps not a very common scenario, this commit
reorders the if-blocks in AbstractNestablePropertyAccessor's
getPropertyValue(PropertyTokenHolder) method so that a Map is
considered before an Iterable, thereby allowing an Iterable-Map to be
accessed as a Map.

See gh-907
Closes gh-34332

(cherry picked from commit b9e43d05bd)
2025-01-29 17:46:19 +01:00
Sam Brannen
faa000f330 Log alias removal in DefaultListableBeanFactory
Prior to this commit, information was logged when a bean definition
overrode an existing bean definition, but nothing was logged when the
registration of a bean definition resulted in the removal of an alias.

With this commit, an INFO message is now logged whenever an alias is
removed in DefaultListableBeanFactory.

Closes gh-34070

(cherry picked from commit 41d9f21ab9)
2024-12-11 15:05:42 +01:00
Johnny Lim
0beb56a58c Fix indentation to use tabs in Kotlin source files
Closes gh-33840
2024-11-05 10:24:02 +01:00
Juergen Hoeller
e90a2da05d Clarify defensive impact of allowEagerInit flag for type matching
Closes gh-33740
2024-10-21 15:38:25 +02:00
Sam Brannen
d72c8b32b7 Ignore duplicate @⁠Priority values when determining highest priority
Prior to this commit, DefaultListableBeanFactory's
determineHighestPriorityCandidate() method sometimes failed to
determine the highest priority candidate if duplicate priority
candidates were detected whose priority was not the highest priority in
the candidate set. In addition, the bean registration order affected
the outcome of the algorithm: if the highest priority was detected
before other duplicate priorities were detected, the algorithm
succeeded in determining the highest priority candidate.

This commit addresses those shortcomings by ignoring duplicate
@⁠Priority values unless the duplication is for the highest priority
encountered, in which case a NoUniqueBeanDefinitionException is still
thrown to signal that multiple beans were found with the same "highest
priority".

Closes gh-33733
2024-10-19 14:54:29 +02:00
Juergen Hoeller
fde7116ae4 Consistently skip processing of plain Java annotations
Closes gh-33580
2024-10-16 17:17:22 +02:00
Juergen Hoeller
11d4272ff4 Use Locale.ROOT consistently for toLower/toUpperCase
Closes gh-33708
2024-10-16 13:36:23 +02:00
Juergen Hoeller
feb6a5f52d Polishing 2024-10-16 11:35:23 +02:00
Juergen Hoeller
ca0448260f Convert DateTimeException to expected IllegalArgumentException
Closes gh-33545
2024-09-25 12:45:20 +02:00
Johnny Lim
b7c7823315 Add @⁠since tag for CodeWarnings.detectDeprecation(ResolvableType)
See gh-32850
Closes gh-33493
2024-09-05 17:45:52 +02:00
Sam Brannen
143736e59b Enforce order of Javadoc tags for records
Closes gh-33403
2024-08-18 13:01:43 +02:00
Juergen Hoeller
8be5010f5d LocaleEditor supports BCP 47 language tags as well
Closes gh-33348
2024-08-13 18:50:30 +02:00
Sam Brannen
bcffa15c7d Reinstate qualifier support for JSR-330 @⁠javax.inject.Named
This commit revises QualifierAnnotationAutowireCandidateResolver to
reinstate "qualifier" support for the legacy JSR-330
@⁠javax.inject.Named annotation.

See gh-31090
Closes gh-33345
2024-08-08 14:20:06 +03:00
Sam Brannen
f9d2641fd5 Update field name to reflect switch to Jakarta 2024-08-08 13:22:00 +03:00
Sam Brannen
3b506e11a1 Polishing 2024-08-08 13:22:00 +03:00
Stéphane Nicoll
850a0de1b0 Suppress deprecated warnings for autowiring
This commit extends our handling of deprecated with AOT to autowiring.

Closes gh-33295
2024-07-31 16:51:06 +02:00
Stéphane Nicoll
52849819de Detect deprecation on enclosing classes as well
This commit improves CodeWarnings so that it detects if an enclosing
class is deprecated. Previously, it would only consider the annotated
element itself and the enclosing element is important for a class as
it is required to refer to it.

Closes gh-33273
2024-07-25 16:28:40 +02:00
Juergen Hoeller
f2b3263fff Polishing 2024-07-10 15:56:56 +02:00
Juergen Hoeller
3ccaefe38f Polishing 2024-07-10 15:15:32 +02:00
Stéphane Nicoll
b5a86dec92 Retain previous factory method in case of nested invocation with AOT
This commit harmonizes the invocation of a bean supplier with what
SimpleInstantiationStrategy does. Previously, the current factory method
was set to `null` once the invocation completes. This did not take
into account recursive scenarios where an instance supplier triggers
another instance supplier.

For consistency, the thread local is removed now if we attempt to set
the current method to null. SimpleInstantiationStrategy itself uses
the shortcut to align the code as much as possible.

Closes gh-33180
2024-07-10 12:38:56 +02:00
Juergen Hoeller
daea3f0eae Apply fallback resolution for non-hierarchical URIs such as "file:."
Includes meaningful exception message for file system resolution.

Closes gh-33124
2024-07-03 16:36:18 +02:00
Juergen Hoeller
61adf2dd25 Formal null safety for exception message through String.valueOf
See gh-33117
2024-06-28 18:09:39 +02:00
Juergen Hoeller
61894af0bd Expose FactoryBean attribute exception as BeanDefinitionStoreException
Closes gh-33117
2024-06-28 17:55:45 +02:00
Juergen Hoeller
2861e570fd Catch and log LinkageError in getTypeForFactoryMethod
Closes gh-33075
2024-06-20 13:47:43 +02:00
Stéphane Nicoll
d0aa7ad524 Fix invalid character in Javadoc of BeanFactory 2024-06-13 14:06:19 +02:00
Sam Brannen
8feb842df5 Upgrade to AssertJ 3.26.0
See https://github.com/assertj/assertj/issues/3322
2024-05-27 16:43:22 +02:00
Juergen Hoeller
26d1c38d84 Polishing 2024-05-24 13:05:49 +02:00
Juergen Hoeller
345daaabbc Detect original generic method for CGLIB bridge method
Closes gh-32888
2024-05-24 11:49:10 +02:00
Stéphane Nicoll
f26483d272 Detect deprecated element in generic types
This commit updates Spring AOT to suppress a deprecation warning for
a generic type that has a deprecated element. Previously we only were
checking for the raw class.

Closes gh-32850
2024-05-21 08:53:18 +02:00
Stéphane Nicoll
5b1278d03c Refine exception message to include bean name
Closes gh-32775
2024-05-08 10:27:34 +02:00
Juergen Hoeller
25cedcfb99 Consistently propagate ApplicationStartup to BeanFactory
Closes gh-32747
2024-05-01 18:06:27 +02:00
Juergen Hoeller
cbda46984c Polishing 2024-04-30 15:46:28 +02:00
Juergen Hoeller
3cf2cd70ab Polishing 2024-04-29 18:02:44 +02:00
Juergen Hoeller
0ac04a7f86 Include original exception message in dependency initialization exception
Closes gh-32470
2024-04-29 18:02:39 +02:00
Juergen Hoeller
387e34d881 Wrap depends-on exception for specifically requested top-level bean
Closes gh-32470
2024-04-24 13:41:48 +02:00
Stéphane Nicoll
c99e7f8616 Ignore InstanceSupplier for getBean with arguments
Previously, a BeanDefinition that has an instance supplier would be
used irrespective of custom arguments being provided. This commit only
applies the instance supplier if no arguments are provided. With
custom arguments, the regular lookup takes place based on the
information provided in the bean factory.

Closes gh-32657
2024-04-22 16:59:31 +02:00
Stéphane Nicoll
8a8c8fe00e Detect target of factory method with AOT
Previously, if a factory method is defined on a parent, the generated
code would blindly use the method's declaring class for both the target
of the generated code, and the signature of the method.

This commit improves the resolution by considering the factory metadata
in the BeanDefinition.

Closes gh-32609
2024-04-22 15:13:56 +02:00
Juergen Hoeller
0e0397a385 Polishing 2024-04-18 12:18:18 +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
Juergen Hoeller
22328905da Do not extract FactoryBean generic in case of targetType mismatch
Closes gh-32489
2024-04-08 09:51:59 +02:00
Sébastien Deleuze
4a7c24d90f Refine null-safety
See gh-32475
2024-04-05 14:30:50 +02:00
Sébastien Deleuze
1b563f8ba4 Refine null-safety in more modules
This commit refines the null-safety in:
 - spring-jdbc
 - spring-r2dbc
 - spring-orm
 - spring-beans
 - spring-aop

See gh-32475
2024-03-26 09:46:34 +01:00
Juergen Hoeller
c531a8a705 Nullability refinements and related polishing
See gh-32475
2024-03-19 09:58:44 +01:00