Commit Graph

1973 Commits

Author SHA1 Message Date
Phillip Webb 960651c15a Add parent origin support
Update the `Origin` interface to include a default `getParent()` method
which can be used to get the parent origin. The `TextResourceOrigin`
has been updated to implement the method against the source `Resource`.
A new `OriginTrackedResource` implementation allows any `Resource` to
be decorated and carry an optional `Origin`.

Ultimately this will allow us to include parent `Origin` information
on properties loaded via a `PropertySourceLoader` without needing any
changes to that interface.

See gh-23018
2020-08-27 22:05:04 -07:00
Phillip Webb bc5958c398 Polish test method names
Polish method names to remove "should".
2020-08-27 21:28:16 -07:00
Phillip Webb c613d119f7 Support binding with multiple constructors
Update `DefaultBindConstructorProvider` so that binding to objects with
multiple constructors is allowed, as long as there is only one
non-public candidate.

Closes gh-23117
2020-08-27 21:28:16 -07:00
Phillip Webb a2530ad5f1 Fix global optional config data opt-out test
See gh-23097
2020-08-26 21:06:21 -07:00
Phillip Webb aa0f204732 Add global optional config data opt-out
Support a `spring.config.all-locations-optional` property which can be
set to `true` if all config data locations should be considered
optional.

Closes gh-23097
2020-08-26 20:11:40 -07:00
Phillip Webb c1be5cb5e0 Add limited support for spring.profiles.include
Restore support for the `spring.profiles.include` property but only
for non-profile specific documents.

Closes gh-22944
2020-08-26 15:43:28 -07:00
Johnny Lim e48af31ced Polish
See gh-23081
2020-08-26 10:47:45 +02:00
Andy Wilkinson 4320b3a919 Merge branch '2.3.x'
Closes gh-23089
2020-08-26 09:04:09 +01:00
Andy Wilkinson 4143c31f9c Merge branch '2.2.x' into 2.3.x
Closes gh-23087
2020-08-26 09:03:46 +01:00
Andy Wilkinson 6f047c8356 Polish "Handle null RSocketServer address when setting port property"
See gh-23084
2020-08-26 08:52:57 +01:00
spencergibb f08f948c3e Handle null RSocketServer address when setting port property
See gh-23084
2020-08-26 08:52:57 +01:00
Phillip Webb d0fce0553f Support extensionless file imports
Update `ResourceConfigDataLocationResolver` so that it can import files
that have no file extension.

Closes gh-22280
2020-08-25 13:57:10 -07:00
Phillip Webb 081a7ee28c Throw exception if import locations are not found
Update config data processing code so that import locations are
mandatory by default. Any import request will now throw a
`ConfigDataLocationNotFoundException` if the specified import
location cannot be found. For optional imports, the user can
use the `optional:` prefix to indicate that the application should
continue to start, even if the location does not exist.

Closes gh-23032
2020-08-25 12:56:55 -07:00
dreis2211 33cd875cb8 Simplify InputStream assertions
See gh-23052
2020-08-24 11:35:17 +02:00
Phillip Webb 758df17c7d Allow placeholders to be used in imports
Allow `${..}` property placeholders to be used in `spring.config.import`
properties. Prior to this commit, placeholders were not resolved when
binding the `ConfigDataProperty` instance. Furthermore, binding happened
too early for all placeholders to be resolved correctly. The
`ConfigDataEnvironmentContributor` class now has two states for imported
contributors, `UNBOUND_IMPORT` has the initial unbound state and is
eventually replaced with a `BOUND_IMPORT`.

Closes gh-23020
2020-08-23 20:27:12 -07:00
dreis2211 f7d6f38368 Fix typos in tests
See gh-23050
2020-08-22 11:44:19 -07:00
Phillip Webb d123c924a0 Add BootstrapRegisty support for config data
Expose the `BootstrapRegisty` to both `ConfigDataLocationResolver` and
`ConfigDataLoader` implementations. The registry is exposed via the
context interfaces and may be used to reuse instances that are expensive
to create. It may also be used to ultimately register beans with the
`ApplicationContext`.

