Commit Graph

27807 Commits

Author SHA1 Message Date
Sam Brannen f054c2e804 Polishing 2023-08-27 19:29:21 +02:00
Sam Brannen 95453a4427 Merge branch '6.0.x' 2023-08-27 19:03:16 +02:00
Sam Brannen bbf73848b5 Update warning for use of convention-based annotation attribute overrides
See gh-28761
2023-08-27 19:02:57 +02:00
Sam Brannen 4e2d9252e5 Allow component name to be specified in @[Rest]ControllerAdvice
This commit builds on the recently added support for using @AliasFor to
override the `value` attribute in `@Component, and allows a custom
component name to be specified in both @ControllerAdvice and
@RestControllerAdvice via new `name` attributes.

See gh-31089
Closes gh-21108
2023-08-27 18:06:08 +02:00
Stephane Nicoll e239753a1b Merge branch '6.0.x' 2023-08-27 18:03:59 +02:00
Stephane Nicoll 1af259f928 Merge pull request #29753 from perlun
* pr/29753:
  Polish "Make sure NoUniqueBeanDefinitionException to be serializable"
  Make sure NoUniqueBeanDefinitionException to be serializable

Closes gh-29753
2023-08-27 18:03:44 +02:00
Stephane Nicoll 1396daa4b6 Polish "Make sure NoUniqueBeanDefinitionException to be serializable"
See gh-29753
2023-08-27 17:59:27 +02:00
Per Lundberg 1b409d5290 Make sure NoUniqueBeanDefinitionException to be serializable
See gh-29753
2023-08-27 17:56:58 +02:00
Sam Brannen ff104b6de0 Look up @Component stereotype names using @AliasFor semantics
Although gh-20615 introduced the use of @AliasFor for @Component(value) in the built-in
stereotype annotations (@Service, @Controller, @Repository, @Configuration, and
@RestController), prior to this commit the framework did not actually rely on @AliasFor
support when looking up a component name via stereotype annotations. Rather, the
framework had custom annotation parsing logic in
AnnotationBeanNameGenerator#determineBeanNameFromAnnotation() which effectively ignored
explicit annotation attribute overrides configured via @AliasFor.

This commit revises AnnotationBeanNameGenerator#determineBeanNameFromAnnotation() so that
it first looks up @Component stereotype names using @AliasFor semantics before falling
back to the "convention-based" component name lookup strategy.

Consequently, the name of the annotation attribute that is used to specify the bean name
is no longer required to be `value`, and custom stereotype annotations can now declare an
attribute with a different name (such as `name`) and annotate that attribute with
`@AliasFor(annotation = Component.class, attribute = "value")`.

Closes gh-31089
2023-08-27 17:17:52 +02:00
Sam Brannen d189e169cc Polish CompositePropertySource[Tests] 2023-08-27 14:08:39 +02:00
Stephane Nicoll 7c508a4cd3 Merge pull request #27670 from asgh
* pr/27670:
  Use Arrays.deepToString for toString in SimpleKey

Closes gh-27670
2023-08-26 18:14:35 +02:00
asgh 9d7bd9520c Use Arrays.deepToString for toString in SimpleKey
See gh-27670
2023-08-26 18:10:42 +02:00
Stephane Nicoll ce4a5b1f06 Merge pull request #27236 from Shawyeok
* pr/27236:
  Polish "Improve performance of CompositePropertySource#getPropertyNames"
  Improve performance of CompositePropertySource#getPropertyNames

Closes gh-27236
2023-08-26 17:49:32 +02:00
Stephane Nicoll 5c691960a2 Polish "Improve performance of CompositePropertySource#getPropertyNames"
See gh-27236
2023-08-26 17:46:19 +02:00
shawyeok b67a381fbe Improve performance of CompositePropertySource#getPropertyNames
Create LinkedHashSet with a initialCapacity, prevent under the hood
table resize cost in continuous add operations. Reduce bootstrap time
in the case of large properties.

See gh-27236
2023-08-26 17:46:19 +02:00
Sam Brannen e1826d2322 Reinstate support for @javax.annotation.ManagedBean & @javax.inject.Named
This commit reinstates support for the legacy JSR-250
@javax.annotation.ManagedBean and JSR-330 @javax.inject.Named
annotations with regard to component name lookups and component
scanning.

Closes gh-31090
2023-08-26 17:16:00 +02:00
Sam Brannen aaa0a2be63 Test status quo for @Components with multiple declared names 2023-08-26 17:15:47 +02:00
Sam Brannen 71ba7bc5e0 Polishing 2023-08-26 17:15:39 +02:00
Stephane Nicoll e18f1f5d9c Merge pull request #27154 from Li0n13
* pr/27154:
  Polish "Avoid calling executeBatch() with an empty batch"
  Avoid calling executeBatch() with an empty batch

Closes gh-27154
2023-08-26 17:09:39 +02:00
Stephane Nicoll f9cffcce05 Polish "Avoid calling executeBatch() with an empty batch"
See gh-27154
2023-08-26 17:05:39 +02:00
Li0n13 2d7bf83d8d Avoid calling executeBatch() with an empty batch
See gh-27154
2023-08-26 17:05:20 +02:00
Stephane Nicoll a6b0c75cae Merge branch '6.0.x' 2023-08-26 16:41:21 +02:00
Stephane Nicoll ca14202d78 Merge pull request #27115 from gnagy
* pr/27115:
  Update copyright of changed file
  Allow null attribute value in Model.set()

Closes gh-27115
2023-08-26 16:41:05 +02:00
Stephane Nicoll 7231f22c23 Update copyright of changed file
See gh-27115
2023-08-26 16:39:25 +02:00
Gergely Nagy 3470240ef0 Allow null attribute value in Model.set()
See gh-27115
2023-08-26 16:38:19 +02:00
Sam Brannen e0c3b1ae1d Merge branch '6.0.x' 2023-08-26 15:28:50 +02:00
Sam Brannen 7598bca799 Revise Checkstyle rules to prohibit use of assertions other than AssertJ
Closes gh-31116
2023-08-26 15:28:25 +02:00
Sam Brannen f9588de247 Reinstate FailingBeforeAndAfterMethodsTestNGTests
The tests were ignored due to "Fails against TestNG 6.11"; however,
these tests pass against the current version of TestNG that we build
against (7.8.0).
2023-08-26 15:22:38 +02:00
Sam Brannen dac481da43 Test CollectionUtils.unmodifiableMultiValueMap only once
No need to test that feature as a parameterized test.
2023-08-26 14:56:17 +02:00
Sam Brannen 31a07e6fbf User AssertJ assertions 2023-08-26 14:56:16 +02:00
Sam Brannen ef01a078d3 Polishing 2023-08-26 14:55:15 +02:00
Sam Brannen 44167ecea4 Polish BackOff support 2023-08-26 14:44:46 +02:00
Stephane Nicoll 962f4d20b4 Merge pull request #27071 from garyrussell
* pr/27071:
  Polish "Add maxAttempts to ExponentialBackOff"
  Add maxAttempts to ExponentialBackOff

Closes gh-27071
2023-08-26 12:55:10 +02:00
Stephane Nicoll 609580bfb9 Polish "Add maxAttempts to ExponentialBackOff"
See gh-27071
2023-08-26 12:54:24 +02:00
Gary Russell f6a09f3fad Add maxAttempts to ExponentialBackOff
If you wish to stop after a certain number of attempts with an
`ExponentialBackOff` you have to calculate the `maxElapsedTime`
corresponding to the number of attempts.

Add a new property to make it more convenient to stop after a
certain number of attempts.

See gh-27071
2023-08-26 12:45:32 +02:00
Stephane Nicoll 48878619d2 Merge branch '6.0.x' 2023-08-26 10:18:04 +02:00
Stephane Nicoll 2b3539a6de Merge pull request #26761 from 1zg12
* pr/26761:
  Polish "Restore customization of PropertyResolver"
  Restore customization of PropertyResolver

Closes gh-26761
2023-08-26 10:17:45 +02:00
Stephane Nicoll 2731d4f100 Polish "Restore customization of PropertyResolver"
See gh-26761
2023-08-26 10:17:02 +02:00
lwpro2 00fffb7ab0 Restore customization of PropertyResolver
This commit reintroduces the ability to customize the PropertyResolver
to use in PropertySourcesPropertyResolver

See gh-26761
2023-08-26 10:09:42 +02:00
Stephane Nicoll 16cb296b35 Merge pull request #27335 from marschall
* pr/27335:
  Optimize for single TransactionSynchronization

Closes gh-27335
2023-08-26 09:56:47 +02:00
Philippe Marschall fd18c00e50 Optimize for single TransactionSynchronization
Optimize TransactionSynchronizationManager.getSynchronizations() to
avoid sorting and ArrayList creation in case of a single
TransactionSynchronization.

See gh-27335
2023-08-26 09:52:17 +02:00
Sam Brannen e737e6d9ba Update copyright headers 2023-08-25 17:07:17 +02:00
Sam Brannen 78d8fac05b Polishing 2023-08-25 17:06:57 +02:00
Sam Brannen 3efbbc5994 Merge branch '6.0.x' 2023-08-25 16:56:52 +02:00
Sam Brannen 89b7a6bf47 Skip searching of nonexistent directory in PathMatchingResourcePatternResolver
Prior to this commit, when PathMatchingResourcePatternResolver
processed a `file:` pattern (for example, `file:/app-config/**`) for a
`rootPath` that did not exist in the filesystem, the resolver attempted
to search the directory and logged a WARNING message similar to the
following when it failed to do so.

Failed to search in directory [/app-config/] for files matching pattern
[**]: java.nio.file.NoSuchFileException: /app-config/

To avoid unnecessary attempts to search a nonexistent directory,
PathMatchingResourcePatternResolver now skips searching of a nonexistent
directory and preemptively logs an INFO message similar to the
following.

Skipping search for files matching pattern [**]: directory [/app-config]
does not exist

Closes gh-31111
2023-08-25 16:54:10 +02:00
Sam Brannen 19570338c9 Ensure doFindPathMatchingFileResources() returns a mutable Set
This commit ensures that PathMatchingResourcePatternResolver's
doFindPathMatchingFileResources() method returns a mutable Set in order
to comply with the documented contract.
2023-08-25 16:53:00 +02:00
Brian Clozel fe2ef2ea6e Upgrade Java versions in CI build 2023-08-25 16:25:24 +02:00
Brian Clozel 35fc2df948 Instrument RestClient for Observability
This commit instruments the new `RestClient` HTTP client for
observability. Since this client is sharing its HTTP infrastructure with
`RestTemplate` and operates on the same request/response types, this
instrumentation reuses the Observation convention and context.
This choice makes sense since one can build a new `RestClient` instance
using a `RestTemplate` instance, effectively reusing the underlying
configuration.

Closes gh-31114
2023-08-25 16:23:04 +02:00
Stephane Nicoll 22fd6df711 Merge pull request #26028 from hzmpay
* pr/26028:
  Update copyright header of changed file
  Use computeIfAbsent in SpelCompiler and AdvisedSupport

Closes gh-26028
2023-08-25 16:17:49 +02:00
Stephane Nicoll 8432f777aa Update copyright header of changed file
See gh-26028
2023-08-25 16:13:27 +02:00