Commit Graph

2339 Commits

Author SHA1 Message Date
Stephane Nicoll
d3c817b7ba Polish "Remove unnecessary throws declaration in tests"
See gh-26441
2021-05-17 09:36:53 +02:00
weixsun
8a2be288a3 Remove unnecessary throws declaration in tests
See gh-26441
2021-05-17 09:31:51 +02:00
Stephane Nicoll
691bbcfdfd Update copyright year of changed files
See gh-26448
2021-05-16 15:29:48 +02:00
weixsun
d115361980 Remove redundant suppression
See gh-26448
2021-05-16 15:10:48 +02:00
weixsun
aa8323f915 Remove unused imports
See gh-26477
2021-05-16 15:03:36 +02:00
Andy Wilkinson
a3d68e29c2 Merge branch '2.4.x'
Closes gh-26463
2021-05-14 13:45:46 +01:00
Andy Wilkinson
9f279e0e96 Merge branch '2.3.x' into 2.4.x
Closes gh-26462
2021-05-14 13:45:29 +01:00
Andy Wilkinson
5984d4ee2b Index @ConfigurationProperties so they can be found by scanning
Previously, @ConfigurationProperties was not annotated with @Indexed.
This meant that @ConfigurationPropertiesScan would not be able to
find them when the underlying
ClassPathScanningCandidateComponentProvider is using a
CandidateComponentsIndex.

This commit annotated @ConfigurationProperties with @Indexed so that
they can be found by index-based scanning.

Fixes gh-26459
2021-05-14 13:41:24 +01:00
Phillip Webb
83668f96af Merge branch '2.4.x'
Closes gh-26458
2021-05-13 23:38:41 -07:00
Phillip Webb
73131e99da Make BufferingApplicationStartup thread safe
Update `BufferingApplicationStartup` to use thread safe data structures.

Prior to this commit, it was possible for calls from different threads
(for example due to request scope beans) to cause a
NoSuchElementException to be thrown.

Closes gh-25792
2021-05-13 23:35:36 -07:00
Andy Wilkinson
89b5ece9b4 Use resource loader's class loader in config loading
Previously, classes involved in config loading used a variety of
potentially different class loaders when calling SpringFactoriesLoader.
Some classes would use their own class loader and others would use null
which results in SpringFactoriesLoader's class loader being used.

This commit updates the config loading classes to consistently use the
resource loader's class loader.

Fixes gh-26126
2021-05-13 13:25:47 +01:00
Madhura Bhave
eff024b0ce Polish "Process additional profiles before config files processing"
See gh-25817
2021-05-11 15:04:34 -07:00
nguyensach
97fd9a7c77 Process additional profiles before config files processing
Additional profiles were being processed after config file processing
when legacy processing was used.
This commit also restores the order in which additional profiles are added
when legacy processing is used.
Active profiles take precedence over additional profiles.

See gh-25817
2021-05-11 15:03:36 -07:00
Madhura Bhave
38ef6b5644 Merge pull request #25817 from nguyensach
* pr/25817:
  Polish "Process additional profiles before config files processing"
  Process additional profiles before config files processing

Closes gh-25817
2021-05-11 14:46:12 -07:00
Madhura Bhave
2e1b20ce2b Polish "Process additional profiles before config files processing"
See gh-25817
2021-05-11 13:06:46 -07:00
nguyensach
6f266145c7 Process additional profiles before config files processing
Additional profiles were being processed after config file processing
when legacy processing was used.
This commit also restores the order in which additional profiles are added
when legacy processing is used.
Active profiles take precedence over additional profiles.

See gh-25817
2021-05-11 13:05:48 -07:00
Phillip Webb
ba1e5fb5e8 Merge branch '2.4.x'
Closes gh-26402
2021-05-06 19:50:52 -07:00
Phillip Webb
efad44be43 Refine mandatory location checking logic
Update `ConfigDataEnvironment.checkMandatoryLocations` to use the
actual locations that were imported, including those that were skipped
because the related `ConfigDataResource` had already been imported by a
different location.

Prior to this commit, any location that was skipped because it had
already been imported would throw a `ConfigDataNotFoundException`.

Closes gh-26147

Co-authored-by: Scott Frederick <sfrederick@vmware.com>
Co-authored-by: Madhura Bhave <mbhave@vmware.com>
2021-05-06 19:50:41 -07:00
Phillip Webb
777abc4aac Merge branch '2.4.x'
Closes gh-26401
2021-05-06 19:50:17 -07:00
Phillip Webb
fef62f784a Import profile specific files in correct order
Update `StandardConfigDataLoader` to mark profile specific files with
`Option.PROFILE` so that they are added in the correct order. This is
a variation of the same issue described in commit 5774ea3f0c.

Closes gh-26400

Co-authored-by: Scott Frederick <sfrederick@vmware.com>
Co-authored-by: Madhura Bhave <mbhave@vmware.com>
2021-05-06 19:43:40 -07:00
Scott Frederick
922517c0e5 Polish 2021-05-06 19:43:31 -07:00
Scott Frederick
0893df4a01 Merge branch '2.4.x'
Closes gh-26346
2021-05-03 14:53:41 -05:00
Scott Frederick
dbee0cf9f1 Ignore empty values in config location properties
This commit updates config data property binding to ignore empty
elements in `spring.config.location` and `spring.config.import`
property values when a value is a comma-delimited string
representing a collection.

