Commit Graph

12027 Commits (c84204bc819fb8cd39c82d1d964263a4414bceef)
 

Author SHA1 Message Date
Phillip Webb 5ae1798ec5 Don't rely on ConfigurationPropertyName exceptions
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
8 years ago
Phillip Webb 8b1625b41d Short circuit binding if possible
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
8 years ago
Phillip Webb c22a21e386 Add 'contains descendant of' support
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
8 years ago
Phillip Webb 35a51e45d8 Ignore nested with NoUnboundElementsBindHandler
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
8 years ago
Phillip Webb 3153117429 Fix ConfigurationPropertyName ancestor bug
Fix an issue with `ConfigurationPropertyName` where the `isAncesorOf`
method would not work with `ConfigurationPropertyName.EMPTY`

See gh-9000
8 years ago
Phillip Webb 10b8eb3109 Split ConfigurationPropertySource for iteration
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
8 years ago
Phillip Webb 53fd1f7f2e Fix cache sizing bug
Fix a cache size bug in `DefaultPropertyMapper` which caused the
cache to be purged immediately.

See gh-9000
8 years ago
Phillip Webb 6cdb02050d Reduce InMemoryAuditEventRepository default capacity
Lower the default capacity used in `InMemoryAuditEventRepository` from
4000 to 1000. This should help reduce memory consumption.

Fixes gh-9056
8 years ago
Phillip Webb 77d427af6c Fix occasional Jetty test failures
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
8 years ago
Stephane Nicoll da0d7b5558 Merge pull request #9042 from michael-simons:fix-source-links
* pr/9042:
  Fix several broken links to sources
8 years ago
Michael J. Simons 18230d7f23 Fix several broken links to sources
Closes gh-9042
8 years ago
Phillip Webb d6099bafa3 Reduce ConfigurationPropertyName garbage
Update the `ConfigurationPropertyNameBuilder` to reduce the number of
objects created.

Fixes gh-9022
8 years ago
Phillip Webb 19f166a56f Delete remaining old `bind` classes
Remove the last deprecated class from `org.springframework.boot.bind`

See gh-9000
8 years ago
Phillip Webb 3f71b8453f Migrate missed tests to new Binder
Migrate a few tests that were missed to use the new `Binder`.

See gh-9000
8 years ago
Phillip Webb 528d776d2b Polish 8 years ago
Madhura Bhave 0759652b24 Tests for missing placeholders during binding
Add a test to ensure that that there is a hard failure when trying to
bind properties with missing placeholders.

Closes gh-8693
8 years ago
Phillip Webb 76593a3806 Merge branch '1.5.x' 8 years ago
Phillip Webb 72813a47e7 Polish 8 years ago
Phillip Webb 76ee2f401c Polish 8 years ago
Andy Wilkinson 1ee9653f7c Group tasks and provide descriptions for tasks and configurations
Closes gh-8817
8 years ago
Phillip Webb 4db4c81b9b Polish 8 years ago
Brian Clozel 3cc0f7b70d Document embedded web server refactoring
Closes gh-8532
8 years ago
Michael J. Simons 4a58e87201 Remove references to *EmbeddedServletContainerFactory
See gh-8532
8 years ago
Michael J. Simons 0436070b98 Fix docs howto customize the embedded webserver
This reflects the changes from 67556ba8.
See gh-8532.
8 years ago
Andy Wilkinson 762a13e84f Configure assemble to depend upon bootJar or bootWar
Closes gh-8824
8 years ago
Andy Wilkinson 0a8494ec74 Merge branch '1.5.x' 8 years ago
Andy Wilkinson df05aa4701 Merge branch '1.4.x' into 1.5.x 8 years ago
Andy Wilkinson bd95ad6430 Upgrade to Spring Restdocs 1.1.3.RELEASE
Closes gh-9040
8 years ago
Andy Wilkinson 5291fb5ff7 Upgrade to Hsqldb 2.3.5
Closes gh-9039
8 years ago
Andy Wilkinson 344255807b Upgrade to Jaybird 2.2.13
Closes gh-9038
8 years ago
Andy Wilkinson 59d04d0679 Upgrade to Elasticsearch 2.4.5
Closes gh-9037
8 years ago
Andy Wilkinson c3c2a91916 Upgrade to Groovy 2.4.11
Closes gh-9036
8 years ago
Andy Wilkinson bc464adba3 Upgrade to Tomcat 8.5.14
Closes gh-9035
8 years ago
Andy Wilkinson b5811986b0 Upgrade to Ehcache 2.10.4
Closes gh-9034
8 years ago
Andy Wilkinson d0a85550d7 Upgrade to H2 1.4.195
Closes gh-9033
8 years ago
Stephane Nicoll 7c4a1a221d Merge branch '1.5.x' 8 years ago
Brian Clozel b8fe06c103 Manage all Netty dependencies
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
8 years ago
Brian Clozel f2c63706da Change default file extension for Mustache templates
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
8 years ago
Brian Clozel 4d5dcca553 Add Thymeleaf auto-configuration for WebFlux
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
8 years ago
Stephane Nicoll 1de2316a0b Refine validator and MVC validator configuration
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
8 years ago
Stephane Nicoll f42998f5ca Revert "Refine validator and MVC validator configuration"
This commit reverts c9561f0 and 69a8c0d and effectivly fixes gh-8979 but
reintroduces the issue reported in gh-8495.
8 years ago
Stephane Nicoll d4f87ae74e Polish 8 years ago
Stephane Nicoll 461cca3269 Merge pull request #9020 from artembilan:Spring_Kafka_2.0.0.M1
* pr/9020:
  Upgrade to Spring Kafka 2.0.0.M1
8 years ago
Artem Bilan 8e68511eb3 Upgrade to Spring Kafka 2.0.0.M1
Closes gh-9020
8 years ago
Phillip Webb 86ce474108 Fix malformed javadoc
See gh-9000
8 years ago
Madhura Bhave ac9f380c55 Test binding of Set
Add a test to ensure that the new binder can bind correctly to a
Set.

Closes gh-1415
8 years ago
Phillip Webb 25f0b3482c Rework configuration properties support
Closes gh-9000
8 years ago
Madhura Bhave 4e3d280378 Delete deprecate relaxed binder code
Remove the deprecated relaxed binder code that has now been replaced
with the configuration properties binder.

Closes gh-9000
8 years ago
Madhura Bhave 5edb1194f5 Test binding of Map<String, String[]>
Add a test to ensure that the new binder can bind correctly to a
Map<String,String[]>.

Closes gh-3789
8 years ago
Madhura Bhave 6184e4154e Test correct binding in '/info' endpoint
Add a test to ensure that the updated configuration properties work
correctly binds environment sources in the `/info` endpoint.

Closes gh-7388
8 years ago