Commit Graph

3054 Commits

Author SHA1 Message Date
Juergen Hoeller 17d362fa85 Document limited concurrency with fixed-delay tasks on virtual threads
Closes gh-31900
2023-12-26 10:59:13 +01:00
Sébastien Deleuze 8bd8c4f627 Add support for `@Async` Kotlin function returning `Unit?`
Closes gh-31881
2023-12-22 15:33:34 +01:00
Juergen Hoeller 232225b2aa Polishing 2023-12-22 13:06:29 +01:00
Juergen Hoeller 44c652ec98 Introduce ProxiedInterfacesCache for JdkDynamicAopProxy
Closes gh-30499
2023-12-22 11:55:59 +01:00
rstoyanchev 459338f6fd Unwrap Optional in MethodValidationAdapter
See gh-31746
2023-12-21 17:55:49 +00:00
rstoyanchev f0add920f5 Adjust container types to which methodValidation
After the updates to MethodValidationAdapter in commit d7ce13 related
to method validation on element containers, we also need to adjust
the checks in HandlerMethod when method validation applies.

See gh-31746
2023-12-21 17:50:40 +00:00
Sam Brannen 3ed5a90b7c Fix assertions in ReactiveCachingTests 2023-12-21 17:30:56 +01:00
Juergen Hoeller b04803de99 Polishing 2023-12-21 17:20:29 +01:00
Juergen Hoeller f443cf965a Introduce NoOpTaskScheduler for test setups
Closes gh-28073
2023-12-21 17:20:24 +01:00
Juergen Hoeller 5f8a031c22 Introduce "spring.cache.reactivestreams.ignore" escape hatch
Closes gh-31861
2023-12-21 11:14:33 +01:00
Juergen Hoeller dc564f3ef2 Respect cache hit when empty Mono/Flux response is returned
Closes gh-31868
2023-12-20 22:52:51 +01:00
rstoyanchev d7ce13c763 Revert use of leafBean in MethodValidationAdapter
The goal for #31530 was to support bean validation on Set and other
method parameters that are containers of value(s) for which there is
a registered Jakarta Validation ValueExtractor.

Unfortunately, bean validation does not expose the unwrapped value
for a Path.Node, which we need for a method parameter in order to
create a BindingResult for the specific bean within the container,
and the leafBean that we tried to use is really the node at the
very bottom of the property path (i.e. not what we need).

This change removes the use of beanLeaf, restores the logic as it
was before, adds support for arrays, and a new test class for
scenarios with cascaded violations.

See gh-31746
2023-12-20 17:56:05 +00:00
Stéphane Nicoll 1bd523f6b6 Polish 2023-12-20 09:52:55 +01:00
Juergen Hoeller d4406507d0 Polishing 2023-12-14 00:12:22 +01:00
Juergen Hoeller a612518f96 Check startup/shutdown thread state for close bypass in shutdown hook
See gh-31811
2023-12-14 00:12:12 +01:00
rstoyanchev ec0ec7a0d6 Avoid nested constructor binding if there are no request parameters
Closes gh-31821
2023-12-13 18:06:16 +00:00
Sam Brannen 8d4deca2a6 Introduce test for XML replaced-method element without explicit arg-type
This commit introduces an integration test for the regression fixed in
the previous commit (cd64e6676c).

Closes gh-31826
2023-12-13 15:04:15 +01:00
Sam Brannen c0683cd30b Update copyright headers 2023-12-12 14:51:03 +01:00
Sam Brannen 1c58511cb2 Polishing 2023-12-12 14:51:03 +01:00
Juergen Hoeller 240a75f313 Polishing 2023-12-12 12:40:04 +01:00
Juergen Hoeller 6dcba4de2c Avoid double proxying for @Resource @Lazy fallback autowiring
Includes refactored @Resource resolver for AOT with lazy resolution support.

Closes gh-31447
See gh-29614
2023-12-12 12:39:59 +01:00
Juergen Hoeller 6bb9775309 Declare isStatic and releaseTarget as default methods on TargetSource
Closes gh-31820
2023-12-12 12:39:52 +01:00
Juergen Hoeller eae53560e4 Use ReentrantLock to skip intermediate close attempt from shutdown hook
See gh-31811
2023-12-12 12:39:45 +01:00
Juergen Hoeller 8c51315cd6 Avoid potential refresh deadlock with registerShutdownHook
Closes gh-31811
2023-12-11 21:35:58 +01:00
Stéphane Nicoll e2c2268c39 Add AOT support for @Resource
This commit adds ahead of time support for @Resource on fields and
methods. Lookup elements are discovered and code is generated to replace
that introspection at runtime.

