Update `ConfigurationPropertySourcesPropertySource` to no longer use
`try/catch` when checking for valid names. A new `isValid` method has
been introduced to `ConfigurationPropertyName` which is offers better
performance.
Fixes gh-9058
Update the `Binder` to short circuit potentially expensive bean binding
if there are no known child properties. The shortcut can only be applied
when all used `ConfigurationPropertySources` return a non empty
`containsDescendantOf` result. This should be the case for most
Spring Boot applications, the exception being any apps that are running
in a security restricted environment.
Fixes gh-9023
Update `ConfigurationPropertySource` with a `containsDescendantOf`
method that can be used to tell if a source contains any descendants
of the given name.
The result is Optional so that sources that cannot determine a result
may return `empty()`.
The existing `IterableConfigurationPropertiesSource` has a default
implementation that works by iterating the contained values. Most other
sources return `empty()` with the exception of the adapted
`RandomProperySource` with will return true for `random.*` names.
See gh-9023
Update `NoUnboundElementsBindHandler` to also support ignoring
nested properties. This change is required to allow the
`NoUnboundElementsBindHandler` to be used alongside the
`IgnoreNestedPropertiesBindHandler`.
See gh-9000
Create separate `IterableConfigurationPropertySource` and
`ConfigurationPropertySource` interfaces so that it's possible to
work out if a source can truly iterate the values that it contains.
Prior to this commit there was only a single
`ConfigurationPropertySource` interface, which returned an empty
Iterator when values could not be iterated. This design made it
impossible to tell the difference between a source that was empty, and
a source that could not be iterated.
The `ConfigurationPropertySources` class has been updated to adapt
non-enumerable and enumerable Spring PropertySources to the correct
`ConfigurationPropertySource` interface. It also deals with the edge
case of the `SystemPropertySource` running in a security restricted
environment.
Fixes gh-9057
Update `DefaultServletWebServerFactoryCustomizerTests` so that the Jetty
access log tests use the default timezone. Prior to this commit it was
possible that running the tests outside of UTC could result in Jetty
throwing a "negative delay" IllegalArgumentException.
See gh-8819
Until we can use the Netty BOM (see gh-9021), this change adds all
Netty modules as managed dependencies so as to avoid version
clashes between managed and unmanaged Netty dependencies.
Fixes gh-8553
This commit changes the default file extension for Mustache templates,
from `.html` to `.mustache`, which is the file extension used in the
official reference documentation and by most IDE plugins.
Fixes gh-8997
Thymeleaf 3.0 implements the Spring 5.0 view infrastructure for WebMVC
and the new WebFlux framework. This commit adds auto-configuration for
the WebFlux support.
In that process, the configuration property for `spring.thymeleaf` has
been changed to add `spring.thymeleaf.servlet` and
`spring.thymeleaf.reactive` for MVC/WebFlux specific properties.
Now that the `spring-boot-starter-thymeleaf` does not only support
Spring MVC, the transitive dependency on `spring-boot-starter-web` is
removed from it.
Fixes gh-8124
This commit ensures that a primary JSR 303 and Spring Validator will be
exposed if the auto-configuration kicks in. As `LocalValidatorFactoryBean`
exposes 3 contracts (JSR-303 `Validator` and `ValidatorFactory` as well as
the `Spring` validator one), this makes sure that those types can be
injected by type.
`LocalValidatorFactoryBean` exposes 3 contracts and we're only checking
for the absence of a `javax.validation.Validator` to auto-configure a
`LocalValidatorFactoryBean`. If no standard JSR validator exists but a
Spring's `Validator` exists and is primary, we shouldn't flag the
auto-configured one as `@Primary`. Previous iterations on this feature
have made sure that we'll auto-configure at most one
`javax.validation.Validator` so not flagging it `@Primary` is no problem.
This commit also restores and adds tests that validates
`ValidationAutoConfiguration` will configure a JSR validator even if a
Spring Validator is present.
This effectively fixes gh-8495 in a different way.
Closes gh-8979
Closes gh-8976