Closes gh-22956
2020-08-20 21:49:03 -07:00
Phillip Webb 2260657781 Add BootstrapRegistry for long lived instances
Add a simple `BootstrapRegistry` that can be used to store and share
object instances across `EnvironmentPostProcessors`. The registry
can be injected into the constructor of any `EnvironmentPostProcessor`.

Registrations can also perform additional actions when the
`ApplicationContext` has been prepared. For example, they could register
the the bootstrap instances as beans so that they become available to
the application.

See gh-22956
2020-08-20 21:45:02 -07:00
Phillip Webb 167e31d564 Provide a simple Instantiator utility class
Make `Instantiator` a public utility class so that it can be used
by other parts of the codebase.

Closes gh-23029
2020-08-20 13:02:17 -07:00
Phillip Webb ba2ab3363b Merge branch '2.2.x' into 2.3.x 2020-08-18 15:38:53 -07:00
Phillip Webb 4e76138ebc Update copyright year of changed files 2020-08-18 15:37:59 -07:00
Phillip Webb 9c6f0d8f7e Merge branch '2.3.x'
Closes gh-22984
2020-08-17 12:40:18 -07:00
Scott Frederick c2ec46c5b1 Polish "Fix include exception handling in DefaultErrorAttributes"
See gh-22750
2020-08-17 13:33:59 -05:00
Lopfest c49605cd7b Fix include exception handling in DefaultErrorAttributes
This commit fixes a problem with the handling of the includeException
field in DefaultErrorAttributes.

See gh-22750
2020-08-17 13:33:59 -05:00
Phillip Webb 7a85373fea Merge branch '2.3.x'
Closes gh-22965
2020-08-14 17:09:13 -07:00
Phillip Webb 1675b47637 Merge branch '2.2.x' into 2.3.x
Closes gh-22964
2020-08-14 17:08:48 -07:00
Phillip Webb 89a6f83344 Fix and improve SpringApplicationBuilder javadoc
Update SpringApplicationBuilder.properties method javadoc to fix
inaccuracies and apply more consistency.

Closes gh-22962
2020-08-14 17:06:39 -07:00
Phillip Webb 3e939cbabd Polish method order 2020-08-14 17:02:13 -07:00
Phillip Webb 310ef6e999 Rename volumemount -> configtree
Closes gh-22941
2020-08-13 13:28:25 -07:00
Phillip Webb 5579f9d1c4 Polish 2020-08-13 11:53:36 -07:00
dreis2211 c00d5c5643 Introduce @ForkedClassPath for testing unmodified class path
See gh-22710
2020-08-12 17:21:31 +01:00
Phillip Webb bc3f028a1f Fix spring.config.activate.on-profile metadata
Fix the `spring.config.activate.on-profile` entry which was accidentally
entered as `spring.config.import.on-profile`.

See gh-22497
2020-08-12 07:13:11 -07:00
Madhura Bhave 4799b26d2c Merge branch '2.3.x'
Closes gh-22897
2020-08-11 12:25:48 -07:00
Madhura Bhave eeca767c49 Merge branch '2.2.x' into 2.3.x
Closes gh-22895
2020-08-11 12:22:43 -07:00
Madhura Bhave cdbb7f441a Do not ignore null/empty values from SPRING_APPLICATION_JSON
Fixes gh-21542
2020-08-11 12:22:08 -07:00
Phillip Webb a062b51efb Polish 'Allow step action to be optional'
See gh-22845
2020-08-11 10:57:03 -07:00
Marten Deinum 0e5be0ab62 Allow step action to be optional
Update `SpringApplicationRunListeners` so that the step action
is optional and does not need to call `end()`.

This commit also introduces a test for the failure case showing
that there is a missed call to end with the initial solution.

