Commit Graph

32779 Commits

Author SHA1 Message Date
Sam Brannen
32e2c453b0 Merge branch '6.2.x' 2025-05-10 15:21:39 +02:00
Sam Brannen
3295289e17 Fix placeholder resolution in PropertySourcesPlaceholderConfigurer
Currently, the placeholder resolution algorithm in
PropertySourcesPlaceholderConfigurer fails in several scenarios, and
the root cause for this category of failures has actually existed since
PropertySourcesPlaceholderConfigurer was introduced in Spring Framework
3.1.

Specifically, PropertySourcesPlaceholderConfigurer creates its own
PropertySourcesPropertyResolver that indirectly delegates to another
"nested" PropertySourcesPropertyResolver to interact with
PropertySources from the Environment, which results in double
placeholder parsing and resolution attempts, and that behavior leads to
a whole category of bugs.

For example, #27947 was addressed in Spring Framework 5.3.16, and due
to #34315 and #34326 we have recently realized that additional bugs
exist with placeholder resolution: nested placeholder resolution can
fail when escape characters are used, and it is currently impossible
to disable the escape character support for nested resolution.

To address this category of bugs, we no longer indirectly use or
directly create a "nested" PropertySourcesPropertyResolver in
PropertySourcesPlaceholderConfigurer. Instead, properties from property
sources from the Environment are now accessed directly without
duplicate/nested placeholder resolution.

See gh-27947
See gh-34326
See gh-34862
Closes gh-34861
2025-05-10 15:14:50 +02:00
Sam Brannen
2018d933ac Merge branch '6.2.x' 2025-05-10 15:11:44 +02:00
Sam Brannen
457e876303 Polish reference manual regarding placeholders 2025-05-10 15:10:29 +02:00
Sam Brannen
3fb9c2b507 Merge branch '6.2.x' 2025-05-10 14:21:41 +02:00
Sam Brannen
021bf6e77d Add more tests for escape character support in PlaceholderParser 2025-05-10 14:19:41 +02:00
Sam Brannen
90453643cc Simplify and revise PlaceholderParserTests for consistency 2025-05-10 14:16:49 +02:00
Sam Brannen
5fbfdbc91c Merge branch '6.2.x' 2025-05-09 16:44:21 +02:00
Sam Brannen
5a2cbc1ab3 Polish PropertySourcesPropertyResolverTests 2025-05-09 16:43:04 +02:00
Sam Brannen
348b4cd067 Polish contribution
See gh-34720
2025-05-09 16:32:13 +02:00
Fawzi Essam
9b52cfd7d5 Test escape character support in PropertySourcesPropertyResolver
See gh-34326
See gh-34720
See gh-34861

Signed-off-by: Fawzi Essam <iifawzie@gmail.com>
2025-05-09 16:31:27 +02:00
Sam Brannen
4f38c5bdfa Merge branch '6.2.x' 2025-05-09 14:32:13 +02:00
Sam Brannen
dd6eede243 Properly expand reused collection parameters in R2DBC NamedParameterUtils
Prior to this commit, NamedParameterUtils in spring-r2dbc did not
properly expand reused collection parameters. Specifically, values in a
supplied collection were only expanded in the resulting query once, for
the first occurrence of the named parameter.

To address that, this commit effectively reinstates the original logic
for ExpandedQuery from NamedParameterUtils in the Spring Data R2DBC
project.

94958f5eb6/spring-data-r2dbc/src/main/java/org/springframework/data/r2dbc/core/NamedParameterUtils.java (L486)

Closes gh-34768
2025-05-09 14:27:19 +02:00
Sam Brannen
de97e35189 Polish Javadoc and internals of R2DBC support 2025-05-09 14:04:10 +02:00
Phillip Webb
13b09e6f3c Ensure only immediate member classes are only included
Update `ClassFileClassMetadata` so that member classes only include
immediate children. This aligns with the other `ClassMetadata`
implementations.

Closes gh-34869
2025-05-09 09:43:58 +02:00
Phillip Webb
ead80ce2f5 Return null for getSuperClassName() with package-info classes
Update `ClassFileClassMetadata` to align the behavior of
`getSuperClassName()` with other readers in that it returns
`null` for `package-info` classes.

See gh-34869
2025-05-09 09:43:48 +02:00
Sam Brannen
dbaba3d88a Merge branch '6.2.x' 2025-05-08 10:50:14 +02:00
Sam Brannen
45a2c51fe1 Polish Javadoc for Environment-related components 2025-05-08 10:49:44 +02:00
rstoyanchev
97d5f7f07d Fix filtering in HttpServiceProxyRegistryFactoryBean
Closes gh-34867
2025-05-07 22:53:33 +01:00
Sam Brannen
733e695e18 Merge branch '6.2.x' 2025-05-07 17:37:41 +02:00
Sam Brannen
b98c3257af Introduce @⁠Disabled failing test for R2DBC NamedParameterUtils
The last assertion of the new test method currently fails since "foo"
is only bound once.

java.lang.AssertionError:
Expected size: 2 but was: 1 in:
{0="foo"}

See gh-34768
2025-05-07 17:30:07 +02:00
Sam Brannen
ea8ae09cb7 Revise NamedParameterUtilsTests for consistency 2025-05-07 17:24:41 +02:00
Sam Brannen
e673345102 Merge branch '6.2.x' 2025-05-07 16:15:15 +02:00
Sam Brannen
0abfad870c Polish class-level Javadoc for SpringProperties 2025-05-07 16:14:23 +02:00
Sam Brannen
5a9af9e024 Document AotDetector.AOT_ENABLED flag in SpringProperties
Prior to this commit, the AotDetector.AOT_ENABLED flag was documented
in the reference manual not in the Javadoc for SpringProperties.
2025-05-07 16:14:07 +02:00
Sam Brannen
6c4651925e Merge branch '6.2.x' 2025-05-07 14:29:35 +02:00
Sam Brannen
0867dfca33 Introduce CompositePropertySource constructor that accepts Iterable<PropertySource>
This commit introduces a new constructor for CompositePropertySource
that accepts a `String name` and an Iterable<PropertySource<?>>, which
allows a CompositePropertySource to be constructed from existing
property sources, such as an instance of MutablePropertySources.

