Commit Graph

4415 Commits

Author SHA1 Message Date
Phillip Webb
a824b23cd7 Merge branch '3.3.x'
Closes gh-43536
2024-12-16 17:16:47 -08:00
Phillip Webb
21203f06ec Use deterministic ordering for inserted shutdown hooks
Update `SpringApplicationShutdownHook` so the underlying set of
`Runnable` instances are stored in a `LinkedHashSet` rather than
a `Collections.newSetFromMap(new IdentityHashMap<>())`. This insures
that shutdown hooks are run in the order that they are added.

Fixes gh-43430
2024-12-16 17:16:21 -08:00
Johnny Lim
4d15ee5bf0 Polish
See gh-43498
2024-12-13 13:29:20 -08:00
Andy Wilkinson
dc00342384 Improve handling of environment variables in failure analysis
Prior to this change, the failure analysis for an invalid
configuration property value filtered out the configuration property
sources property source. This property source contains a "duplicate"
of all of the environment's other property sources but with
configuration property support (such as relaxed/fuzzy matching of
environment variables). This was done to prevent the reporting of
duplicates when a property was found in both the configuration
property sources property source and the "normal" property sources.
An unwanted side-effect of this was that fuzzy matching of
environment variables was lost so the origin of
com.example.some-property would be found in the environment variable
was COM_EXAMPLE_SOME_PROPERTY but would not be found if it was
COM_EXAMPLE_SOMEPROPERTY.

This commit addresses this side-effect by no longer filtering out
the configuration property sources property source. To then
prevent duplicates from being reported in the analysis, it instead
deduplicates things based on the origin of each property that's
found in the environment's property sources.

Fixes gh-43380
2024-12-12 09:06:15 +00:00
Phillip Webb
15f5811f3d Merge pull request #43441 from minwoo1999
* pr/43441:
  Polish 'Add test for nullSafeValue with mapper transformation'
  Add test for nullSafeValue with mapper transformation

Closes gh-43441
2024-12-11 15:14:25 -08:00
Phillip Webb
d5d7152e5d Polish 'Add test for nullSafeValue with mapper transformation'
See gh-43441
2024-12-11 15:14:14 -08:00
KIM MIN WOO
22f527af6a Add test for nullSafeValue with mapper transformation
See gh-43441
2024-12-11 15:13:31 -08:00
Phillip Webb
e72546d2a6 Add customizer variant of requestFactorySettings
Add `requestFactorySettings` that accepts a `UnaryOperator` so that
the existing `requestFactorySettings` can be customized rather than
replaced.

Closes gh-43258
2024-12-10 14:54:33 -08:00
Dmytro Nosan
26ab0fea81 Don't replace existing defaultRequestConfigCustomizer
Update `HttpComponentsClientHttpRequestFactoryBuilder` to add to the
existing `defaultRequestConfigCustomizer` rather than replace it.

See gh-43429
2024-12-06 19:11:37 -08:00
Yanming Zhou
f450b28a7c Add redirects(...) method to RestTemplateBuilder
Add `redirects(...)` method to `RestTemplateBuilder` to allow redirect
customization. This new method is required in 3.4 since the default
redirect strategy for some clients has changed and users need a way
to restore the old behavior.

See gh-43258
2024-12-04 15:09:33 -08:00
Phillip Webb
916efb632c Merge branch '3.3.x' 2024-12-04 15:04:22 -08:00
Phillip Webb
9e7972a9b4 Polish code with code cleanup rules 2024-12-04 15:03:40 -08:00
Andy Wilkinson
04310a7ad0 Merge branch '3.3.x'
Closes gh-43382
2024-12-04 17:00:01 +00:00
Andy Wilkinson
7c7bb531b4 Improve handling of environment variables in failure analysis
Prior to this change, the failure analysis for an invalid
configuration property value filtered out the configuration property
sources property source. This property source contains a "duplicate"
of all of the environment's other property sources but with
configuration property support (such as relaxed/fuzzy matching of
environment variables). This was done to prevent the reporting of
duplicates when a property was found in both the configuration
property sources property source and the "normal" property sources.
An unwanted side-effect of this was that fuzzy matching of
environment variables was lost so the origin of
com.example.some-property would be found in the environment variable
was COM_EXAMPLE_SOME_PROPERTY but would not be found if it was
COM_EXAMPLE_SOMEPROPERTY.