See gh-22845
2020-08-11 10:54:00 -07:00
Andy Wilkinson 969dd35e45 Upgrade to Mockito 3.4.6
Closes gh-22838
2020-08-10 15:22:03 +01:00
Stephane Nicoll dedf09d20f Merge branch '2.3.x'
Closes gh-22848
2020-08-10 14:23:56 +02:00
Stephane Nicoll f466734801 Merge branch '2.2.x' into 2.3.x
Closes gh-22847
2020-08-10 14:23:31 +02:00
Stephane Nicoll 333af3d4e7 Polish "Propagate the cause that led Reactor"s debug agent to fail"
See gh-22777
2020-08-10 14:21:44 +02:00
davidbilge 12c419054a Propagate the cause that led Reactor"s debug agent to fail
Prior to this commit, DebugAgentEnvironmentPostProcessor throws a
RuntimeException with a generic error message if its initialization
fails. The causing exception is discarded, which makes error analysis
unnecessarily difficult.

This commit attaches the cause to the newly thrown RuntimeException.

See gh-22777
2020-08-10 14:21:26 +02:00
Brian Clozel 7e159c346e Adapt to MonoProcessor deprecations in Reactor
This commit updates our usage of `MonoProcessor` after the deprecations
introduced in reactor/reactor-core#1053
2020-08-07 19:03:53 +02:00
Brian Clozel 9343266c4f End StartupSteps only once in SpringApplicationRunListeners
Fixes gh-22776
2020-08-07 19:03:53 +02:00
Brian Clozel 6336007038 Merge branch '2.3.x'
Closes gh-22826
2020-08-07 16:01:25 +02:00
Brian Clozel fea535d176 Update HTTP/2 auto-configuration for Jetty
Prior to this commit, the HTTP/2 server auto-configuration for Jetty
would require Conscrypt as a hard dependency.

This commit updates the auto-configuration for more flexibility and now
allows the following deployments:

* JDK9+ with the JDK ALPN implementation
* JDK8u252+ with the backported ALPN implementation
* Conscrypt with no JDK requirement

The auto-configuration now improves detection and guides developers in
case there is a missing `jetty-alpn-*-server` dependency.

The reference docs in the HOWTO section has been updated accordingly.

Closes gh-22188
2020-08-07 15:42:23 +02:00
Phillip Webb f8c8b65cbf Add ConfigDataEnvironmentPostProcessor.applyTo
Add static methods to `ConfigDataEnvironmentPostProcessor` so that
post-processing can be applied to `Environment` instances directly.

Closes gh-22601
2020-08-06 14:35:43 -07:00
Phillip Webb f7f4ff0ac9 Update copyright year of changed files 2020-08-06 14:35:43 -07:00
Phillip Webb dfd233cada Polish 2020-08-06 14:35:43 -07:00
Stephane Nicoll dac63fc3e5 Polish 2020-08-06 17:35:01 +02:00
Brian Clozel 4ef08425e6 Require RSocket 1.0+
This commit removes usage of methods and classes that were previously
deprecated in RSocket and Spring Framework and have been removed.

Closes gh-22764
2020-08-06 16:10:43 +02:00
Brian Clozel 9f558181d5 Instrument SpringBootApplication for ApplicationStartup
This commit allows the configuration of a custom `ApplicationStartup`
implementation on the `SpringApplication` and
`SpringApplicationBuilder` for collecting `StartupStep` metrics.

This also instruments Spring Boot run listeners and server-specific
application context implementations for collecting Spring Boot
application events during startup.