Closes gh-34862
2025-05-07 14:25:13 +02:00
Sam Brannen
b4355dc955 Polishing 2025-05-07 12:42:40 +02:00
rstoyanchev
d8b506e09a Fix failing test 2025-05-06 21:43:12 +01:00
rstoyanchev
e5d4d7c13c Refactor DefaultApiVersionInserter 2025-05-06 20:36:56 +01:00
rstoyanchev
22e7f24731 Add defaultApiVersion to RestClient and WebClient
Closes gh-34857
2025-05-06 19:07:58 +01:00
Sam Brannen
fef969145d Merge branch '6.2.x' 2025-05-06 18:51:10 +02:00
Sam Brannen
bc91e0ea96 Revise PropertyResolver Javadoc to highlight resolution semantics 2025-05-06 18:50:33 +02:00
Sam Brannen
964d67474c Merge branch '6.2.x' 2025-05-06 16:08:20 +02:00
Sam Brannen
8599ee6c2b Polish Javadoc 2025-05-06 16:07:46 +02:00
Sam Brannen
bc466022b1 Fix typo in parameter name 2025-05-06 16:07:46 +02:00
Brian Clozel
4a99fa8846 Merge branch '6.2.x' 2025-05-05 14:51:34 +02:00
Brian Clozel
6f11711e27 Fix HttpClient 5.3.x request config compatibility
As of gh-33806, the HttpComponents client request factory is forward
compatible with the 5.4+ versions of that library for configuring HTTP
request configuration.

This change would not tkae into account configuration set at the Spring
level because it would consider the default `RequestConfig` instance as
a custom one. This commit ensures that Spring sets its own configuration
if no custom configuration was set for all supported HttpComponents
generations.

Fixes gh-34851
2025-05-05 14:38:30 +02:00
rstoyanchev
ecdb63371e Merge branch '6.2.x' 2025-05-02 15:59:10 +01:00
rstoyanchev
c067919173 Ensure Fragment can merge attributes
Use a new map when merging as the original may be immutable.

Closes gh-34848
2025-05-02 15:58:51 +01:00
rstoyanchev
ac773d97e9 Polishing contribution
Closes gh-34828
2025-05-02 15:58:51 +01:00
Artur
bd7007227c Provide a working example instead of unclear placeholders
See gh-34828

Signed-off-by: Artur <artur@vaadin.com>
2025-05-02 15:58:51 +01:00
Sam Brannen
f8e7bf7825 Merge branch '6.2.x' 2025-05-02 11:39:09 +02:00
Sam Brannen
e8f873a349 Ensure Bean Overrides are discovered once in hierarchies
Prior to this commit, bean overrides (such as @⁠MockitoBean, etc.) were
discovered multiple times if they were declared:

- at the type-level on an interface that is implemented at more than
  one level in the type hierarchy, the enclosing class hierarchy, or a
  combination of the type and enclosing class hierarchies.

or

- on a field declared in a class which can be reached multiple times
  while traversing the type and enclosing class hierarchies in
  scenarios such as the following: the class (X) in which the field is
  declared is a supertype of an enclosing type of the test class, and X
  is also an enclosing type of a supertype of the test class.

Such scenarios resulted in an IllegalStateException stating that a
duplicate BeanOverrideHandler was discovered.

To address that, this commit revises the search algorithm in
BeanOverrideHandler so that all types (superclasses, enclosing classes,
and implemented interfaces) are only visited once while traversing the
type and enclosing class hierarchies in search of bean override
handlers.

See gh-33925
See gh-34324
Closes gh-34844
2025-05-02 11:26:33 +02:00
rstoyanchev
67f3ff574f Polishing in HTTP service registry 2025-05-01 11:00:32 +01:00
Phillip Webb
42e854e5ff Polish AbstractHttpServiceRegistrar.DefaultGroupSpec
Remove `DefaultGroupRegistry` since it's not really needed and polish
`DefaultGroupSpec` a little.
2025-05-01 11:00:32 +01:00
Phillip Webb
d2246162c3 Polish GroupsMetadata.Registration
Unify `Registration` and `DefualtRegistration` into a single
class since they are both package-private and the interface
isn't really needed.
2025-05-01 11:00:32 +01:00
Phillip Webb
abbee1a050 Use bean class loader when creating interface clients
Update interface client code to replace `GroupsMetadata.loadClass` calls
with `ClassUtils.resolveClassName` passing in the bean class loader.

Since the bean class loader in injected after construction, some minor
refactoring has been applied to `HttpServiceProxyRegistryFactoryBean`.
The class now stores `GroupsMetadata` and only loads the types in
in `afterPropertiesSet`.

The `HttpServiceProxyFactory` class has also been updated to ensure
that the proxy is created using the class loader of the service
type, rather than the thread context class loader.

Fixes gh-34846
2025-05-01 11:00:32 +01:00
Sam Brannen
13f9fed4bc Merge branch '6.2.x' 2025-05-01 10:52:26 +02:00
Sam Brannen
b943817f3e Close ApplicationContext after test AOT processing
See commit 1c108054ee
Closes gh-34841
2025-05-01 10:50:38 +02:00