This commit addresses this side-effect by no longer filtering out
the configuration property sources property source. To then
prevent duplicates from being reported in the analysis, it instead
deduplicates things based on the origin of each property that's
found in the environment's property sources.

Fixes gh-43380
2024-12-04 13:55:20 +00:00
Stéphane Nicoll
60b028e7cb Merge branch '3.3.x'
Closes gh-43377
2024-12-04 10:57:58 +01:00
Stéphane Nicoll
cc274ccdca Polish "Polish formatting of log configuration file"
See gh-43322
2024-12-04 10:33:58 +01:00
Yanming Zhou
3f17e42b38 Polish formatting of log configuration file
1. Remove space before `/>` to keep consistency.
2. Capitalize `filters` for Log4j2.
3. Uppercase log level to keep consistency.

See gh-43322
2024-12-04 10:28:28 +01:00
Phillip Webb
3ddfd62f16 Prefer file resolution when loading SSL content
Update `SslAutoConfiguration` so that the used resource loader prefers
file based resolution when paths are specified without a prefix. This
restores the behavior found in Spring Boot 3.3.

The `ApplicationResourceLoader` has been updated with a new `get` method
that accepts a `preferFileResolution` parameter. Unfortunately, we can't
directly influence the resource returned by the delegate
`ResourceLoader` since we can't override `getResourceByPath(...)`.
Instead we check if the returned type was likely to have been created
by a call to that method. If so, we change it to a `FileSystemResource`.

This approach should hopefully work with `DefaultResourceLoader` and
subclasses.

Fixes gh-43274
2024-12-03 15:00:15 -08:00
Moritz Halbritter
07bc5f2563 Polish "Remove redundant null check for sorter"
See gh-43343
2024-12-02 11:39:37 +01:00
Jae-Young98
bd367803d1 Remove redundant null check for sorter
See gh-43343
2024-12-02 11:37:56 +01:00
Johnny Lim
859c235a95 Polish
See gh-43316
2024-11-29 10:35:11 +01:00
Yanming Zhou
aaaeddcd7d Update javadoc to describe registration through spring.factories
See gh-43313
2024-11-29 09:22:49 +00:00
Andy Wilkinson
b5feadab13 Merge pull request #43314 from quaff
* gh-43314:
  Polish "Document StructuredLoggingJsonMembersCustomizer constructor params"
  Document StructuredLoggingJsonMembersCustomizer constructor params

Closes gh-43314
2024-11-28 13:39:51 +00:00
Andy Wilkinson
15109b2eb2 Polish "Document StructuredLoggingJsonMembersCustomizer constructor params"
See gh-43314
2024-11-28 13:39:30 +00:00
Yanming Zhou
34ac045073 Document StructuredLoggingJsonMembersCustomizer constructor params
See gh-43314
2024-11-28 13:38:05 +00:00
Andy Wilkinson
a1c1e32947 Call spring.factories customizers in the same way as one from props
Previously, customizers loaded from spring.factories were called
using LambdaSafe. This resulted in customizers with a generic type
more specific than Object being ignored. A customizer loaded from
the logging.structured.json.customizer property was not affected as
it was called directly rather than through LambdaSafe.

This commit aligns the way in which customizers loaded from
spring.factories are called with the way in which any customizer
specified using the logging.structured.json.customizer property is
called.

Closes gh-43312
2024-11-28 11:08:32 +00:00
Andy Wilkinson
74d69d0eb1 Merge branch '3.3.x'
Closes gh-43307
2024-11-27 20:14:23 +00:00
Andy Wilkinson
7bc709c32f Fix subName from adapted name with value processor
Previously, when a configuration property name was created by
adapting a source with a value processor, creating sub names from
that property name did not work correctly. This broke binding of
prefixed environment variables to a map as the ancestor checking
did not work.

Fixes gh-43304
2024-11-27 19:34:35 +00:00
Stéphane Nicoll
d8c41c2583 Defensively unwrap CacheConnectionFactory
This commit refines the optimization introduced in gh-39816 to only
unwrap our own caching connection factory. The more advanced unwrap
algorithm is still available, but opt-in only.

Unwrapping more aggressively may break use cases where the wrapped
ConnectionFactory is required, i.e. for transactional purposes.