Closes gh-22600
2020-08-06 12:08:02 +02:00
Madhura Bhave 5f386e456b Fix test 2020-08-05 14:59:27 -07:00
Madhura Bhave b9abcf1615 Fail hard if spring.profiles.include is used with new config processing
Closes gh-22693
2020-08-05 14:41:32 -07:00
Brian Clozel fb1234a22c Upgrade to Reactor 2020.0.0 SNAPSHOTs
See gh-22667
2020-08-04 13:26:47 +02:00
dreis2211 e49e2dfff1 Use Supplier variants of Assert methods
See gh-22699
2020-08-03 15:06:13 +02:00
Andy Wilkinson 1168d8fa74 Reduce reflection in LoggingSystem to make it more Graal-friendly
Closes gh-22594
2020-08-03 11:38:10 +01:00
Andy Wilkinson 11a296b068 Polish "Fix NPE in BeanDefinitionLoader when XML support is disabled"
See gh-22696
2020-08-03 09:54:43 +01:00
dreis2211 2bdeba8aaa Fix NPE in BeanDefinitionLoader when XML support is disabled
See gh-22696
2020-08-03 09:53:40 +01:00
Andy Wilkinson 6c67c5d763 Try to fix Windows-specific CI failures 2020-07-31 16:02:14 +01:00
Andy Wilkinson aaa911db16 Merge branch '2.3.x'
Closes gh-22673
2020-07-30 13:41:33 +01:00
Andy Wilkinson 6ee0f8df1b Merge branch '2.2.x' into 2.3.x
Closes gh-22672
2020-07-30 13:41:17 +01:00
Andy Wilkinson 49f8943a5f Register ErrorPageFilter for async dispatch
Fixes gh-19471
2020-07-30 13:38:02 +01:00
Andy Wilkinson f96a688c1b Polish "Allow DurationFormat and PeriodFormat to be used on parameters"
See gh-22646
2020-07-30 09:34:26 +01:00
dreis2211 914452b2cc Allow DurationFormat and PeriodFormat to be used on parameters
See gh-22646
2020-07-30 09:26:41 +01:00
Gerrit Meier 15cd343737 Upgrade to Spring Data Neo4j 6
See gh-22299
2020-07-29 18:58:08 +02:00
Brian Clozel 6f2098ad71 Upgrade to Spring Framework 5.3.0-SNAPSHOT
This commit also switches to RSocket SNAPSHOTs and updates the
repository configuration to rely on "libs-snapshot", since the RSocket
SNAPSHOTs are mirrored there.

See gh-22640
2020-07-29 14:41:17 +02:00
Andy Wilkinson 7aa093e0ca Merge branch '2.3.x'
Closes gh-22636
2020-07-29 11:05:51 +01:00
Andy Wilkinson 5dd7780a38 Try to stabilise descendantOfPropertyAccess performance test
Closes gh-22633
2020-07-29 10:56:30 +01:00
Madhura Bhave 8d70010fce Add expanded profile groups to environment
Fixes gh-22605
2020-07-28 11:39:17 -07:00
Andy Wilkinson 273718c7df Merge branch '2.3.x'
Closes gh-22612
2020-07-28 09:15:26 +01:00
Andy Wilkinson c2df326f6f Merge branch '2.2.x' into 2.3.x
Closes gh-22611
2020-07-28 09:15:14 +01:00
Andy Wilkinson ea5284ca91 Polish "Use milliseconds when configuring awaitTerminationPeriod"
See gh-22604
2020-07-28 09:03:57 +01:00
Tadaya Tsuyukubo 685a6116d1 Use milliseconds when configuring awaitTerminationPeriod
Prior to this change, TaskExecutorBuilder used seconds as its precision
to map the awaitTerminationPeriod value. This caused a loss of
millisecond information in the period.

This commit fixes the loss by converting the period to millisecond and
using setAwaitTerminationMillis to configure the executor.

See gh-22604
2020-07-28 09:01:55 +01:00
Phillip Webb 84bcd0eb1e Improve deprecated exception message
Update the exception message so that it includes the class name of the
implementation.

See gh-22497
2020-07-27 09:06:33 -07:00
Andy Wilkinson 1efac09913 Merge branch '2.3.x'
Closes gh-22586
2020-07-27 13:37:34 +01:00
Andy Wilkinson 8ff2b9f2e8 Merge branch '2.2.x' into 2.3.x
Closes gh-22585
2020-07-27 13:37:23 +01:00
Andy Wilkinson 1b48daf1d5 Do not ignore unknown fields when invalid fields are being ignored
Previously, ignoring invalid fields would cause the failure for an
unknown field to be ignored, irrespective of the ignoreUnknownFields
attribute on `@ConfigurationProperties`.

This commit updates the NoUnboundElementsBindHandler to ensure that
any UnboundConfigurationPropertiesException is thrown rather than
being ignored when the handler has been wrapped by an
IgnoreErrorsBindHandler.

