639 Commits

Author SHA1 Message Date
Phillip Webb
f9da113943 Exclude FileEditor from binding conversion
Exclude `FileEditor` from the `BindConverter` since it uses slightly
unusual logic to create the file. Specifically, given a value of "."
the editor will locate a `ClassPathResource` then return `getFile()`
from that resource. For back-compatibility, binding should use the
simpler conversion service logic.

Fixes gh-12163
2018-02-22 22:01:37 -08:00
Phillip Webb
7e10d86ed3 Polish 2018-02-22 21:37:31 -08:00
Phillip Webb
3dea6fc645 Fix bind TypeConverter delegation with collections
Update `BindConverter` so that delegation to `SimpleTypeConverter` also
works with Collections and Arrays.

Prior to this commit, conversion that relied on a `PropertyEditor` would
only work for simple types. For example, "String -> Class<?>" would use
the `ClassEditor` but "String -> List<Class<?>>" would fail.

The `BindConverter` now uses a minimal `ConversionService` as an adapter
to the `SimpleTypeConverter`. This allows us to use the same delimited
string conversion logic as the `ApplicationConverter`.

Fixes gh-12166
2018-02-22 21:26:36 -08:00
Phillip Webb
4b9c3c137e Polish Collection.toArray
Consistently use `StringUtils.toStringArray`, `ClassUtils.toClassArray`
or zero length when converting collections to arrays.

Fixes gh-12160
2018-02-22 21:11:30 -08:00
Phillip Webb
cd5266ac03 Polish 2018-02-22 20:25:28 -08:00
Johnny Lim
2fe86da95b Use isTrue() and isFalse() for AssertJ
Closes gh-12170
2018-02-22 09:55:40 +01:00
Johnny Lim
50c07d0772 Polish
Closes gh-12156
2018-02-21 17:46:57 +01:00
Madhura Bhave
33be78a91e Add additional profile negation tests
Closes gh-8011
2018-02-21 01:57:03 -08:00
Phillip Webb
4bde6b80ee Refactor YAML profile to deal with "!" profiles
Drop `SpringProfileDocumentMatcher` and replace it with two new
implementations that restrict when YAML documents are loaded. YAML
sections are now restricted both on the specific profile that is being
loaded, and the profiles that are currently accepted.

The `PropertySourceLoader` interface has been refined to include a
predicate that determines when a profile is accepted. The
`ConfigFileApplicationListener` simply delegates the predicate logic to
the `Environment`.

Fixes gh-8011
2018-02-21 01:57:03 -08:00
Phillip Webb
46021928ba Rework common server customization
Update the configurable embedded web server factory interfaces to
extend `ConfigurableWebServerFactory` so that the can be used in a
`WebServerFactoryCustomizer`.

Extract server specific customization to their own auto-configuration
and align reactive/servlet server auto-configuration.

Closes gh-8573
2018-02-20 16:27:15 -08:00
Phillip Webb
05faac2b09 Polish 2018-02-20 15:53:25 -08:00
Phillip Webb
cdb5677375 Polish Binder constructor
Reinstate constructor signature used by Spring Cloud and improve
javadoc.

Closes gh-12095
2018-02-20 15:36:43 -08:00
Andy Wilkinson
b5e2c5ec1c Polish 2018-02-20 19:58:39 +00:00
Stephane Nicoll
ce01a9145b Polish 2018-02-20 18:45:36 +01:00
Stephane Nicoll
1b8f0d06a7 Test that custom ProtocolResolver is invoked
See gh-11659
2018-02-20 14:45:51 +01:00
Phillip Webb
20109e27be Add ApplicationConversionService and fix binder
Create a new `ApplicationConversionService` similar in design to the
DefaultFormattingConversionService from Spring Framework. The new
conversion service provides a central place for custom conversion logic
supported by Spring Boot.

Also replace the `BindingConversionService` with an internal
`BindConverter` class that now invokes the `SimpleTypeConverter`
directly. Binding for `@ConfigurationProperties` has been updated so
that any custom property editors registered with the BeanFactory can
be used.

Fixes gh-12095
2018-02-19 20:25:47 -08:00
Phillip Webb
61f44179cb Relocate XA wrapper types
Move `XADataSourceWrapper` to `jdb` and `XAConnectionFactoryWrapper` to
`jms` so that they are packaged in a similar way to the underlying XA
types.

Fixes gh-12061
2018-02-19 20:22:03 -08:00
igor-suhorukov
fe023817c7 Polish static finals
Closes gh-12083
2018-02-19 20:10:58 -08:00
Johnny Lim
88b184ca23 Polish 2018-02-19 20:00:20 -08:00
Phillip Webb
adf22d6e4a Polish 2018-02-19 19:54:10 -08:00
Phillip Webb
1d83e87bcd Validate @ConfigurationProperties on @Bean methods
Refactor `ConfigurationPropertiesBindingPostProcessor` to allow JSR-303
validation on `@ConfigurationProperties` defined at the `@Bean` method
level.

JSR-303 validation is now applied when a JSR-303 implementation is
available and `@Validated` is present on either the configuration
properties class itself or the `@Bean` method that creates it.

Standard Spring validation is also supported using a validator bean
named `configurationPropertiesValidator`, or by having the configuration
properties implement `Validator`.