Closes gh-29614
2023-12-11 11:04:13 +01:00
Juergen Hoeller b510bc3bab Reuse generated key for get+put within same cacheable operation
Closes gh-31789
2023-12-10 20:14:49 +01:00
Juergen Hoeller f29bfd9769 Polishing 2023-12-10 00:28:51 +01:00
Juergen Hoeller c57b7e8418 Introduce ClassFormatException and spring.classformat.ignore property
Closes gh-27691
2023-12-09 20:03:57 +01:00
juhyun b782747472 Remove unused code
See gh-31801
2023-12-09 16:40:23 +01:00
Stéphane Nicoll b78aed99ea Provide a dedicated exception if ScheduledExecutor is not configured
While it is not easily possible to create a ConcurrentTaskScheduler
with no scheduled executor, DefaultManagedTaskScheduler has a default
constructor that does that as the JNDI lookup happens in the regular
afterPropertiesSet callback. If such an instance is created manually,
it can throw an unhelpful NullPointerException if one attempts to
schedule a task.

This commit updates ConcurrentTaskScheduler to flag that the scheduled
executor could be `null` and check if that's the case before using it.
This now throws a dedicated exception that should hopefully provide
better context for those upgrading.

See gh-27914

Closes gh-31751
2023-12-08 15:06:55 +01:00
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 438c3818cc Replace System.getProperties().remove(x) with System.clearProperty(x)
This commit migrates to the not-so-new System.clearProperty() method
introduced in Java 1.5.
2023-12-06 17:11:46 +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
Yanming Zhou afcd03bddc Replace assertThat(x.isEmpty()).isTrue() with assertThat(x).isEmpty()
Search for   : assertThat\((.+).isEmpty\(\)\).isTrue\(\)
Replace with : assertThat($1).isEmpty()

Search for   : assertThat\((.+).isEmpty\(\)\).isFalse\(\)
Replace with : assertThat($1).isNotEmpty()

Closes gh-31758
2023-12-06 10:04:56 +01:00
Yanming Zhou 7b16ef90f1 Replace assertThat(x.equals(y)) with assertThat(x).isEqualTo(y)
Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isTrue\(\)
Replace with : assertThat($1).isEqualTo($2)

Search for   : assertThat\((.+)\.equals\((\w+)\)\)\.isFalse\(\)
Replace with : assertThat($1).isNotEqualTo($2)

Closes gh-31763
2023-12-06 09:50:15 +01:00
Yanming Zhou e2852e7355 Replace assertThat(x.contains(y)).isTrue() with assertThat(x).contains(y)
Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isTrue\(\)
Replace with : assertThat($1).contains($2)

Search for   : assertThat\((.+)\.contains\((.+)\)\)\.isFalse\(\)
Replace with : assertThat($1).doesNotContain($2)

Closes gh-31762
2023-12-06 09:48:49 +01:00
Yanming Zhou 1a63257b12 Add missing @Test
Closes gh-31761
2023-12-06 09:48:08 +01:00
Yanming Zhou 59815cefce Replace assertThat(x.get(i)). with assertThat(x).element(i).
Search for   : assertThat\((.+)\.get\((\d+)\)\)\.
Replace with : assertThat($1).element($2).

Closes gh-31759
2023-12-06 09:43:59 +01:00
Yanming Zhou 785ad399e9 Replace assertThat(x.iterator().next()) with assertThat(x).element(0)
Search for   : assertThat\((.+).iterator\(\).next\(\)\)
Replace with : assertThat($1).element(0)
2023-12-06 10:52:39 +08:00
Sam Brannen ceba4162bb Replace assertThat(!x).isTrue() with assertThat(x).isFalse()
Search for   : assertThat\(!(.+)\).isTrue\(\)

Replace with : assertThat(\1).isFalse()
2023-12-05 11:41:57 +01:00
Stéphane Nicoll 1da40b84e7 Polish "Use idiomatic AssertJ map assertions"
See gh-31752
2023-12-05 10:39:33 +01:00
Yanming Zhou 6f11716b6f Use idiomatic AssertJ map assertions
See gh-31752
2023-12-05 10:01:38 +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
Sébastien Deleuze 8ff687b68c Polish BeanDefinitionDsl.kt 2023-11-30 18:17:47 +01:00
Sébastien Deleuze bf1c179b7f Allow to set the order from Kotlin bean DSL
Closes gh-30849
2023-11-30 18:09:00 +01:00