Fixes gh-22308
2020-07-27 13:28:44 +01:00
izeye 6eba7c5f10 Polish
See gh-22549
2020-07-25 07:26:49 +02:00
dreis2211 923474fa48 Polish
See gh-22535
2020-07-24 12:58:12 +02:00
Dave Syer 48f49f2120 Restore missing EnvironmentPostProcessors
See gh-22544
2020-07-24 08:46:04 +01:00
Phillip Webb 36a6ca6e6e Add EnvironmentPostProcessorsFactory
Update `EnvironmentPostProcessorApplicationListener` so that it can
either use values from `spring.factories` or use a factory interface.

Closes gh-22529
2020-07-23 11:43:02 -07:00
dreis2211 b01fb63de6 Polish
See gh-22524
2020-07-23 18:16:34 +02:00
Madhura Bhave 3f76eb2097 Add volume mount property source support
Add support for volume mounted directories where the filename becomes
the property key and the file contents becomes the value.

Support is provided via a dedicated `VolumeMountDirectoryPropertySource`
class which can either be used directly, or via a "volumemount:/..."
`spring.config.import` location.

Closes gh-19990

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2020-07-22 21:03:37 -07:00
Madhura Bhave eee260fc03 Add support for profile groups
Add support for profile groups so that users can combine a number of
fine-grained profiles into a single logical group.

Closes gh-22522
2020-07-22 21:03:37 -07:00
Phillip Webb 3352024b1c Provide ConfigFileApplicationListener replacement
Deprecate `ConfigFileApplicationListener` and provide a replacement
mechanism that supports arbitrary config data imports.

This commit updates the following areas:

- Extract `EnvironmentPostProcessor` invocation logic from the
  `ConfigFileApplicationListener` to new dedicated listener. Also
  providing support for `Log` injection.

- Extract `RandomPropertySource` adding logic from the
  `ConfigFileApplicationListener` to a dedicated class.

- Migrate to the recently introduced `DefaultPropertiesPropertySource`
  class when moving the defaultProperties `PropertySource`

- Replace processing logic with a phased approach to ensure that
  profile enablement happens in a distinct phase and that profiles
  can no longer be activated on an ad-hoc basis.

- Provide a more predictable and logical import order for processing
  `application.properties` and `application.yml` files.

- Add support for a `spring.config.import` property which can be used
  to import additional config data. Also provide a pluggable API
  allowing third-parties to resolve and load locations themselves.

- Add `spring.config.activate.on-profile` support which replaces the
  existing `spring.profiles` property.

- Add `spring.config.activate.on-cloud-platform` support which allows
  a config data document to be active only on a given cloud platform.

- Support a `spring.config.use-legacy-processing` property allowing the
  previous processing logic to be used.

Closes gh-22497

Co-authored-by: Madhura Bhave <mbhave@vmware.com>
2020-07-22 21:02:32 -07:00
Phillip Webb 44f18362d3 Add Binder backed CloudPlatform.isEnforced method
Update `CloudPlatform` with a new `isEnforced` method that's backed
by a `Binder` rather than the `Environment`. We'll require this when
we overhaul our external config data processing logic.

Closes gh-22498
2020-07-22 21:00:14 -07:00
Phillip Webb cd36444641 Extract DefaultPropertiesPropertySource class
Extract `DefaultPropertiesPropertySource` from `SpringApplication` so
that logic can be easily accessed by other classes. Specifically the
property source name and logic to move the source to the end of the
list needs to be called from several places.

Closes gh-22520
2020-07-22 20:58:32 -07:00
Phillip Webb 039fbdfa7c Add DeferredLogFactory support
Add a new `DeferredLogFactory` interface and `DeferredLogs`
implementation that can be used when a `DeferredLog` instance is needed
but the `switchOver` method should be handled elsewhere.

This interface has primarily been added so `EnvironmentPostProcessor`
classes will no longer need to implement `ApplicationEventListener`
just to switch over their logs.

Closes gh-22496
2020-07-22 20:58:31 -07:00
Madhura Bhave 9e9eb90d09 Add multi-document properties file support
Update `OriginTrackedPropertiesLoader` so that it can support
multi-document properties files. These are similar to multi-document
YAML files but use `#---` as the separator.