Closes gh-43277
2024-11-26 19:56:32 +01:00
Andy Wilkinson
32433e84f3 Merge branch '3.3.x'
Closes gh-43270
2024-11-22 15:46:38 +00:00
Andy Wilkinson
bb3651b7d1 Reduce warnings reported by Eclipse
Closes gh-43269
2024-11-22 15:39:35 +00:00
Phillip Webb
3cae5c27d1 Merge branch '3.3.x' 2024-11-20 20:58:02 -08:00
Phillip Webb
283bc6faf0 Merge branch '3.2.x' into 3.3.x 2024-11-20 20:57:35 -08:00
Phillip Webb
5c938fc8bc Update copyright year of changed files 2024-11-20 20:57:27 -08:00
Phillip Webb
5f9a13bdc3 Fix withDefaultRequestConfigCustomizer method name
Second attempt to fix the method name.

Closes gh-43139
2024-11-20 10:32:27 -08:00
Phillip Webb
0c2d5e6c50 Fix formatting
See gh-43139
2024-11-20 10:00:20 -08:00
Phillip Webb
223427e96d Fix withDefaultRequestConfigCustomizer method name
The work `manager` was accidentally included due to a copy/paste
mistake.

Closes gh-43139
2024-11-20 09:54:50 -08:00
Yanming Zhou
7fdc9742af Prohibit unnecessary value on @EnumSource
See gh-43214
2024-11-18 21:50:35 -08:00
Phillip Webb
26c775eff8 Register AutoConfigurations using fully qualified class name
Update `AbstractApplicationContextRunner` and `Configurations` to
allow registration of beans with a specific generated bean name. By
default, no name is generated, however, `AutoConfigurations` has been
updated to use bean names using the fully qualified class name.

The update brings `ApplicationContextRunners` closer the behavior of
a standard Spring Boot application where user `@Configuration` classes
are usually registered with a simple name and auto-configurations are
imported (via an `ImportSelector`) using a fully qualified name.

Fixes gh-17963

Co-authored-by: Stéphane Nicoll <stephane.nicoll@broadcom.com>
Co-authored-by: Andy Wilkinson <andy.wilkinson@broadcom.com>
Co-authored-by: Dmytro Nosan <dimanosan@gmail.com>
2024-11-18 21:37:42 -08:00
Stéphane Nicoll
5c0a2dffd7 Polish 2024-11-18 14:23:44 +01:00
Johnny Lim
0b854bfee1 Replace "structure logging" with "structured logging"
See gh-43203
2024-11-16 08:30:09 -08:00
Phillip Webb
68022ef0bb Use Class reference rather than String for customizer
Update `StructuredLoggingJsonProperties` to use a real Class reference
rather than a String.

Closes gh-43202
2024-11-15 17:03:25 -08:00
Moritz Halbritter
70d5756ce5 Polish "Add logger warning if Hikari datasource doesn't have pool suspension configured"
See gh-42937
2024-11-14 11:03:53 +01:00
Dennis Kieselhorst
d4ffedf997 Add logger warning if Hikari datasource doesn't have pool suspension configured
See gh-42937
2024-11-14 10:31:17 +01:00
Phillip Webb
87cf12a36c Add withDefaultRequestConfigManagerCustomizer method
Update `HttpComponentsClientHttpRequestFactoryBuilder` with a new
`withDefaultRequestConfigManagerCustomizer` method, primarily to help
disable the protocol upgrade setting.

Closes gh-43139
2024-11-13 11:49:58 -08:00
Moritz Halbritter
484c3773ca Merge branch '3.3.x'
Closes gh-43117
2024-11-11 11:29:24 +01:00
Moritz Halbritter
18afa2c8dc Merge branch '3.2.x' into 3.3.x
Closes gh-43116
2024-11-11 11:25:38 +01:00
Johnny Lim
dfcc7c5c2d Fix WebServerPortFileWriter.getPortFile() without extension
See gh-43115
2024-11-11 11:18:00 +01:00
Phillip Webb
ede1110e36 Set properties from SslOptions for Jetty and JDK HTTP clients
Update `ClientHttpRequestFactoryBuilder` implementations for both
Jetty and JDK to configure properties from SslOptions.

Fixes gh-43077
2024-11-09 00:21:01 -08:00
Phillip Webb
065e7c190e Merge branch '3.3.x'
Closes gh-43084
2024-11-09 00:01:20 -08:00