The commit also consolidates tests into a single location.

Fixes gh-10803
2018-02-16 18:11:54 -08:00
Phillip Webb
9e75680e6f Polish 2018-02-16 18:11:54 -08:00
Andy Wilkinson
a1ba2de06b Merge branch '1.5.x' 2018-02-14 17:22:52 +00:00
Phillip Webb
45347af62e Allow lifecycleTimeout to be set for Netty
Update `NettyReactiveWebServerFactory` and `NettyWebServer` to allow
the lifecycle (start/stop) timeout to be configured.

Fixes gh-10977
2018-02-13 15:16:29 -08:00
dreis2211
cd0c5ba4d5 Polish BannerTests
Closes gh-12029
2018-02-13 14:55:40 -08:00
igor-suhorukov
e98b93844a Polish static final usage for constants
Closes gh-12032
2018-02-13 14:53:26 -08:00
Andy Wilkinson
214c7ebdd5 Start building against Spring Framework 5.0.4 snapshots again
This reverts commit 682612efa38bcef2c6ae404ed27be86c5b0a6216.
2018-02-13 17:42:16 +00:00
Andy Wilkinson
682612efa3 Revert "Start building against Spring Framework 5.0.4 snapshots"
This reverts commit 9dd7b0689dba7f55605334240229b53aa553c664.
2018-02-13 16:24:26 +00:00
Andy Wilkinson
9dd7b0689d Start building against Spring Framework 5.0.4 snapshots
This reverts commit f24c92c6584a785cf77b4a6f2e15804301e7c3c1 which is
no longer necessary as SPR-16456 has no been fixed.

See gh-11894
2018-02-13 13:43:47 +00:00
Andy Wilkinson
db4ffbbc4b Expose constants for Spring application JSON property names
Closes gh-12012
2018-02-13 13:22:50 +00:00
Johnny Lim
87bf0b26df Polish modifier order
See gh-12019
2018-02-13 09:49:59 +01:00
Stephane Nicoll
31da4cc35d Polish "Remove redundant casts"
Closes gh-12011
2018-02-13 09:34:08 +01:00
igor-suhorukov
71351de694 Remove redundant casts
See gh-12011
2018-02-13 09:33:49 +01:00
Phillip Webb
d6858ae162 Fix ConfigurationPropertySources parent attach
Update `ConfigurationPropertySources` so that the underlying sources
are checked when attaching. Prior to this commit, in a parent/child
setup the `ConfigurationPropertySources` adapter may already present
on the parent. This means the attaching is skipped but the managed
sources are incorrect.

Fixes gh-12013
2018-02-12 17:49:53 -08:00
Johnny Lim
5a9865dabb Polish
Closes gh-12004
2018-02-12 17:10:43 +01:00
Stephane Nicoll
c97a9a0cb2 Merge branch '1.5.x' 2018-02-12 17:08:09 +01:00
Andy Wilkinson
2b9006b3fd Accumulate config classes across register calls
Closes gh-11998
2018-02-12 09:59:31 +00:00
Stephane Nicoll
5e0df39c66 Merge branch '1.5.x' 2018-02-10 15:06:16 +01:00
Stephane Nicoll
a97a762086 Only set mapping resources when present
This commit sets a mapping resources list only when there is at least an
element in it. This allows the default fallback of finding an "orm.xml"
file to kick in when no customization has been applied.

Closes gh-11964
2018-02-09 12:01:08 +01:00
Phillip Webb
5de46c3186 Polish 2018-02-08 16:35:10 -08:00
Andy Wilkinson
5522174e96 Provide package info for all packages included in javadoc 2018-02-08 16:50:37 +00:00
Andy Wilkinson
dec37ec5e2 Move EndpointMapping into spring-boot-actuator 2018-02-08 15:13:27 +00:00
Andy Wilkinson
a09c64e18c Polish 2018-02-08 11:15:36 +00:00
Andy Wilkinson
76a450dfba Format with Eclipse Oxygen SR2 2018-02-08 10:53:53 +00:00
Madhura Bhave
761bcffc13 Consider generic information on @Bean method for bind
Fixes gh-11931
2018-02-07 13:55:09 -08:00
Madhura Bhave
dd3bcc5691 Polish 2018-02-07 13:55:09 -08:00
Madhura Bhave
7d53c54364 Fallback to Object.class if ResolvableType can't resolve
Fixes gh-11908
2018-02-07 13:37:43 -08:00
dreis2211
7108a1fc49 Optimize ApplicationHome.isUnitTest()
Closes gh-11910
2018-02-07 12:57:03 +01:00
Phillip Webb
6889ad59b8 Support property based MeterFilters
Add per-meter property support for `enabled`, `percentiles-histogram`,
`percentiles` and `sla`.

Fixes gh-11800
2018-02-06 13:21:27 -08:00
Phillip Webb
b5c4ce230d Ensure full commit id is always available
Update `GitProperties` so that the `commit.id` entry is also copied to
`commit.id.full`.

Prior to this commit, when returning full details, the value of
`commit.id` would be replaced with a `Map` containing only `abbriv` as
a key. By  copying the value to a sub-key we ensure that it remains
available both in the FULL and SIMPLE modes.

Fixes gh-11892
2018-02-02 19:00:35 -08:00