Closes gh-22495

Co-authored-by: Phillip Webb <pwebb@vmware.com>
2020-07-22 20:58:24 -07:00
Phillip Webb 945e5b9222 Add ConfigurationPropertySource.from method
Add a factory method to `ConfigurationPropertySource` that allows a
single Spring `PropertySource` instance to be adapted.

Closes gh-22494
2020-07-22 20:57:43 -07:00
Phillip Webb 078e146983 Filter empty YAML documents
Update `OriginTrackedYamlLoader` so that empty documents are filtered
from the result. Prior to this commit, our origin wrapper would confuse
the YAML processor and cause empty documents to be included in the Map
with a key of "document" and no value.

Closes gh-22493
2020-07-22 20:57:43 -07:00
Phillip Webb fdc6e80163 Add trailing escape character test
Update `OriginTrackedPropertiesLoaderTests` to also test that an escape
character can be the last character on a line.
2020-07-22 20:57:36 -07:00
Phillip Webb 2eeffe7931 Add @Name support for value object binding
Update value object binder support so that parameters can be annotated
with `@Name` if a specific property name should be used. Prior to this
commit is was not possible to use Java reserved words as property names.

Closes gh-22492
2020-07-22 18:50:23 -07:00
Phillip Webb 2d3ac4bb2e Polish 2020-07-22 18:50:22 -07:00
Phillip Webb 3d7d9d064c Update copyright year of changed files 2020-07-22 18:50:07 -07:00
Phillip Webb 14c1b0938a Polish 2020-07-22 18:25:27 -07:00
Phillip Webb da69286838 Merge branch '2.3.x' 2020-07-22 17:39:27 -07:00
Phillip Webb 187d3af7fc Update copyright year of changed files 2020-07-22 17:25:17 -07:00
Phillip Webb b5e70157dc Update copyright year of changed files 2020-07-22 17:01:36 -07:00
Andy Wilkinson 01558100d1 Do not attempt to use AprLifecycleListener in a native image
Closes gh-22485
2020-07-22 06:30:39 +01:00
Andy Wilkinson 0fd567664a Make DefaultErrorAttributes easier to subclass for message customization
Closes gh-22378
2020-07-21 10:30:33 +01:00
Andy Wilkinson 0ce0c3a54a Polish "Add failure analyzer for missing Liquibase changelog"
See gh-22320
2020-07-17 14:44:25 +01:00
Sebastiaan Fernandez 554a962a13 Add failure analyzer for missing Liquibase changelog
See gh-22320
2020-07-17 14:44:25 +01:00
Andy Wilkinson 0c8e52e877 Avoid using reflection to create SpringApplication's context
Closes gh-22322
2020-07-16 15:03:08 +01:00
Andy Wilkinson 4d1a19f316 Broaden cast as registry may be a GenericApplicationContext
Closes gh-22318
2020-07-14 16:43:27 +01:00
Andy Wilkinson 2af550ef73 Avoid using reflection with manual bean definitions
Closes gh-22318
2020-07-14 14:11:51 +01:00
Andy Wilkinson e3b839a48a Merge branch '2.3.x'
Closes gh-22326
2020-07-14 11:40:52 +01:00
Andy Wilkinson 196d20537a Merge branch '2.2.x' into 2.3.x
Closes gh-22325
2020-07-14 11:38:34 +01:00
Andy Wilkinson 9558779dd4 Replace ConfigurationPropertiesBeanDefinitionValidator with a FailureAnalyzer
Previously, regular bean definitions for configuration properties classes
that attempt to use constructor binding were detected in a bean factory
post-processor, ConfigurationPropertiesBeanDefinitionValidator. This
validation examined every standard bean definition and failed if it
encountered one for a class that should have used constructor binding.
There were two downsides to this approach:

1. Reflection used to identify if the bean should be using constructor
   binding triggered class loading that could prevent subsequent
   instrumentation by a load-time weaver.
2. The cost of the validation was incurred when there was no
   misconfiguration to report.