Fixes gh-26342
2021-05-03 14:52:22 -05:00
Stephane Nicoll
3475e01cda Merge branch '2.4.x'
Closes gh-26323
2021-04-30 13:32:56 +02:00
Stephane Nicoll
4ccce2a74f Merge branch '2.3.x' into 2.4.x
Closes gh-26322
2021-04-30 13:32:40 +02:00
Stephane Nicoll
a6e59b357f Polish "Improve failure analysis with a single bean cycle"
See gh-26292
2021-04-30 13:30:58 +02:00
Roman Zabaluev
044c902a8c Improve failure analysis with a single bean cycle
See gh-26292
2021-04-30 13:18:13 +02:00
Stephane Nicoll
4febe6485c Merge branch '2.4.x'
Closes gh-26318
2021-04-30 08:53:31 +02:00
Stephane Nicoll
63d486158d Merge branch '2.3.x' into 2.4.x
Closes gh-26317
2021-04-30 08:53:20 +02:00
Stephane Nicoll
3f528bb0eb Mark SpringBootConfiguration as Indexed
Previously, users of the components.index could not use the index in
scenario where Spring Boot needs to locate the SpringBootConfiguration
to use to bootstrap the test context, as AnnotatedClassFinder scans
the classpath for that stereotype specifically and that requires a
dedicated entry for it.

This commit makes sure that a SpringBootConfiguration-annotated type has
a dedicated entry in the components index.

Closes gh-26308
2021-04-30 08:47:45 +02:00
Andy Wilkinson
31b650093d Merge branch '2.4.x'
Closes gh-26251
2021-04-27 11:56:48 +01:00
Andy Wilkinson
ffc06e1e30 Merge branch '2.3.x' into 2.4.x
Closes gh-26250
2021-04-27 11:51:29 +01:00
Andy Wilkinson
715c4febf9 Update maformed address to one that should fail on CI
Closes gh-26247
2021-04-27 11:50:52 +01:00
Phillip Webb
1e0a3a946d Fix binding random properties test
See gh-26201
2021-04-26 17:36:58 -07:00
Phillip Webb
ba5b36d733 Restore support for binding random properties
Revert 0588e989af so that `@ConfigurationProperties` can again be
bound using values from the `RandomValuePropertySource`.

Fixes gh-26201
2021-04-26 15:42:15 -07:00
Stephane Nicoll
3ca6ed6246 Polish
Closes gh-26190
2021-04-21 17:20:22 +02:00
Stephane Nicoll
55b9fc12c7 Merge branch '2.4.x'
Closes gh-26165
2021-04-20 10:23:57 +02:00
Stephane Nicoll
52543b84c1 Fix sourceType for spring.profiles.include
Closes gh-26163
2021-04-20 10:23:42 +02:00
Stephane Nicoll
cf5334da35 Merge branch '2.4.x'
Closes gh-26164
2021-04-20 10:22:55 +02:00
Stephane Nicoll
2bd4ccce8a Document spring.profiles.group in configuration metadata
Closes gh-26127
2021-04-20 10:22:43 +02:00
izeye
e53453c69c Fix broken assertions in tests
This commit also restores the HTTP response body
assertion that has been dropped in 5873ddd.

See gh-26162
2021-04-20 10:02:26 +02:00
Andy Wilkinson
177152e007 Merge branch '2.4.x'
Closes gh-26155
2021-04-19 10:24:25 +01:00
Andy Wilkinson
0c30a5930d Polish "Use ConfigDataLocationResolvers' class loader to load resolver names"
See gh-26149
2021-04-19 10:23:27 +01:00
Sriram
4268f8da84 Use ConfigDataLocationResolvers' class loader to load resolver names
See gh-26149
2021-04-19 10:06:07 +01:00
Stephane Nicoll
bac101647a Polish contribution
See gh-25532
2021-04-16 09:29:48 +02:00
katielevy1
bd9dd9d5eb Polish KotlinConstructorParametersBinderTests
See gh-25532
2021-04-16 09:22:45 +02:00
Phillip Webb
e1ad2cdab3 Fix Windows build failures
See gh-23098
2021-04-15 18:31:01 -07:00
Phillip Webb
beaf03a008 Update copyright year of changed files 2021-04-15 12:22:48 -07:00
Phillip Webb
238d0fed71 Improve Log4J log level reset support
Update `Log4J2LoggingSystem` so that call to `setLevel` with a `null`
level with remove the logger if it was previously configured by a
`LoggingSystem` call.

To track which loggers have been configured by us, and which have been
configure directly by the user, a custom `LoggerConfig` subclass is
used. We'll only remove `LevelSetLoggerConfig` classes, for any others
we'll call `setLevel(null)` on the config.

Prior to this commit, it was impossible to set then reset a logger
level using the actuator endpoint. This is because Log4J doesn't provide
a way to get the actual configured level. If the `setLevel(null)` has
been applied, then `getLevel()` will return the value of the parent
logger or a default value of `ERROR`.

Fixes gh-24298
2021-04-15 12:22:24 -07:00
Phillip Webb
96823869a9 Merge branch '2.4.x'
Closes gh-26139
2021-04-15 12:02:01 -07:00