Commit Graph

1716 Commits

Author SHA1 Message Date
Stephane Nicoll fc60301fc7 Polish "Add Java 14 to JavaVersion enumeration"
See gh-19511
2020-01-04 11:45:43 +01:00
Dmytro Nosan a5a3a020b6 Add Java 14 to JavaVersion enumeration
See gh-19511
2020-01-04 11:44:03 +01:00
Madhura Bhave f94c6d7458 Merge branch '2.2.x' 2020-01-03 11:42:42 -08:00
Madhura Bhave 8e285a4387 Fix checkstyle 2020-01-03 11:42:14 -08:00
Madhura Bhave 743cf3b2a7 Merge branch '2.2.x'
Closes gh-19527
2020-01-03 11:21:50 -08:00
Madhura Bhave ac46f5971f Merge branch '2.1.x' into 2.2.x
Closes gh-19526
2020-01-03 11:19:21 -08:00
Madhura Bhave 24dd416f4b Add a test case for binding to map with wildcard types
This commit also changes the spring framework version
to use snapshots.

Closes gh-18767
2020-01-03 11:13:41 -08:00
Stephane Nicoll 6fc52b0563 Polish 2020-01-01 09:16:53 +01:00
Stephane Nicoll 2148097c04 Merge branch '2.2.x'
Closes gh-19497
2019-12-31 09:36:27 +01:00
Stephane Nicoll b7e6febaa0 Merge branch '2.1.x' into 2.2.x
Closes gh-19496
2019-12-31 09:36:05 +01:00
Zekariyas f005fffbc3 Fix typo in BindHandler#onFinish javadoc
See gh-19492
2019-12-31 09:34:45 +01:00
Stephane Nicoll 2c1e81adf0 Polish 2019-12-26 10:42:40 +01:00
Stephane Nicoll bd179393ea Merge branch '2.2.x'
Closes gh-19428
2019-12-21 16:34:47 +01:00
dark 4f99c9f281 Remove unused import statement
See gh-19410
2019-12-21 16:33:53 +01:00
Andy Wilkinson be4c4f9c13 Merge branch '2.2.x'
Closes gh-19420
2019-12-20 15:41:24 +00:00
Andy Wilkinson 0e6932d550 Merge branch '2.1.x' into 2.2.x
Closes gh-19419
2019-12-20 15:41:02 +00:00
Andy Wilkinson 35b74185e4 Fix test ordering problems by always clearing URL stream handler factory
Closes gh-19349
2019-12-20 15:36:39 +00:00
Andy Wilkinson 07857f7f24 Merge branch '2.2.x'
Closes gh-19418
2019-12-20 15:28:40 +00:00
Andy Wilkinson 8ed0b1a231 Merge branch '2.1.x' into 2.2.x
Closes gh-19417
2019-12-20 15:28:11 +00:00
Andy Wilkinson 3cadde0900 Protect against available port actually being unavailable
Closes gh-19355
2019-12-20 15:22:30 +00:00
Phillip Webb 695de2c6f5 Polish end-to-end configuration properties tracing
See gh-14880
2019-12-13 12:47:01 -08:00
Phillip Webb 830c2ef7f1 Polish 2019-12-13 11:47:42 -08:00
Phillip Webb be3b11db48 Merge branch '2.2.x' 2019-12-13 11:47:04 -08:00
Phillip Webb 6d372f60d9 Merge branch '2.1.x' into 2.2.x 2019-12-13 11:46:25 -08:00
Phillip Webb 8e03982bca Fix checkstyle violation 2019-12-13 11:45:56 -08:00
Phillip Webb 2fc12bc36c Merge branch '2.2.x' 2019-12-13 11:30:13 -08:00
Phillip Webb 26ff18f37d Merge branch '2.1.x' into 2.2.x 2019-12-13 11:29:51 -08:00
Phillip Webb 9bdad06c10 Polish Netty SSL key alias support
See gh-19197
2019-12-13 11:21:42 -08:00
Madhura Bhave 8dcf1e4033 Provide end-to-end traceability for config properties
Closes gh-14880

Co-authored-by: Andy Wilkinson <awilkinson@pivotal.io>
2019-12-12 17:02:46 -08:00
Andy Wilkinson 4957994def Merge branch '2.2.x'
Closes gh-19305
2019-12-05 12:54:21 +00:00
Andy Wilkinson 3c0e7ccba6 Merge branch '2.1.x' into 2.2.x
Closes gh-19304
2019-12-05 12:53:36 +00:00
Andy Wilkinson effdc8f359 Polish "Honour SSL key alias when using Netty"
See gh-19197
2019-12-05 12:48:13 +00:00
cbono eda7b7c3e6 Honour SSL key alias when using Netty
See gh-19197
2019-12-05 12:10:04 +00:00
Madhura Bhave 201cad970a Merge branch '2.2.x'
Closes gh-19217
2019-12-03 18:22:41 -08:00
Madhura Bhave 68bc82cfc2 Ignore CannotLoadBeanClassException in config props validator
If the bean definition type contains a placeholder value, beanFactory.getType
can throw a CannotLoadBeanClassException. We can ignore this exception while
validating the bean definitions for constructor binding beans.