This commit replaces ConfigurationPropertiesBeanDefinitionValidator
with a failure analyzer. This failure analyzer only runs once a failure
has occurred and the application context is not going to complete
refresh. This avoids causing problems with subsequent instrumentation
and also avoids the cost of validation and error reporting unless there
is an error.

Fixes gh-20798
2020-07-14 11:37:54 +01:00
Andy Wilkinson 2643c60c5a Merge branch '2.3.x'
Closes gh-22316
2020-07-13 14:16:45 +01:00
Andy Wilkinson f52cdf10b3 Update WebServerInitEvent docs to reflect ordering w.r.t. refresh
Closes gh-22277
2020-07-13 12:51:07 +01:00
Brian Clozel 0f264b68e8 Add option to configure PathPatternParser
As of Spring Framework 5.3, it is now possible to use `PathPatternParser`
to parse and match request mapping path patterns, as an alternative to
the current default `AntPathMatcher`.

This new implementation has been used for a while in Spring WebFlux and
it’s been designed for consistency and performance.

This commit introduces a new configuration property for opting-in this
new variant:

`spring.mvc.pathmatch.matching-strategy=path_pattern_parser`

The default option is still `ant_path_matcher` for now, but we might
change the default in future versions since Spring Framework considers
it the best choice for modern applications.

There are several behavior differences with this new variant:

* double wildcards `"**"` are rejected when used in the middle patterns,
this is only allowed as the last matching segment in a pattern.

* it is incompatible with some path matching options, like
suffix-pattern, registered-suffix-pattern or configuring a Servlet
prefix on the `DispatcherServlet` (`spring.mvc.servlet.path=/test`)

This commit introduces two `FailureAnalyzer` implementations to guide
developers when facing those issues.

Closes gh-21694
2020-07-09 21:34:00 +02:00
Andy Wilkinson f0e4149da4 Merge branch '2.3.x'
Closes gh-22287
2020-07-09 12:45:49 +01:00
Andy Wilkinson df67816e55 Try to make ConfigurationPropertySourcesTests perf tests more robust
Previously, the tests used absolute values to verify that the work
had completed sufficiently quickly. This led to flaky tests in
environments where the performance can be variable such as CI.

This commit tries to make the tests more robust by comparing the
performance to a baseline and requiring it to be twice as fast.

