Commit Graph

2186 Commits

Author SHA1 Message Date
Sam Brannen
7a221eb581 Update Javadoc for @⁠ComponentScan regarding local overrides
See gh-31704
2023-12-06 18:00:37 +01:00
Sam Brannen
2e5d1daeff Polishing 2023-12-06 17:59:40 +01:00
Sam Brannen
6b53f37030 Favor local @⁠ComponentScan annotations over meta-annotations
Work performed in conjunction with gh-30941 resulted in a regression.
Specifically, prior to Spring Framework 6.1 a locally declared
@⁠ComponentScan annotation took precedence over @⁠ComponentScan
meta-annotations, which allowed "local" configuration to override
"meta-present" configuration.

This commit modifies the @⁠ComponentScan search algorithm so that
locally declared @⁠ComponentScan annotations are once again favored
over @⁠ComponentScan meta-annotations (and, indirectly, composed
annotations).

See gh-30941 Closes gh-31704
2023-12-06 11:40:25 +01:00
Juergen Hoeller
8a82da43c9 Defensively wrap fixed-delay task on scheduler thread
Closes gh-31749
2023-12-04 18:20:44 +01:00
Sam Brannen
d71853f105 Polish contribution
See gh-31531
2023-12-04 16:47:25 +01:00
Yanming Zhou
490b5c77fc Use switch expression where feasible 2023-12-04 15:42:55 +01:00
rstoyanchev
d59b2924d3 Exclude any Java library type from nested constructor binding
Closes gh-31709
2023-12-01 17:04:49 +00:00
Sam Brannen
6ea9fdbf77 Polishing 2023-11-30 19:04:59 +01:00
Sam Brannen
33af98b6d6 Document need for -parameters flag in cache key generation exception messages
Closes gh-31675
2023-11-30 17:51:54 +01:00
rstoyanchev
9ade52dbe2 Exclude Part and MultipartFile from nested constructor binding
Closes gh-31669
2023-11-30 13:10:17 +00:00
Juergen Hoeller
4a6c3e8f5d Fix reactive retrieval of cached null value for empty Mono
Closes gh-31722
2023-11-30 12:05:16 +01:00
Stéphane Nicoll
c8e6315a67 Polish 2023-11-29 10:08:20 +01:00
Stéphane Nicoll
61be452402 Quote name attribute if necessary
This commit updates MetadataNamingStrategy to quote an ObjectName
attribute value if necessary. For now, only the name attribute is
handled as it is usually a bean name, and we have no control over
its structure.

Closes gh-23608
2023-11-28 17:05:06 +01:00
Juergen Hoeller
824bc09d11 Actual caching of null values in retrieve(key, valueLoader)
See gh-31637
2023-11-22 15:56:26 +01:00
Juergen Hoeller
e64b81eec4 Revised handling of allowNullValues for asynchronous retrieval
Includes revised cacheNames javadoc and equals/hashCode for SimpleValueWrapper.

See gh-31637
2023-11-22 12:22:13 +01:00
Juergen Hoeller
5a3ad6b7c9 Late key generation for consistent evaluation of unless expressions
Includes removal of evict step on pipeline exception, retaining a previous cache value and avoiding an incomplete key (for consistency with non-reactive caching).

Closes gh-31626
2023-11-22 00:27:32 +01:00
Juergen Hoeller
1410c466b7 Support for late-determined cache misses from retrieve(key)
Closes gh-31637
2023-11-21 23:11:34 +01:00
Juergen Hoeller
695559879e Restore outdated local/remote-slsb attributes for declaration compatibility
Legacy EJB attributes are ignored since 6.0 due to being bound to a plain JndiObjectFactoryBean - but can still be declared now, e.g. when validating against the common versions of spring-jee.xsd out there.

Closes gh-31627
2023-11-20 21:01:36 +01:00
Stéphane Nicoll
ec905cb073 Share internal StandardExecutionContext delegates
This commit makes sure that the per-operation execution context for
caching and event listening does not recreate the default internal
delegates, but rather get initialized with a shared state.

This reduces the number of instances created per operation execution,
reducing the GC pressure as a result. This also makes sure that any
cache, such as the one in StandardTypeLocator, is reused.

Closes gh-31617
2023-11-19 17:18:42 +01:00
Sébastien Deleuze
eb3982b6c2 Property-driven onRefresh exit for AppCDS purpose
This commit allows to terminate the JVM when the
-Dspring.context.exit=onRefresh property is set,
which can be useful for AppCDS training run in order
to get most of the AppCDS cache without starting the
beans.

Closes gh-31595
2023-11-13 15:53:57 +01:00
Juergen Hoeller
9414c2ddba Coordinated stop before destroy when ExecutorService not terminated yet
Closes gh-31549
2023-11-09 10:22:27 +01:00
rstoyanchev
4da2440f63 Polishing
Closes gh-31530
2023-11-02 11:32:03 +00:00
Seth Kuipers
9bbe3aa52a Expand support for adapting container type violations
See gh-31530
2023-11-02 11:32:03 +00:00
Johnny Lim
2b750926c3 Polishing
Closes gh-31522
2023-10-30 15:05:20 +01:00
rstoyanchev
aa4f09d080 Refine decision to create object for constructor injection
Closes gh-31488
2023-10-25 13:22:25 +01:00
Sam Brannen
d7e6b79336 Log and skip resource hint registration for classpath location patterns
Since we do not yet have support for registering resource hints for
classpath location patterns, we have decided to explicitly skip such
resources and log a warning to inform users that they need to manually
supply resource hints for the exact resources needed by their
application.