Fixes gh-19207
2019-12-03 18:21:53 -08:00
Madhura Bhave 1c3526f6b6 Merge branch '2.2.x'
Closes gh-19216
2019-12-03 09:30:34 -08:00
Madhura Bhave f4db8c89d4 Use generic type when binding constructor parameters
Fixes gh-19156
2019-12-03 09:29:51 -08:00
dreis2211 8a730ff630 Use DateTimeFormatter in favor of SimpleDateFormat
See gh-19142
2019-11-27 11:07:56 +01:00
Stephane Nicoll 4c7896b936 Polish "Add support for test containers jdbc url"
See gh-19044
2019-11-27 11:04:02 +01:00
Leo Li 7b1b18cd77 Add support for test containers jdbc url
See gh-19044
2019-11-27 11:04:02 +01:00
Andy Wilkinson f2bd27f4a3 Merge branch '2.1.x' into 2.2.x
See gh-19150
2019-11-27 09:56:41 +00:00
Andy Wilkinson f117dbe8a1 Add metadata for spring.main.log-startup.info
See gh-19026
2019-11-27 09:55:06 +00:00
Stephane Nicoll d8c64abdbb Merge branch '2.1.x' into 2.2.x
Closes gh-19086
2019-11-21 13:42:32 +01:00
Stephane Nicoll b23a3712c6 Polish "Fix logging in CloudFoundryVcapEnvironmentPostProcessor"
See gh-19027
2019-11-21 13:41:47 +01:00
Mark Bigler f1489e41ec Fix logging in CloudFoundryVcapEnvironmentPostProcessor
See gh-19027
2019-11-21 13:35:50 +01:00
Madhura Bhave b6ff0b7c5f Support constructor binding on 3rd party classes
Closes gh-18935
2019-11-13 14:28:58 -08:00
Stephane Nicoll 51487c7c45 Merge branch '2.1.x' into 2.2.x 2019-11-12 14:04:47 +01:00
Stephane Nicoll cad2365237 Polish 2019-11-12 14:03:39 +01:00
Andy Wilkinson e715a5f689 Merge branch '2.1.x' into 2.2.x
Closes gh-18943
2019-11-08 15:01:19 +00:00
Andy Wilkinson 3f0367e2dd Apply changes recommended by Jetty team to JettyEmbeddedErrorHandler
Closes gh-18842
2019-11-08 14:57:46 +00:00
Andy Wilkinson 0a8a0daff8 Merge branch '2.1.x'
Closes gh-18913
2019-11-07 09:56:49 +00:00
Andy Wilkinson a11661d284 Trim whitespace in BasicJsonParser
Previously, whitespace in between the keys and values in the JSON was
not trimmed correctly in BasicJsonParser which lead to it incorrectly
parsing JSON with whitespace between the opening of a list ([) and the
opening of a map ({).

This commit updates the parser to trim unwanted whitespace and adds a
test to AbstractJsonParserTests to verify the whitespace handling
behaviour across all JsonParser implementations.

Closes gh-18911
2019-11-07 09:56:00 +00:00
Andy Wilkinson dd4377e69c Merge branch '2.1.x'
Closes gh-18912
2019-11-07 09:33:11 +00:00
Andy Wilkinson d1ead884c4 Fix @ServletComponentScan with a component index
Previously @ServletComponentScan did not work when there was a
component index on the classpath as it made an assumption about
the concrete type of the BeanDefinitions produced by scanning that
does not hold true when an index is present.

This commit updates the scanning and the handlers to correct the
assumpution by working with a bean definition type that is produced
by scanning both when there is and when there is not an index present.

To prevent the problem from reoccuring, a test that uses and index
has been added and the import of ScannedGenericBeanDefinition is now
prohibited by Checkstyle.

Closes gh-18910
2019-11-07 09:20:19 +00:00
Madhura Bhave 471ca01ccf Do not validate value object bean definion when singleton present
Prior to this commit constructor bound configuration properties could
not be mocked because it would fail validation from
ConfigurationPropertiesBeanDefinitionValidator. The MockitoPostProcessor
registers the mocked bean as a singleton and validation can be skipped if a
singleton for the type is found in the bean factory.

Fixes gh-18652
2019-11-05 21:54:16 -08:00
Madhura Bhave f9785d2bda Fix constructor binding issues
This commit fixes a few bugs related to constructor binding.
The ContructorFilter on the Bindable has been replaced with a
Binder level BinderConstructorProvider so that it can be used to
determine the constructor to use for nested properties as well.

Fixes gh-18810
Fixes gh-18670
Closes gh-18685
Closes gh-18894

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-11-05 14:44:31 -08:00
dreis2211 689e02923f Remove non-existent FailureAnalyzer from spring.factories
See gh-18864
2019-11-05 09:28:21 +01:00
Cosmin Humeniuc d8d24e75e3 Delete Javadoc references to removed code
See gh-18755
2019-10-27 08:36:02 +01:00
dreis2211 9ece2e277f Remove redundant explicit types
See gh-18754
2019-10-27 08:33:01 +01:00
Madhura Bhave 4058f99383 Fix import 2019-10-25 16:29:23 -07:00
Madhura Bhave dec6ee20d4 Fix error message when constructor binding fails to create bean
The configuration property is always cleared before bean instantiation
because the problem with bean instantiation might not necessarily be the
last bound property.

Fixes gh-18704
2019-10-25 16:07:33 -07:00
Andy Wilkinson 533ca0624f Merge branch '2.1.x'
Closes gh-18749
2019-10-25 14:38:16 +01:00
Andy Wilkinson 65ef03a5bf Remove nulls from description for bean defs with no res description
Previously, if a bean definition had no resource description, the
failure analysis description would state that the been had been
defined in null which was of no use to the user.

This commit updates the failure analysis to omit information about
where the bean was definied when the definition has no resource
description.

Fixes gh-18721
2019-10-25 14:26:55 +01:00
Phillip Webb 597baf9774 Polish "Optimize logger calls"
See gh-18710
2019-10-23 21:00:05 -07:00
wycm 240b1f9e29 Optimize logger calls
Guard logger calls to ensure that they are only made when the
level is set.

See gh-18710
2019-10-23 20:59:11 -07:00
Phillip Webb 744dcd9426 Limit ConfigurationPropertiesBean candidates
Update `ConfigurationPropertiesBean.getAll()` to limit the candidate
beans that will actually need a `getBean()` call. Prior to this commit
calling `getAll()` would trigger a get of every bean in the context,
some of which might fail.

Fixes gh-18714
2019-10-23 19:49:45 -07:00
Johnny Lim 8c2d6b28f8 Polish
See gh-18697
2019-10-23 10:09:56 +02:00
dreis2211 8ecdf919f8 Fix Mockito deprecations
See gh-18689
2019-10-23 09:49:33 +02:00
Phillip Webb 8d08d654d1 Merge branch '2.1.x'
Closes gh-18693
2019-10-22 15:18:32 -07:00
Phillip Webb d0d55d3c0a Polish "Upgrade to Jetty 9.4.21.v20190926"
See gh-18536
2019-10-22 14:54:43 -07:00
dreis2211 eae2cf170d Upgrade to Jetty 9.4.21.v20190926
See gh-18536
2019-10-22 14:53:41 -07:00
Phillip Webb 374a8cadad Merge branch '2.1.x'
Closes gh-18691
2019-10-22 13:20:42 -07:00
Phillip Webb 867c4a14cb Clarify Javadoc for ServletContextInitializer
Closes gh-18660
2019-10-22 13:16:02 -07:00
Phillip Webb 714c9b9804 Polish 2019-10-22 13:12:09 -07:00
Stephane Nicoll 6e6f4f763c Remove useless attribute override
This commit removes the override proxyBeanMethods as the aliased
attribute is taking precedence.
2019-10-22 14:04:20 +02:00
Stephane Nicoll 4d5d90847e Merge branch '2.1.x'
Closes gh-18682
2019-10-22 09:41:04 +02:00
wycm 681a94b0d5 Optimize debug level logs
See gh-18604
2019-10-22 09:36:48 +02:00
Stephane Nicoll bd4dc1ef2a Merge branch '2.1.x'
Closes gh-18669
2019-10-21 09:19:50 +02:00
xiaokeliu666 57c64eb3bc Polish
See gh-18665
2019-10-21 09:15:16 +02:00
Andy Wilkinson fd1d653c34 Rename socket factory processor methods on NettyRSocketServerFactory
Previously, the methods were named addServerProcessors and
setServerProcessors which wasn't aligned with them taking
socket factory processors (ServerRSocketFactoryProcessor) as an
argument.

This commit renames the methods to align them more closely with the
type of their arguments.

Closes gh-18617
2019-10-16 13:39:42 +01:00
Stephane Nicoll 2bf8073446 Polish
See gh-18440
2019-10-15 14:08:38 +02:00
Andy Wilkinson b240c810a8 Fix @ConfigurationProperties on @Bean methods without metadata caching
Due to a current limitation of Spring Framework, when bean metadata
caching is disabled, a merged bean definition may have a null
resolved factory method that would have been non-null if bean metadata
caching was enabled. Configuration property binding for @Bean methods
annotated with @ConfigurationProperties relied upon the resolved
factory method being enabled to find the @ConfigurationProperties
annotation and trigger property binding. As a result, when bean
metadata caching is disabled on the bean factory, such
@ConfigurationProperties beans would not be bound.

This commit works around the limitation by adding a fallback that
performs a reflection-based search for the factory method when the
resolved factory method on the bean definition is null. This allows
the bean's factory method and any @ConfigurationProperties annotation
on it to be found, ensuring that propoerty binding is then performed.

Fixes gh-18440
2019-10-15 11:21:53 +01:00
Stephane Nicoll 391eb279df Merge branch '2.1.x'
Closes gh-18588
2019-10-15 08:51:31 +02:00
Stephane Nicoll 22f44917ca Polish "Add metadata entry for spring.main.register-shutdown-hook"
See gh-18581
2019-10-15 08:41:07 +02:00
leoli 9b781449cf Add metadata entry for spring.main.register-shutdown-hook
See gh-18581
2019-10-15 08:37:08 +02:00
Stephane Nicoll 98f676ca46 Merge branch '2.1.x'
Closes gh-18586
2019-10-15 08:25:25 +02:00
contextshuffling efedd80d4b Use LinkedHashSet for deterministic order in test assertions
See gh-18580
2019-10-15 08:20:53 +02:00
Stephane Nicoll 9c6e5f0904 Merge branch '2.1.x'
Closes gh-18585
2019-10-15 08:15:42 +02:00
dreis2211 abfb87d1a3 Rename tests to match Surefire expectations
See gh-18579
2019-10-15 08:11:47 +02:00
Phillip Webb e20aa7dc73 Clarify ConfigurationPropertiesBean Javadoc
Update the `ConfigurationPropertiesBean` Javadoc to clarify its purpose.

Closes gh-18487
2019-10-14 20:50:42 -07:00
Andy Wilkinson 3fc51f8063 Isolate the effects of initializing Reactor's debug agent in the tests 2019-10-14 20:08:59 +01:00
Andy Wilkinson e7efe0cbfe Merge branch '2.1.x'
Closes gh-18576
2019-10-14 14:12:57 +01:00
王洋 152568521e Make the logger static final
See gh-18575
2019-10-14 14:12:26 +01:00
Andy Wilkinson c75b06c76c Remove @ImmutableConfigurationProperties
Closes gh-18563
2019-10-14 11:29:09 +01:00
Stephane Nicoll 61a914fa28 Polish 2019-10-11 10:39:23 -05:00
Stephane Nicoll 40bd98a3f4 Polish "Remove boxing"
See gh-18552
2019-10-11 10:35:19 -05:00
clove506 fe6da39e1b Remove boxing
See gh-18552
2019-10-11 10:32:59 -05:00
Andy Wilkinson e62ca778e9 Merge branch '2.1.x'
Closes gh-18554
2019-10-10 07:29:57 -05:00
dreis2211 ba46ab6a4f Remove accidental usage of UnsupportedOptionException
See gh-18539
2019-10-10 07:28:51 -05:00
Johnny Lim e9e6c925e8 Remove a duplicate assertion
See gh-18524
2019-10-07 08:19:11 -05:00
Phillip Webb be7a7bb2e9 Refine String to File conversion support
Refine the conversion support so that file URLs are support without
reintroducing gh-12163.

Closes gh-16931
2019-10-02 22:45:22 -07:00
Johnny Lim 701bd0dd46 Polish
See gh-18490
2019-10-02 22:15:05 -07:00
Phillip Webb 3c7d3f9482 Add String to File conversion support
Add `String` -> `File` support to the `ApplicationConversionService`
that can support both simple filename as well as file URLs.

This allows Spring Boot application to work in a similar way to vanilla
Spring applications where Spring's `FileEditor` provides similar
support.

Closes gh-16931
2019-10-02 21:41:31 -07:00
Madhura Bhave fcbd4408c9 Fix @since tag 2019-10-02 18:04:51 -07:00
Phillip Webb 386c0a60a7 Relax @ConstructorBinding member class requirement
Update `@ConfigurationProperties` so that `@ConstructorBinding` classes
no longer need to repeat the annotation for their members.

Closes gh-18481
2019-10-02 17:17:44 -07:00
Phillip Webb 9582aa3f3c Remove accidentally committed debug sysout 2019-10-02 16:04:50 -07:00
Phillip Webb b1f23f54df Prevent ValueBinder from being incorrectly used
Fix a regression caused by e41c5a43 which incorrectly allowed the
`ValueObjectBinder` to be picked when the `JavaBeanBinder` should
have been used.

Closes gh-18485
2019-10-02 15:47:36 -07:00
Madhura Bhave 5547a8499f Polish 2019-10-02 14:41:01 -07:00
Madhura Bhave 58fc337315 Polish 2019-10-02 14:30:49 -07:00
Phillip Webb 4208c93ba7 Validate @ConfigurationProperties bean definitions
Add a bean definition post-processor that throws a better exception
if @ConstructorBinding property beans are being instantiated as
regular Spring beans.

Prior to this commit, a constructor bound properties bean would fail
with an unsatisfied dependency exception which isn't all that helpful.

Closes gh-17831
2019-10-02 12:51:36 -07:00
Phillip Webb 71f8347c81 Rename ServerRSocketFactoryCustomizer
Rename `ServerRSocketFactoryCustomizer` to
`ServerRSocketFactoryProcessor` to better reflect that it is not a
traditional customizer.

Closes gh-18390
2019-10-02 10:41:53 -07:00
Andy Wilkinson 46c30d6bb0 Merge branch '2.1.x'
Closes gh-18476
2019-10-02 10:48:57 +01:00
Andy Wilkinson 3d4157ad6d Correct SCM URLs in published poms
Previously, Maven's default behaviour was relied up which resulted
in the artifact ID being appended to each URL as it was inherited.
This behaviour can only be disabled in Maven 3.6 and later, a version
that we cannot use due to an incompatibility with the Flatten Plugin.

This commit works around Maven's default behaviour by defining
properties for the SCM URL, connection, and developer connection and
then explicitly defining the settings in each pom using these
properties. The explicit definition of the properties in each pom
prevents them being inherited from the parent, thereby disabling the
unwanted appending of the artifact ID to the URL.

Fixes gh-18328
2019-10-02 10:48:30 +01:00
Phillip Webb e41c5a4327 Require annotation signal for constructor binding
Update `@ConfigurationProperties` constructor binding support to only
apply when a `@ConstructorBinding` annotation is present on either the
type or the specific constructor to use.

Prior to this commit we didn't have a good way to tell when constructor
binding should be used vs regular autowiring.

For convenience, an `@ImmutableConfigurationProperties` meta-annotation
has also been added which is composed of `@ConfigurationProperties` and
`@ConstructorBinding`.

Closes gh-18469
2019-10-01 21:56:09 -07:00
Phillip Webb b262ebf5b4 Update copyright header of changed files 2019-10-01 11:40:07 -07:00
Phillip Webb 062163b52f Fix package tangle with configuration properties
Fix a package tangle that was introduced when we added cache bypass to
`SpringIterableConfigurationPropertySource`. Ideally we should have
been able to depend on `env` from `context` but unfortunately the
`EnvironmentPostProcessor` interface references `SpringApplication`
which needs to use the Binder.

The `isImmutable` method has now been moved to `OriginLookup` which
removes the immediate tangle.

Closes gh-18393
2019-09-28 22:04:44 -07:00
Phillip Webb 615c6d4e86 Restructure RSocket packages and polish
Polish code and relocate `RSocketServerBootstrap` from `server` to
`context` since it's really an `ApplicationContext` concern.

Closes gh-18391
2019-09-28 22:04:30 -07:00
Phillip Webb 4b0fb8ff24 Polish 'Add @LocalRSocketServerPort support'
See gh-18287
2019-09-28 22:03:36 -07:00
Verónica Vásquez 3c8fa3bbd0 Add @LocalRSocketServerPort support
Add an appication context initializer to detect and store the
active RSocket port in the Environment under
`local.rsocket.server.port`.

Additionally add a `@LocalServerPort` that provides a convenient
alternative to `@Value`.

See gh-18287

Co-authored-by: Eddú Meléndez <eddu.melendez@gmail.com>
2019-09-28 22:03:36 -07:00
Phillip Webb 3ffc5f2a30 Polish 'Support programmatic lazy-int exclusion'
See gh-16615
2019-09-26 21:24:51 -07:00
Tyler Van Gorder 0f26f4d6e2 Support programmatic lazy-int exclusion
Allow the `LazyInitializationBeanFactoryPostProcessor` to skip setting
lazy-init based on a programmatic callback. This feature allows
downstream projects to deal with edge-cases in which it is not easy to
support lazy-loading (such as in DSLs that dynamically create additional
beans).

See gh-16615
2019-09-26 21:22:36 -07:00
Phillip Webb a13666d696 Polish "Simplify code"
See gh-18342
2019-09-26 19:12:18 -07:00
Yuyan 4d0da4b700 Simplify code
See gh-18342
2019-09-26 19:09:28 -07:00
dreis2211 4262aab446 Fix deprecation warnings caused by BodyInserters.fromObject
See gh-18349
2019-09-25 13:57:17 +01:00
dreis2211 d89adfac91 Test compression with invalid content type for all webservers
Closes gh-18338
2019-09-24 10:03:38 +01:00
dreis2211 7bc28fc646 Test compression with invalid content type for all webservers
See gh-18337
2019-09-24 09:57:28 +01:00
Andy Wilkinson e6d60d937e Ensure the use of UTF-8 encoding in ImageBannerTests
Closes gh-18301
2019-09-22 20:31:51 +01:00
Andy Wilkinson ec2483e897 Polish assertions in ImageBannerTests 2019-09-22 19:44:50 +01:00
Phillip Webb b3141d8887 Use hexadecimal for string compare failure
Update `ImageBannerTests` to use `inHexacecimal()` to help with
failure logs.

See gh-18301
2019-09-22 09:46:58 -07:00
Phillip Webb 303974fde9 Add block pixel mode support for image banners
Add support for a `spring.banner.image.pixelmode` property which can
be set to `block` to use unicode block characters when rendering image
banners.

Closes gh-18301
2019-09-22 00:18:54 -07:00
Phillip Webb 4ef1e18216 Add ANSI 8-bit color image banner support
Update `ImageBanner` and `AnsiColors` to optionally support 8-bit
color output.

See gh-18264
2019-09-21 23:30:05 -07:00
Phillip Webb 7f79c26b6b Polish 'Add ANSI 8-bit color support'
See gh-18264
2019-09-21 23:30:05 -07:00
Toshiaki Maki 65a27ef6d6 Add ANSI 8-bit color support
Update ANSI property support to include an 8-bit (256 color) option.

See gh-18264
2019-09-21 23:15:58 -07:00
Phillip Webb 5ca5ec8395 Merge branch '2.1.x'
Closes gh-18299
2019-09-21 12:46:13 -07:00
Phillip Webb 1ceb96f9f2 Ensure matches is not called before initialization
Update `ApplicationContextRequestMatcher` to ensure that the `matches`
method is never called before `initialized`. This fixes an issue
accidentally introduced in commit 5938ca78 where concurrent calls
to `matches` could trigger unexpected errors due to the fact that the
second call proceeded before the `initialized` method had returned.

Fixes gh-18211
2019-09-21 12:29:46 -07:00
Phillip Webb 5427526bcc Fix ApplicationContextRequestMatcher javadoc
Fix an error in the `ApplicationContextRequestMatcher` javadoc.
2019-09-21 12:28:58 -07:00
Phillip Webb 221ff0ff6d Polish configuration property bean classes
Refactor the `org.springframework.boot.actuate.context` package
with the following changes:

- Deprecate several classes which would ideally be internal

- Replace `ConfigurationBeanFactoryMetadata` with a new
  `ConfigurationPropertiesBean` class to better reflect that we no
  longer maintain meta-data directly.

- Use constructor injection and final fields whenever possible

- Rename `ConfiguraionPropertiesBeanDefinition` to
  `ConfigurationPropertiesValueObjectBeanDefinition` to align
  with the binder changes made in commit 0b3015e4ff

- Add additional tests

Closes gh-16903
2019-09-20 13:42:33 -07:00
Andy Wilkinson 39c1e47eb7 Use 3 decimal places at most for logged startup time
Fixes gh-18278
2019-09-19 10:18:23 +01:00
Andy Wilkinson 9d3586d0b8 Test DatabaseDriver.ORACLE now it's available from Maven Central
Closes gh-18274
2019-09-18 17:08:18 +01:00
Andy Clement 4fecefe149 Add Graal checks ahead of some interactions with ClassLoader methods
See gh-18262
2019-09-18 09:58:33 +01:00
Andy Wilkinson c662c404c5 Do not enable H2C by default when using Reactor Netty
Previously, Reactor Netty was the only embedded server that enabled
H2C by default. This commit updates the factory to only enable HTTP/2
when SSL has also been configured, aligning it with Jetty, Tomcat,
and Undertow.

If H2C is required, it can be enabled using a NettyServerCustomizer:

@Bean
NettyServerCustomizer h2cCustomizer() {
    return (httpServer) ->
           httpServer.protocol(HttpProtocol.HTTP11, HttpProtocol.H2C);
}

Closes gh-17867
2019-09-17 10:57:24 +01:00
Andy Wilkinson 448f5b8650 Simplify error page config by dropping redundant support for Tomcat 7
Closes gh-17937
2019-09-16 11:48:02 +01:00
Phillip Webb ad32603635 Restore compatibility with MockRestServiceServer
Closes gh-17885
2019-09-16 10:17:41 +02:00
leoli a0d2721e33 Use custom port for RSocket server over websocket
Prior to this change, the custom port configured for the RSocket
server would not be used if the server factory is using the
websocket transport and is provided with a custom
`ReactorResourceFactory`.

Fixes gh-18200
2019-09-16 09:53:10 +02:00
Stephane Nicoll a0d7d52106 Polish "Add ROLLING_FILE_NAME_PATTERN for File Appender"
See gh-18151
2019-09-16 09:28:15 +02:00
Eddú Meléndez 4a3810a0f1 Add ROLLING_FILE_NAME_PATTERN for File Appender
This new property allows to customize `fileNamePattern` if it is set.
Otherwise, a default pattern remains. Also, new property is supported
`logging.pattern.rolling-file-name`.

See gh-18151
2019-09-16 09:15:59 +02:00
Andy Wilkinson 1b237de5f5 Use Awaitility in our own tests
Closes gh-18227
2019-09-13 20:50:14 +01:00
Phillip Webb 8e398e164c Fix checkstyle violations 2019-09-12 15:23:32 -07:00
Phillip Webb eea5d15412 Merge branch '2.1.x'
Closes gh-18219
2019-09-12 15:11:13 -07:00
Phillip Webb 23174eb484 Remember annotations when using withExistingValue
Update `Bindable` builder methods so that existing annotations are
retained.

Closes gh-18218
2019-09-12 15:09:47 -07:00
Johnny Lim 5b41c3b608 Polish
See gh-18192
2019-09-12 14:55:47 +02:00
Andy Wilkinson f033016364 Allow @Component on mutable @ConfigurationProperties
Update configuration properties support to allow the `@Component`
annotation to be used on `@ConfigurationProperties` beans as long
as they are mutable.

This restores the behavior of Spring Boot 2.1 for mutable beans whilst
still allowing us to enforce the stricter rules for immutable value
object configuration properties.

Closes gh-18138
2019-09-09 23:04:50 -07:00
gaohanghang 74d2fe472a Simplify code
See gh-18175
2019-09-09 09:51:55 +02:00
Andy Wilkinson 58eddb8fa4 Become compatible with Jackson 2.10 while remaining 2.9 compatible
See gh-17999
2019-09-05 17:13:45 +01:00
Stephane Nicoll 7cb2eb1850 Polish "Polish test"
See gh-18130
2019-09-05 08:54:35 +02:00
Eddú Meléndez 16a0188666 Polish test
See gh-18130
2019-09-05 08:54:06 +02:00
Phillip Webb ebae76b1b8 Protect against null BindHandler.onStart result
Fixes gh-18129
2019-09-04 14:02:26 -07:00
Phillip Webb b43edf5493 Merge branch '2.1.x'
Closes gh-18118
2019-09-03 18:20:24 -07:00
michal 1f97a60d16 Clarify documentation on logback include files
Update documentation and comments on Logback to show the correct
use of `default.xml` rather than `base.xml`.

See gh-16901
2019-09-03 18:15:59 -07:00
dreis2211 b4350a9d96 Remove unnecessary blank lines
See gh-18089
2019-09-03 08:48:10 +02:00
Andy Wilkinson 6017f2f529 Merge branch '2.1.x'
Closes gh-18083
2019-09-01 20:10:57 +01:00
Andy Wilkinson ee89e0effd Fix client auth with Jetty
Fixes gh-17541
2019-09-01 19:49:03 +01:00
dreis2211 3e35a6616c Fix duplicated words
See gh-18004
2019-09-01 09:09:38 +02:00
Andy Wilkinson d03ac6457e Merge branch '2.1.x'
Closes gh-18027
2019-08-31 08:26:05 +01:00
Andy Wilkinson 3d23277b8f Tolerate invalid mimetype in Reactory Netty compression predicate
Fixes gh-18018
2019-08-31 08:18:18 +01:00
Phillip Webb dc0a642fc0 Fix chackstyle violations in test
See gh-18012
2019-08-30 22:00:17 -07:00
Phillip Webb 1283bc05d7 Merge branch '2.1.x'
Closes gh-18021
2019-08-30 14:41:36 -07:00
Phillip Webb 5938ca78b6 Fix request matcher management context support
Fix caching issues in `ApplicationContextRequestMatcher` and allow
subclasses to ignore an application context entirely. Update existing
matcher implementations so that they deal with the management context
correctly.

Prior to this commit, the `ApplicationContextRequestMatcher` would
return a context cached from the first request. It also didn't
provide any way to ignore a context. This meant that if the user was
running the management server on a different port the matching results
could be inconsistent depending on if the first request arrived on
the regular context or the management context. It also meant that we
could not distinguish between the regular context and the management
context when matching.

Closes gh-18012
2019-08-30 14:36:16 -07:00
Andy Wilkinson bbec7b0f37 Merge branch '2.1.x'
Closes gh-17994
2019-08-29 12:30:06 +01:00
Andy Wilkinson 9961647c7f Improve handling of reserved characters in MetaInfResourceManager
Previously, MetaInfResourceManager that we use with Undertow to serve
static resources from jar's META-INF/resources did not correctly
handle characters in the path that should be percent-encoded when
used in a URL.

This commit updates MetaInfResourceManager to encode the path before
it is used to create a URL. Prior to this encoding, encoded slashes
(%2F) are decoded as, unlike other encoded characters in the request's
URL, encoded slashes are not decoded prior to calling the
ResourceManager.

Fixes gh-17853
2019-08-29 12:13:40 +01:00
Vedran Pavic cb3efc1ef6 Add dependency management for IBM DB2 JDBC driver
See gh-17782
2019-08-27 11:19:19 +02:00
Gang Zhang 2b29bea55c Use putIfAbsent() instead of containsKey
See gh-17913
2019-08-23 13:21:23 +02:00
Phillip Webb cb5ca7997b Polish 2019-08-22 15:17:34 -07:00
Phillip Webb 6270f5008d Polish lenient enum converter
See gh-17798
2019-08-22 14:42:07 -07:00
Andy Wilkinson 05e089601e Remove default favicon and support for serving from classpath root
Closes gh-17925
2019-08-22 13:53:13 +01:00
Andy Wilkinson 24b5b0d93e Polish 2019-08-21 15:50:33 +01:00
Andy Wilkinson 87339405f3 Merge branch '2.1.x'
Closes gh-17928
2019-08-21 15:18:13 +01:00
Andy Wilkinson abe3d38527 Fix OoM error when starting Tomcat with max int load on startup
Fixes gh-17927
2019-08-21 15:17:54 +01:00
Andy Wilkinson 7f8944d00f Polish 2019-08-19 17:31:56 +01:00
Andy Wilkinson ab87b2a39b Polish 2019-08-19 16:05:43 +01:00
Stephane Nicoll 7f06504006 Detect ConfigurationProperties using autowiring constructor
This commit improves InvalidConfigurationPropertiesException failure
analysis by adding a dedicated description when a single autowiring
constructor is found. When @Component is removed, such constructor is
used for properties binding and will not apply the same semantics as
before.

Closes gh-17750
2019-08-19 11:01:49 +02:00
Stephane Nicoll fc0cee5ea7 Merge branch '2.1.x' 2019-08-17 06:47:33 +02:00
lijuny d33ed84f1f Remove redundant code
See gh-17875
2019-08-17 06:41:10 +02:00
dreis2211 d4affd7f85 Use hasSize() assertion in favor of length checks
See gh-17874
2019-08-17 06:39:41 +02:00
lijuny 64344214e1 Delete redundant variables
See gh-17864
2019-08-15 07:05:10 +02:00
Andy Wilkinson ba4c5be2fd Remove unused field
See gh-17562
2019-08-14 19:41:14 +01:00
Madhura Bhave 468b2e6d57 Merge branch '2.1.x'
Closes gh-17857
2019-08-13 15:15:14 -07:00
Madhura Bhave 3515ec1f29 Support relaxed binding for properties before environment is prepared
Fixes gh-17843
2019-08-13 14:54:27 -07:00
dreis2211 b605cddb10 Polish some Collections API calls
See gh-17825
2019-08-11 10:36:10 +02:00
zhuzhuman 84eacc49ed Simplify for statement with Collection copy
See gh-17827
2019-08-11 10:34:11 +02:00
lijuny 844a8d8027 Simplify some code
See gh-17832
2019-08-11 10:05:36 +02:00
Madhura Bhave 835108e522 Support binding of YAML style true/false values to 'ON'/'OFF'.
Fixes gh-17798
2019-08-09 16:19:15 -07:00
Stephane Nicoll b8a1043e98 Merge branch '2.1.x'
Closes gh-17813
2019-08-08 16:33:31 +02:00
Stephane Nicoll 1b3a6d1616 Polish "Configure a temporary directory with Undertow"
See gh-17778
2019-08-08 16:29:43 +02:00
Andy Chen 0388f954af Configure a temporary directory with Undertow
See gh-17778
2019-08-08 16:17:34 +02:00
Bo Zhang c19057e117 Simplify conditional statements
See gh-17779
2019-08-05 15:13:35 -07:00
freekry a9e7c4ec95 Fix typo in JsonComponent javadoc
See gh-17776
2019-08-04 08:59:40 +02:00
Phillip Webb 2cdceb92bf Polish 2019-08-03 14:29:20 +01:00
Phillip Webb b29e81fcd9 Allow defaultBindHandler to be specified on Binder
Allow a `defaultBindHandler` to be specified on the `Binder` instance
to save needing to pass it to each `bind` method call.

Closes gh-17773
2019-08-03 11:58:28 +01:00
Phillip Webb fb6568be73 Improve PropertySourceLoader file extension error
Refine the `IllegalStateException` thrown from `PropertySourceLoader`
for unknown extensions to also indicated that folder references must end
in '/'.

Closes gh-17241
2019-08-03 11:36:36 +01:00
Stephane Nicoll 89aefa6cfb Enable binding for scanned configuration properties
Closes gh-16822
2019-08-02 16:19:33 +02:00
Madhura Bhave 4e29f7b0ae Merge branch '2.1.x'
Closes gh-17762
2019-08-01 16:05:19 -07:00
Madhura Bhave 80f568bd47 Clarify RestTemplateBuilder rootUri documentation
Closes gh-15343
2019-08-01 15:59:24 -07:00
Madhura Bhave 02fd0c45e4 Merge branch '2.1.x'
Closes gh-17748
2019-07-31 13:01:46 -07:00
Madhura Bhave 96235ea674 Fix ordering of JSON property source relative to servlet sources
Fixes gh-17652
2019-07-31 12:43:08 -07:00
Phillip Webb da4f436140 Change SearchStrategy EXHAUSTIVE to TYPE_HIERARCHY
Fixup references following upstream Spring Framework change.
2019-07-31 15:11:43 +01:00
Phillip Webb ea5b624a39 Polish 2019-07-30 12:03:19 -07:00
Madhura Bhave 61b86ff231 Polish "Add support for configuring logging groups"
See gh-17515

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-07-30 11:28:58 -07:00
HaiTao Zhang b9047c22e0 Add support for configuring logging groups via endpoint
See gh-17515
2019-07-30 11:13:07 -07:00
dreis2211 a938a8b79c Fix checkstyle warning
See gh-17692
2019-07-29 16:48:57 +02:00
Phillip Webb e5497665cf Merge branch '2.1.x'
Closes gh-17688
Closes gh-17689
2019-07-29 14:48:26 +01:00
Phillip Webb d7ee504ee0 Only include our own mime mappings in Undertow
Update `UndertowServletWebServerFactory` so that only our own mime type
mappings are included. Prior to this commit both our mime mappings and
Undertow's default mime mappings would always be included.

Fixes gh-17687
2019-07-29 14:44:57 +01:00
Stephane Nicoll fc2c98ffad Merge branch '2.1.x' 2019-07-26 12:08:03 +02:00
Stephane Nicoll ac4dcfbf9a Improve detection of NoSuchMethodError cause
Closes gh-17649
2019-07-26 12:01:35 +02:00
Phillip Webb 8bc780762a Merge branch '2.1.x' 2019-07-24 11:42:48 +01:00
Phillip Webb fb1dd8fe93 Merge branch '2.0.x' into 2.1.x 2019-07-24 11:41:32 +01:00
Phillip Webb 913e831f4e Merge '1.5.x' into 2.0.x 2019-07-24 11:39:58 +01:00
Stephane Nicoll 5ed3185d04 Merge branch '2.1.x'
Closes gh-17621
2019-07-24 11:37:13 +02:00
Stephane Nicoll 057ca8f6a8 Polish "Clarify description of "logging.file.max-history""
See gh-17567
2019-07-24 11:36:15 +02:00
lihongmingming 00a5528d7f Clarify description of "logging.file.max-history"
See gh-17567
2019-07-24 11:36:15 +02:00
dreis2211 e47d56c76d Extend JavaVersion tests
See gh-17612
2019-07-24 11:13:07 +02:00
dreis2211 c8097692ea Align JavaVersion.NINE name with JDK versioning
See gh-17611
2019-07-24 11:12:02 +02:00
Stephane Nicoll 38a42a8600 Improve NoSuchMethodError message parsing
Closes gh-17544
2019-07-23 10:42:33 +02:00
Stephane Nicoll 0ff4484568 Merge branch '2.1.x'
Closes gh-17599
2019-07-22 10:27:04 +02:00
dreis2211 c2b6939ae1 Cover more known Java versions in JavaVersion
See gh-17590
2019-07-22 10:24:54 +02:00
Phillip Webb ca5df3cc9c Cache TypeExcludeFilter delegates
Cache TypeExcludeFilter delegates to save repeated calls to
`beanFactory.getBeansOfType`.

Closes gh-17595
2019-07-20 13:56:42 +01:00
Andy Wilkinson cc85746942 Merge branch '2.1.x'
Closes gh-17575
2019-07-18 17:17:05 +01:00
Andy Wilkinson 591250f75e Polish "Hide loader classes from Tomcat's ServletContext resource paths"
See gh-17538
2019-07-18 17:05:31 +01:00
adavid9 a81325bbbc Hide loader classes from Tomcat's ServletContext resource paths
See gh-17538
2019-07-18 17:05:27 +01:00
Andy Wilkinson 0f105f7471 Fail fast if spring.config.location uses unknown file extension
Closes gh-17241
2019-07-18 15:34:49 +01:00
dreis2211 2038fac825 Remove testsupport.assertj package
See gh-17557
2019-07-18 14:20:28 +02:00
Andy Wilkinson 3bf5cf1124 Merge branch '2.1.x'
Closes gh-17562
2019-07-18 07:22:24 +01:00
Andy Wilkinson b725c60177 Deprecate DeploymentInfo customization with reactive Undertow
Fixes gh-17555
2019-07-18 06:54:38 +01:00
Phillip Webb a9ba7080ce Merge branch '2.1.x' 2019-07-17 21:48:42 +01:00
Phillip Webb d567261790 Polish 2019-07-17 21:38:44 +01:00
Andy Wilkinson dad7fb4f6d Add NettyServerCustomizer beans to the auto-configured factory
Closes gh-17556
2019-07-17 14:58:11 +01:00
Andy Wilkinson ea1139755d Ensure that customizers registered multiple times are only called once
Closes gh-17264
2019-07-17 14:52:29 +01:00
Stephane Nicoll 56ce2b8e3f Polish "Add metrics support for idle jdbc connections"
See gh-17504
2019-07-17 14:14:47 +02:00
ayudovin 9acc02b5cc Add metrics support for idle jdbc connections
See gh-17504
2019-07-17 14:14:47 +02:00
Stephane Nicoll cc6f321da4 Improve detection of NoSuchMethodError on Java 13
Closes gh-17544
2019-07-17 11:17:37 +02:00
Andy Wilkinson cbc17c237b Make it easier to determine each servlet filter's order
Closes gh-17520
2019-07-15 17:10:32 +01:00
Stephane Nicoll a3e94f4412 Harmonize component scan in slice tests
This commit updates ConfigurationPropertiesScanRegistrar to apply the
same component scan filters than the ones applied on standard classpath
scanning.

As a result, configuration properties scanning is automatically disabled
in slice tests and can be included by an explicit import or a dedicated
TypeFilter implementation if necessary.

Closes gh-16659
2019-07-15 15:05:12 +02:00
Phillip Webb eff1147ccc Rename classpath runner package
Remove `runner` since we're no longer tied to JUnit 4.

See gh-17491
2019-07-15 13:40:26 +01:00
Phillip Webb 1117fdb2b3 Make ModifiedClassPathExtension package private
Meta-annotate `ClassPathExclusions` and `ClassPathOverrides` with
so that the `ModifiedClassPathExtension` no longer needs to be
used directly.

See gh-17491
2019-07-15 13:38:26 +01:00
Phillip Webb bd81bb90eb Polish ModifiedClassPath support
See gh-17491
2019-07-15 00:32:34 +01:00
dreis2211 0f0278e69b Migrate ModifiedClassPath tests to JUnit 5
Migrate the remaining JUnit 4 tests to JUnit 5, making use of the
new `ModifiedClassPathExtension`.

See gh-17491
2019-07-15 00:31:03 +01:00
dreis2211 1bc9c8544e Polish LoggingApplicationListenerTests
See gh-17491
2019-07-15 00:26:12 +01:00
Phillip Webb 01933f9b06 Merge previously split strings
Merge some string lines that were previously split because of the
90 chars wide formatting.
2019-07-15 00:24:19 +01:00
Phillip Webb c3816bfe7b Polish output capture names 2019-07-15 00:24:18 +01:00
Madhura Bhave 6164e3efe8 Merge branch '2.1.x' 2019-07-10 18:26:25 -07:00
Madhura Bhave aebb60d8b8 Fix tests
Setting the log file name to a random value in smoke tests
doesn't work because the logger context has already been initialized.
2019-07-10 18:14:58 -07:00
Madhura Bhave d590c3ed10 Merge branch '2.1.x'
Closes gh-17486
2019-07-10 15:32:22 -07:00
Madhura Bhave 773dda3d55 Log file location should be evaluated just once
Using a random value for the logfile name caused
the logfile endpoint to return a 404 as the name
was resolved from the environment on every request.
This commit registers a bean for LogFile which is then
used by the logfile endpoint.

Fixes gh-17434
2019-07-10 14:46:09 -07:00
Brian Clozel 3c28622ebc Add support for reactor-tools debug agent
The `reactor-tools` dependency now brings a new Reactor Debug Agent
which instruments loaded classes for better Reactor stacktraces.
This commit removes the `spring.reactor.stacktrace-mode.enabled`
configuration property since the related Reactor Hook is about to be
removed.
As a replacement, we're introducing `spring.reactor.debug-agent.enabled`
which tells whether the Reactor Debug Agent should be loaded, given that
the `reactor-tools` dependency is available. This option is enabled by
default, since adding the dependency on classpath is a strong signal
already.

Fixes gh-17128
2019-07-10 12:06:26 +02:00
Johnny Lim 255469b82f Add Javadoc `@since` tags for new additional Tomcat connectors methods
See gh-17473
2019-07-10 06:32:16 +01:00
Andy Wilkinson be3a737532 Merge branch '2.1.x'
Closes gh-17470
2019-07-09 20:05:30 +01:00
Andy Wilkinson 6748b20863 Prevent JUL loggers from being GCed once their level has been set
Fixes gh-17217
2019-07-09 19:51:55 +01:00
Johnny Lim 426ef749db Polish
See gh-17413
2019-07-09 07:40:30 +02:00
Andy Wilkinson 638b4b8186 Rename methods to make copying behaviour more clear
Closes gh-17441
2019-07-05 19:09:19 +01:00
Andy Wilkinson 2816635418 Polish 2019-07-04 17:51:20 +01:00
Andy Wilkinson 4b2a116fa7 Use String indexOf(char) and lastIndexOf(char) where possible
Closes gh-11416
2019-07-04 17:44:40 +01:00
Phillip Webb 4483f41791 Don't validate using BeanPropertyBindingResult
Update `ValidationBindHandler` so that a custom `AbstractBindingResult`
is used rather than `BeanPropertyBindingResult`. This allows us to
validate results, regardless of whether the actual bound instance has
public getters or setter.

Closes gh-17424
2019-07-03 21:59:08 -07:00
Phillip Webb edea223841 Merge branch '2.1.x'
Closes gh-17422
2019-07-03 16:06:19 -07:00
Phillip Webb 2f88dd735e Polish 2019-07-03 15:52:51 -07:00
Phillip Webb cd5f40aec2 Validate onFailure returned binding results
Update `ValidationBindHandler` so that any non-null result returned by
the parent `onFailure` method triggers re-validation.

Fixes gh-17421
2019-07-03 15:52:51 -07:00
Phillip Webb d641a1e23a Polish BindHandler javaodc 2019-07-03 15:52:51 -07:00
Phillip Webb a66c4d3096 Unify method visibility of private classes
Apply checkstyle rule to ensure that private and package private
classes do not have unnecessary public methods. Test classes have
also been unified as much as possible to use default scoped
inner-classes.

Closes gh-7316
2019-07-03 11:39:47 -07:00
Andy Wilkinson 40f66c80f8 Merge branch '2.1.x'
Closes gh-17409
2019-07-02 17:34:25 +01:00
Andy Wilkinson 82fd4ce9b9 Fix empty context path warning when using Jetty with WebFlux
Previously, the context path was set to an empty string. The led to
Jetty logging a warning about an empty context path and then using
/ instead.

This commit avoids the warning while leaving the context path's end
result unchanged by setting the context path to /.

Closes gh-17399
2019-07-02 17:24:34 +01:00
Andy Wilkinson 73cf11535d Ensure that logging system tests do not leave log files open
See gh-17107
2019-07-02 16:03:30 +01:00
Phillip Webb 07acc4af08 Consistently coerce booleans to enums
Rename `StringToEnumIgnoringCaseConverterFactory` to
`LenientStringToEnumConverterFactory` and extended it to support
binding of YAML style 'true'/'false' values to 'ON'/'OFF'.

Closes gh-17385
2019-07-01 22:55:18 -07:00
Phillip Webb 46b250549d Merge branch '2.1.x'
Closes gh-17396
2019-07-01 21:52:20 -07:00
Phillip Webb 206ba2ad86 Append chars not ints in getLettersAndDigits
Update `StringToEnumIgnoringCaseConverterFactory` so that the
`getLettersAndDigits` method correctly appends `char` elements
rather than `int` elements.

Closes gh-17327
2019-07-01 21:49:29 -07:00
Phillip Webb c94a7dfa04 Allow binding to package private methods
Closes gh-17394
2019-07-01 18:44:35 -07:00
dreis2211 15d4764185 Avoid bindable properties check when target has null value
See gh-16447
2019-07-01 17:11:58 +01:00
陈其苗 f86cfff77f Remove redundant invocation of getActiveProfiles
See gh-17271
2019-07-01 17:06:12 +01:00
Andy Wilkinson df5d23ff6c Polish "Migrate LogbackLoggingSystemTests to JUnit 5"
See gh-17107
2019-06-29 23:20:47 +01:00
Ilya Lukyanovich 569830cdca Migrate LogbackLoggingSystemTests to JUnit 5
See gh-17107
2019-06-29 23:20:40 +01:00
Dmytro Nosan 011fea137e Allow multiple values to be specified when configuring a default header
See gh-17286
2019-06-29 23:06:39 +01:00
Andy Wilkinson 71b09e39ae Merge branch '2.1.x'
Closes gh-17370
2019-06-29 22:36:14 +01:00
Dmytro Nosan ae184874e9 Polish WebServiceTemplateBuilder
See gh-17289
2019-06-29 22:19:03 +01:00
Andy Wilkinson 13bbfb7ede Polish "Polish TomcatReactiveWebServerFactoryTests"
See gh-17336
2019-06-29 21:57:55 +01:00
Johnny Lim 0e7824cec1 Polish TomcatReactiveWebServerFactoryTests
See gh-17336
2019-06-29 21:56:19 +01:00
Andy Wilkinson e496203740 Merge branch '2.1.x'
Closes gh-17368
2019-06-29 21:19:13 +01:00
Johnny Lim 408035fb3f Remove System.out.println() in a test
See gh-17358
2019-06-29 21:18:44 +01:00
Andy Wilkinson ea7443bf01 Merge branch '2.1.x'
Closes gh-17367
2019-06-29 21:15:29 +01:00
Johnny Lim 8dea74a2e9 Add a missing quote in DebugLogbackConfigurator
See gh-17357
2019-06-29 21:14:42 +01:00
Phillip Webb 605599138e Merge branch '2.1.x' 2019-06-28 23:56:02 -07:00
Phillip Webb 92bff3c328 Merge branch '2.0.x' into 2.1.x 2019-06-28 23:42:28 -07:00
Phillip Webb cfeb0239b7 Merge branch '1.5.x' into 2.0.x 2019-06-28 23:28:34 -07:00
Phillip Webb a417e136a3 Merge branch '2.1.x' 2019-06-28 14:15:17 -07:00
Phillip Webb 9aa4887376 Merge branch '2.0.x' into 2.1.x 2019-06-28 14:14:52 -07:00
Phillip Webb ed3e1e076d Fix AbstractFilterRegistrationBean merge error
Merging 1.5.x accidentally broke `AbstractFilterRegistrationBean`
2019-06-28 14:13:59 -07:00
Phillip Webb c62b6b4ccd Merge branch '2.1.x' 2019-06-28 12:22:45 -07:00
Phillip Webb de35efd1ef Merge branch '2.0.x' into 2.1.x 2019-06-28 12:21:57 -07:00
Phillip Webb bb34846630 Merge branch '1.5.x' into 2.0.x 2019-06-28 12:19:46 -07:00
Andy Wilkinson 66f1344f7c Merge branch '2.1.x'
Closes gh-17335
Closes gh-17292
2019-06-27 12:00:34 +01:00
HaiTao Zhang d9048d2531 Provide ability to add additional connectors on reactive Tomcat
See gh-17323
2019-06-26 15:36:12 -07:00
Andy Wilkinson 7405efa326 Ensure that each Tomcat customizer is only called once
Fixes gh-17264
2019-06-21 17:53:24 +01:00
Stephane Nicoll e560b7f6ba Remove public modifier on JUnit5 lifecycle methods
See gh-17292
2019-06-21 18:09:05 +02:00
Phillip Webb 59ca46ed54 Remove FIXME 2019-06-18 21:41:05 -07:00
Phillip Webb f4d9e1c650 Fix checkstyle violation 2019-06-17 14:45:17 -07:00
Phillip Webb 69fbd8f20c Merge branch '2.1.x'
Closes gh-17227
Closes gh-17228
2019-06-17 11:53:16 -07:00
ayudovin c2d1cb2c70 Chain predicates in PropertyMapper when methods
Update `PropertyMapper` to correctly combine predicates when repeated
calls are made to `when` and `whenNot`. Prior to this commit, subsequent
invocations would replace the previous predicate.

Fixes gh-17225
2019-06-17 11:21:56 -07:00
Andy Wilkinson c62543b514 Merge branch '2.1.x'
Closes gh-17212
2019-06-17 10:47:22 +01:00
Andy Wilkinson 13a7a52c71 Revert "Work around Framework regression in handling of null model values"
This reverts commit 5fc67c545c.

Closes gh-16991
2019-06-17 10:44:23 +01:00
Phillip Webb 25839185c1 Fix checkstyle violation 2019-06-14 18:57:41 -07:00
Phillip Webb 0b3015e4ff Polish Binder classes
Polish and rename some of the internal Binder classes to better reflect
their purpose. The `BeanBinder` is now called `DataObjectBinder` and
as a `JavaBeanBinder` implementation for setter based properties, and
a `ValueObjectBinder` implementation for constructor based properties.
2019-06-14 18:14:40 -07:00
Madhura Bhave c6dae5764e Add bindOrCreate for constructor based binding
Deprecate the existing `BindResult.orElseCreate` method in favor of
`bindOrCreate` methods on the `Binder`. These new methods allow us to
implement custom creation logic depending on the type of object being
bound. Specifically, it allows constructor based binding to create new
instances that respect the `@DefaultValue` annotations.

Closes gh-17098

Co-authored-by: Phillip Webb <pwebb@pivotal.io>
2019-06-14 18:14:40 -07:00
Andy Wilkinson 75da4468e5 Merge branch '2.1.x'
Closes gh-17192
2019-06-14 15:15:19 +01:00
Andy Wilkinson d5d96dff96 Honor logback.debug property and write Logback statuses to console
Closes gh-16876
2019-06-14 15:12:05 +01:00
Madhura Bhave 4c7e457582 Improve analysis of tomcat bind exception
Using the throwOnFailure attribute on the tomcat connector, we can now
determine if the underlying exception was a BindException and throw
a PortInUseException instead of the generic WebServerException.

Closes gh-7130
2019-06-13 15:11:18 -07:00
Phillip Webb 9db20313a1 Polish "Add Printer and Parser beans to conversion service"
Extract common registration code and make use of the Spring Framework
registration methods.

See gh-17064
2019-06-13 08:54:11 -07:00
Dmytro Nosan 955eaa87ae Add Printer and Parser beans to conversion service
Update `WebMvcAutoConfiguration` and `WebFluxAutoConfiguration` so that
`Printer<T>` and `Parser<T>` beans are automatically registered with
the conversion service.

Prior to this commit only `GenericConverter`, `Converter` and
`Formatter` beans were automatically registered.

See gh-17064
2019-06-13 08:54:11 -07:00
Andy Wilkinson cffc870fd6 Fix test failures on Windows
Since the move to JUnit 5, a number of tests were failing on Windows.
The majority were failing due to open file handles preventing the
clean up of the tests' temporary directory. This commit addresses
these failures by updating the tests to close JarFiles, InputStreams,
OutputStreams etc.

A change has also been made to CachingOperationInvokerTests to make
a flakey test more robust. Due to System.currentTimeMillis() being
less precise on Windows than it is on *nix platforms, the test could
fail as it would not sleep for long enough for the TTL period to have
expired.
2019-06-13 09:24:31 +01:00
Phillip Webb aad21d1996 Polish "Support default headers with RestTemplateBuilder"
Broaden the scope of customizer support so that instead of focusing
just on headers, we can now customize any outgoing `HttpClientRequest`.
Also update auto-configuration to automatically add any
`RestTemplateRequestCustomizer` beans to the builder.

See gh-17091
2019-06-12 16:34:31 -07:00
Ilya Lukyanovich 43b1a667ce Support default headers with RestTemplateBuilder
Update `RestTemplateBuilder` so that it is easier to apply custom
headers to the outgoing request. The update is particularly useful
for setting the `User-Agent` header, for example so that a GitHub
username can be used when calling `api.github.com`.

See gh-17091
2019-06-12 13:49:39 -07:00
Andy Wilkinson 5e3c86ab8d Merge branch '2.1.x'
Closes gh-17122
2019-06-12 12:53:49 +01:00
Andy Wilkinson 4222c5b8ce Prevent URLResource and JarURLConnection from leaking an InputStream
Fixes gh-17121
2019-06-12 12:53:16 +01:00
Andy Wilkinson 5375681fa5 Merge branch '2.1.x'
Closes gh-17120
2019-06-12 12:41:09 +01:00
Andy Wilkinson df9a6a0f4f Wait for up to 30s for access logs to be written during shutdown
Closes gh-17119
2019-06-12 12:40:11 +01:00
Madhura Bhave 6b3329b274 Add support for annotations on constructor parameter binding
Closes gh-17109
2019-06-11 16:46:29 -07:00
Andy Wilkinson e6151a6478 Polish 2019-06-11 18:57:58 +01:00
Phillip Webb 08dbb2d8c4 Polish 2019-06-11 09:23:50 -07:00
Johnny Lim 3b3a92c563 Add missing @Test annotations
This commit also restores assertion accidentally removed in
commit 44d832158a.

See gh-17069
2019-06-11 09:21:31 -07:00
Phillip Webb b3d5cd538d Add JUnit 5 checkstyle rules
Add a rule to enforce JUnit 5 usage and conventions.

Closes gh-17093
2019-06-10 16:16:45 -07:00
Phillip Webb 8d44e31898 Fix composite property source filtering
Update `ConfigFileApplicationListener` so that property filtering works
against the original `PropertySource`, rather than the underling `Map`.

Prior to this commit, it was impossible for a `CompositePropertySource`
to be used as the `defaultPropertySource`.

Closes gh-17011
2019-06-10 09:55:30 -07:00
Phillip Webb 266d6334b2 Fix checkstyle RedundantModifier test violations 2019-06-07 20:46:33 -07:00
Andy Wilkinson b18fffaf14 Move tests to JUnit 5 wherever possible 2019-06-07 12:25:54 +01:00
Andy Wilkinson aef92b9295 Merge branch '2.1.x'
Closes gh-17079
2019-06-07 11:00:44 +01:00
Andy Wilkinson 24925c3dae Merge branch '2.0.x' into 2.1.x
Closes gh-17078
2019-06-07 10:50:34 +01:00
Andy Wilkinson c6c139d980 Merge branch '1.5.x' into 2.0.x 2019-06-07 10:46:31 +01:00
Phillip Webb 3bfc9235df Polish "Optimize CacheKey handling for immutable sources"
Make immutable properties more explicit and trust that they
truly won't change.

See gh-16717
2019-06-04 16:26:48 -07:00
dreis2211 44d832158a Optimize CacheKey handling for immutable sources
Update `SpringIterableConfigurationPropertySource` so that cache keys
do not need to be checked if property sources are immutable.

See gh-16717
2019-06-04 16:26:43 -07:00
Phillip Webb db75347eb6 Merge branch '2.1.x' 2019-06-04 14:41:20 -07:00
Phillip Webb d306b31ce9 Merge branch '2.1.x' 2019-06-04 02:08:00 -07:00
Phillip Webb ccfbd03482 Merge branch '2.0.x' into 2.1.x 2019-06-04 02:07:14 -07:00
Phillip Webb b442d3b906 Merge branch '1.5.x' into 2.0.x 2019-06-04 01:49:03 -07:00
Phillip Webb 5fba43aa31 Merge branch '1.5.x' into 2.0.x 2019-06-04 00:05:57 -07:00
Phillip Webb af1a6d8649 Polish "Make it easier to set bufferRequestBody"
See gh-16972
2019-06-03 14:15:54 -07:00
kevinstrijbos 9f06514b89 Make it easier to set bufferRequestBody
Update `RestTemplateBuilder` to make it easier to set
the `bufferRequestBody` value on a underlying `ClientHttpRequestFactory`

See gh-16972
2019-06-03 14:14:34 -07:00
Stephane Nicoll 090cc05e7a Add missing metadata for "spring.profiles"
Closes gh-16107
2019-06-03 11:56:09 +02:00
Phillip Webb bf633fc575 Polish "Support JsonComponent key serializers/deserialzers"
See gh-16544
2019-06-02 20:46:17 -07:00
maly7 361efc7c11 Support JsonComponent key serializers/deserialzers
Update `@JsonComponent` so that it can also be used to register key
serializers and deserializers.

See gh-16544
2019-06-02 20:41:41 -07:00
Phillip Webb 763d18ca68 Polish defaultElementEquals
See gh-16671
2019-06-01 13:33:17 -07:00
Johnny Lim a89e6ff67c Polish dashIgnoringElementEquals()
See gh-16671
2019-06-01 13:33:08 -07:00
Phillip Webb 114f9f9503 Polish "Replace anonymous class with lambdas"
See gh-17040
2019-06-01 13:14:17 -07:00
fidel 46677e30cf Replace anonymous class with lambdas
See gh-17040
2019-06-01 12:49:38 -07:00
Phillip Webb 76e075ddd0 Polish "Use request factory to support Basic Authentication"
Reduce the surface area of the public API by making the
`BasicAuthentication` and `BasicAuthenticationClientHttpRequestFactory`
class package private.

This commit also attempts to simplify `TestRestTemplate` by keeping
the `RestTemplateBuilder` and reusing it, rather than needing to deal
only with a `RestTemplate` instance.

See gh-17010
2019-05-31 22:35:36 -07:00
Dmytro Nosan 18a0a7a2e8 Use request factory to support Basic Authentication
Update `RestTemplateBuilder` to use a custom request factory to add
authentication headers rather than an interceptor.

Prior to this commit, the use of the `BasicAuthenticationInterceptor`
interceptor could cause `OutOfMemoryError` whenever a large file is
uploaded.

See gh-17010
2019-05-31 22:29:20 -07:00