Closes gh-22137
2020-07-09 12:36:06 +01:00
Stephane Nicoll 429a504bbe Polish "Allow data unit to be specified on the constructor parameter"
See gh-21746
2020-07-09 11:51:32 +02:00
Vlad Kisel ba70b79651 Allow data unit to be specified on the constructor parameter
See gh-21746
2020-07-09 11:51:32 +02:00
Johnny Lim 4ab4c61761 Polish ErrorPage.equals()
See gh-22240
2020-07-07 14:01:16 +02:00
Andy Wilkinson 29b69bfbdf Merge branch '2.3.x'
Closes gh-22250
2020-07-07 11:43:17 +01:00
Andy Wilkinson da319f5f59 Merge branch '2.2.x' into 2.3.x
Closes gh-22249
2020-07-07 11:43:03 +01:00
Andy Wilkinson 14f24dbecc Merge branch '2.1.x' into 2.2.x
Closes gh-22248
2020-07-07 11:42:43 +01:00
Andy Wilkinson 26f591264c Fix handling of NestedServletException with no root cause
Fixes gh-22169
2020-07-07 11:34:25 +01:00
dreis2211 507eb9498b Use Class.getDeclaredConstructor().newInstance()
See gh-21913
2020-07-07 11:12:35 +01:00
Andy Wilkinson 3c7f54b97f Polish "Remove redundant close() call from JarResourceManagerTests"
See gh-22213
2020-07-07 10:17:22 +01:00
XenoAmess 623b3ab96e Remove redundant close() call from JarResourceManagerTests
See gh-22213
2020-07-07 10:16:20 +01:00
Andy Wilkinson cd8081f952 Polish "Use new ArrayList(Collection) rather than new and addAll"
See gh-22211
2020-07-07 10:09:48 +01:00
XenoAmess fb70c529d4 Use new ArrayList(Collection) rather than new and addAll
See gh-22211
2020-07-07 10:07:29 +01:00
XenoAmess 66dc24062f Fix typos in test code
See gh-22218
2020-07-07 10:01:48 +01:00
Andy Wilkinson 523dd937cd Merge branch '2.3.x'
Closes gh-22238
2020-07-06 19:58:45 +01:00
Andy Wilkinson 28128a9577 Add support for ChronoUnit.WEEKS when using PeriodUnit
Fixes gh-22225
2020-07-06 19:57:26 +01:00
Andy Wilkinson 0141f554b8 Merge branch '2.3.x' 2020-07-06 16:00:10 +01:00
Andy Wilkinson d1f074858e Correct class name of StringToPeriodConverterTests 2020-07-06 15:59:32 +01:00
dreis2211 20debcd471 Remove redundant deprecation suppression
See gh-22178
2020-07-01 09:03:28 +01:00
Andy Wilkinson 27c458ca26 Merge branch '2.3.x'
Closes gh-22160
2020-06-30 10:53:49 +01:00
Andy Wilkinson f86831da9c Use TCCL at time of access for resource loading
Fixes gh-22119
2020-06-30 10:51:13 +01:00
Madhura Bhave 255f8197ab Merge branch '2.3.x'
Closes gh-22156
2020-06-29 17:09:05 -07:00
Madhura Bhave f19f2b8714 Merge branch '2.2.x' into 2.3.x
Closes gh-22155
2020-06-29 17:08:37 -07:00
May c1b9d3c226 Simplify logic in ErrorPage's equals method
See gh-22082
2020-06-29 17:06:49 -07:00
Madhura Bhave 75abb9cc18 Merge branch '2.3.x'
Closes gh-22153
2020-06-29 16:36:25 -07:00
Johnny Lim 43aee1bddd Polish
See gh-22090
2020-06-29 16:35:23 -07:00
Madhura Bhave c3ddfcdbf5 Trim trailing whitespace from value of logging.config
Closes gh-22078
2020-06-25 15:18:40 -07:00
Andy Wilkinson d12b6b3a86 Disable LogbackLoggingSystem's XML support when spring.xml.ignore=true
Closes gh-22106
2020-06-25 13:01:45 +01:00
Andy Wilkinson 308e337009 Polish "Disable XML reader when spring.xml.ignore is true"
See gh-22093
2020-06-25 11:52:43 +01:00
Sébastien Deleuze 8d5cf79675 Disable XML reader when spring.xml.ignore is true
This commit allows to set the XmlBeanDefinitionReader field from
BeanDefinitionLoader to null in a way that allows the GraalVM native
compiler to remove it from the native image when the spring.xml.ignore
flag introduced by spring-projects/spring-framework#25151
is set to true.

The purpose of this change is to allow smaller footprint on native
images without requiring to use GraalVM native substitutions
which are unmaintainable by nature and also to increase the consistency
between JVM and native images.

In order to effective, this optimization requires BeanDefinitionLoader
class to be initialized at build time.

See gh-22093
2020-06-25 11:51:27 +01:00
Andy Wilkinson ea30c096dd Polish 16263e3
See gh-22105
2020-06-25 11:49:35 +01:00
Andy Wilkinson 16263e342c Move bean definition counting only used in tests into test code
Closes gh-22105
2020-06-25 11:33:09 +01:00
Andy Wilkinson 0d6ea79007 Start building against Spring Framework 5.3.0 snapshots
See gh-21929
2020-06-22 18:02:21 +01:00
Andy Wilkinson a0946c8923 Start building against Reactor 2020.0.0 snapshots
See gh-21927
2020-06-22 17:34:56 +01:00
Stephane Nicoll 51e9a5dae0 Merge branch '2.3.x'
Closes gh-22029
2020-06-19 14:15:32 +02:00
Johnny Lim b218a89862 Remove Javadoc throw for ConfigurationPropertyName.ofIfValid()
See gh-22018
2020-06-19 14:14:57 +02:00