This commit applies this change for @⁠PropertySource and
@⁠TestPropertySource.

See gh-31162
Closes gh-31429
2023-10-25 12:42:36 +02:00
Stéphane Nicoll
6585f1a208 Merge branch '6.0.x' 2023-10-25 11:23:45 +02:00
Stéphane Nicoll
84c28995fb Improve documentation for the default profile
Closes gh-29071
2023-10-25 11:20:21 +02:00
Stéphane Nicoll
d23263619a Improve exception message when configuration class parsing fails
This commit improves the exception that is thrown when a particular
source class cannot be parsed. Previously, the message would include
the root configuration class, which may not be the class that
actually failed as parsing can trigger component scan. There's now
a dedicated catch that generates an exception message that includes the
class that is currently parsed.

Closes gh-31146
2023-10-24 18:31:25 +02:00
Sam Brannen
a33791e2b8 Fix typo 2023-10-24 16:44:58 +02:00
Stéphane Nicoll
322013a30a Clarify the semantic of lite mode
This commit removes the "plain old class" bit of the documentation as
it may be confusing. The gist of it is that it must be a bean but not
annotated with `@Configuration` so the updated sentence states exactly
that.

Closes gh-29957
2023-10-24 16:00:48 +02:00
Juergen Hoeller
cf3a25bfac Merge branch '6.0.x' 2023-10-23 17:34:45 +02:00
Juergen Hoeller
6bdf7ad36a Polishing 2023-10-23 17:32:45 +02:00
Juergen Hoeller
8457c768e8 Polishing 2023-10-23 16:56:40 +02:00
Sam Brannen
2d792f000a Polish "Apply SingleSpaceSeparator Checkstyle module"
See gh-31469
2023-10-22 14:18:18 +02:00
Johnny Lim
64e9fcad53 Apply SingleSpaceSeparator Checkstyle module
This commit also fixes its violations.

Closes gh-31469
2023-10-22 14:09:57 +02:00
Sébastien Deleuze
c1437f9817 Refine CRaC restoration logs
Closes gh-31462
2023-10-20 11:40:44 +02:00
Stéphane Nicoll
9af239c8be Clean resources in case of unexpected exception
This commit updates AbstractApplicationContext#refresh to handle any
exceptions, not only BeansExceptions.

Closes gh-28878
2023-10-18 10:42:28 +02:00
Johnny Lim
919faa2ce2 Order modifiers to align with JLS
This commit also applies Checkstyle ModifierOrder to enforce it.

See gh-31368
2023-10-17 16:13:56 +02:00
Stéphane Nicoll
6efc99fdd8 Harmonize BeanRegistrationAotContribution class names 2023-10-17 12:37:52 +02:00
Sébastien Deleuze
22db1ac146 Add Coroutines support for @EventListener
Closes gh-28343
2023-10-17 12:11:44 +02:00
Sam Brannen
32b4f55d92 Update copyright headers 2023-10-16 16:19:55 +02:00
Sébastien Deleuze
466c8d8f23 Add Coroutines support for @Cacheable
This commit adds Coroutines support for `@Cacheable`.

It also refines SimpleKeyGenerator to ignore Continuation
parameters (Kotlin does not allow to have the same method
signature with both suspending and non-suspending variants)
and refines
org.springframework.aop.framework.CoroutinesUtils.awaitSingleOrNull
in order to wrap plain value to Mono.

Closes gh-31412
2023-10-15 19:25:59 +02:00
Juergen Hoeller
7bee1fdb71 Polishing 2023-10-15 16:04:30 +02:00
Stéphane Nicoll
85388aa642 Add AOT support for generic constructor argument values
This commit improves compatibility with the core container when running
in AOT mode by adding support for generic constructor argument values.

Previously, these were ignored altogether. We now have code generation
support for them as well as resolution that is similar to what
AbstractAutowiredCapableBeanFactory does in a regular runtime.

This commit also improves AOT support for XML bean configurations by
adding more support for TypedStringValue and inner bean definitions.

Closes gh-31420
2023-10-13 15:33:32 +02:00
Stephane Nicoll
37c2619fc4 Add AOT support for TypedStringValue
This commit adds support for TypeStringValue when generating AOT code.
If the value does not specify an explicit type, it's specified as is.
Otherwise, the TypeStringValue instance is restored via the appropriate
code generation.

Closes gh-29074
2023-10-12 14:11:53 +02:00
Juergen Hoeller
38de3d5b57 Merge branch '6.0.x'
# Conflicts:
#	build.gradle
#	framework-platform/framework-platform.gradle
#	spring-context/src/main/java/org/springframework/context/support/AbstractApplicationContext.java
2023-10-11 00:19:54 +02:00
Juergen Hoeller
0b96da4b6d Revise javadoc for LifecycleProcessor bean etc 2023-10-10 23:36:08 +02:00
Juergen Hoeller
2754da1742 Reset ApplicationEventMulticaster/MessageSource/LifecycleProcessor on close
Closes gh-21988
Closes gh-31397
2023-10-10 18:10:52 +02:00
Alexander Kriegisch
20c688e68d Avoid duplicate application listeners (proxy vs. proxy target)
In AbstractApplicationEventMulticaster.retrieveApplicationListeners,
despite best efforts to avoid it, unwrapped proxies (singleton targets)
can end up in the list of programmatically registered listeners. In
order to avoid duplicates, we need to find and replace them by their
proxy counterparts, because if both a proxy and its target end up in
'allListeners', listeners will fire twice.

Fixes #28283.
2023-10-10 17:01:00 +02:00