Commit Graph

1716 Commits

Author SHA1 Message Date
Phillip Webb 187d3af7fc Update copyright year of changed files 2020-07-22 17:25:17 -07: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 f52cdf10b3 Update WebServerInitEvent docs to reflect ordering w.r.t. refresh
Closes gh-22277
2020-07-13 12:51:07 +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
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
Andy Wilkinson 28128a9577 Add support for ChronoUnit.WEEKS when using PeriodUnit
Fixes gh-22225
2020-07-06 19:57:26 +01:00
Andy Wilkinson d1f074858e Correct class name of StringToPeriodConverterTests 2020-07-06 15:59:32 +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 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
Johnny Lim 43aee1bddd Polish
See gh-22090
2020-06-29 16:35:23 -07:00
Johnny Lim b218a89862 Remove Javadoc throw for ConfigurationPropertyName.ofIfValid()
See gh-22018
2020-06-19 14:14:57 +02:00
Andy Wilkinson ce907b129c Merge branch '2.2.x' into 2.3.x
Closes gh-22010
2020-06-18 11:03:32 +01:00
Andy Wilkinson 1b62abab9a Configure context on SizeAndTimeBasedRollingPolicy
Previously, when file-based logging was enabled, Logback would output
the following during logging system initialization:

LOGBACK: No context given for c.q.l.core.rolling.SizeAndTimeBasedRollingPolicy

This commit updates the default logback configuration to set the
context on the SizeAndTimeBasedRollingPolicy that it creates.

Fixes gh-21056
2020-06-18 11:01:26 +01:00
dreis2211 855d596c2a Use lazy lambda instead of explicit argument
See gh-21986
2020-06-18 11:29:49 +02:00
Andy Wilkinson 0de466e06e Require dependency on s-b-dependencies to use its constraints
Previously, Spring Boot's modules published Gradle Module Metadata
(GMM) the declared a platform dependency on spring-boot-dependencies.
This provided versions for each module's own dependencies but also had
they unwanted side-effect of pulling in spring-boot-dependencies
constraints which would influence the version of other dependencies
declared in the same configuration. This was undesirable as users
should be able to opt in to this level of dependency management, either
by using the dependency management plugin or by using Gradle's built-in
support via a platform dependency on spring-boot-dependencies.

This commit reworks how Spring Boot's build uses
spring-boot-dependencies and spring-boot-parent to provide its own
dependency management. Configurations that aren't seen by consumers are
configured to extend a dependencyManagement configuration that has an
enforced platform dependency on spring-boot-parent. This enforces
spring-boot-parent's version constraints on Spring Boot's build without
making them visible to consumers. To ensure that the versions that
Spring Boot has been built against are visible to consumers, the
Maven publication that produces pom files and GMM for the published
modules is configured to use the resolved versions from the module's
runtime classpath.

Fixes gh-21911
2020-06-16 08:50:21 +01:00
Phillip Webb 1604545727 Ensure AvailabilityChangeEvent carries generics
Update `AvailabilityChangeEvent` to be a `PayloadEvent` and ensure
that the `getResolvableType` method returns a generic compatible
result.

Prior to this commit, a ClassCastExeption would be thrown if the
following event listener was declared:

  @EventListener
  void onEvent(AvailabilityChangeEvent<ReadinessState> event) {
    ...
  }

Closes gh-21898
2020-06-12 10:50:00 -07:00
Phillip Webb 069d2769f4 Reinstate disabled Reactor Netty test
Reinstate test now that we are on a reactor-netty releases that fixes
reactor/reactor-netty issue 1093.

Closes gh-21437
2020-06-11 14:52:21 -07:00
dreis2211 469dfc285b Fix deprecation in NettyRSocketServerFactoryTests
See gh-21872
2020-06-11 11:46:11 -07:00
Phillip Webb 3b71403b99 Merge branch '2.2.x' into 2.3.x 2020-06-10 22:14:33 -07:00
Phillip Webb ac197be815 Fix checkstyle issue 2020-06-10 22:14:09 -07:00
Phillip Webb 7e5d6bafa8 Merge branch '2.2.x' into 2.3.x 2020-06-10 22:05:40 -07:00
Phillip Webb 02bfc9d30a Polish 2020-06-10 21:50:17 -07:00
Madhura Bhave 83485e625d Merge branch '2.2.x' into 2.3.x
Closes gh-21880
2020-06-10 18:50:41 -07:00
Madhura Bhave 4e014da9e9 Return all loggers for Log4j2
This commit aligns log4j2's behavior with logback such that loggers
with a null configuredLevel are also returned by the actuator endpoint.

Fixes gh-20037
2020-06-10 18:48:14 -07:00
Madhura Bhave 92ce94b3d8 Align default log levels for Log4j2 and Logback
Fixes gh-21293
2020-06-10 18:48:01 -07:00
Andy Wilkinson 6e68101b9f Upgrade to Postgresql 42.2.13
Closes gh-21859
2020-06-10 17:04:03 +01:00
Phillip Webb c11abf48d9 Polish 'Allow beans without public constructors to load'
See gh-20929
2020-06-06 12:05:50 -07:00
Vlad Kisel d8d8f9cf0b Allow beans without public constructors to load
Allow `BeanDefinitionLoader` to load classes that don't have public
constructors. The constraint was first introduced in d82c50804f to
solve an issue with anonymous Groovy classes but causes particular
problems with `@SpringBootTest`.

See gh-20929
2020-06-06 11:59:47 -07:00
dreis2211 2b5569f054 Polish
See gh-21732
2020-06-06 11:07:21 -07:00
Phillip Webb 47c1928189 Polish 'Optimize SystemEnvironmentPropertyMapper'
Introduce a new `ConfigurationPropertyName.ofIfValid` method to
save us needing to throw and catch an exception unnecessarily.

See gh-21523
2020-06-05 16:11:52 -07:00
dreis2211 0378de7b30 Optimize SystemEnvironmentPropertyMapper
See gh-21523
2020-06-05 16:11:28 -07:00
dreis2211 f8d6d9a4b0 Call append only when necessary
See gh-21523
2020-06-05 16:11:11 -07:00
dreis2211 33deba4948 Use chars rather than strings
Update `SystemEnvironmentPropertyMapper` to use single chars
rather than strings whenever possible.

See gh-21523
2020-06-05 15:52:18 -07:00
Phillip Webb cc50605687 Merge branch '2.2.x' into 2.3.x 2020-06-05 15:36:44 -07:00
Phillip Webb 0a05b4c9fd Update copyright year of changed files 2020-06-05 15:36:09 -07:00
Phillip Webb 4d37430bfe Use servlet context that can access classloader
Update `SpringBootServletInitializer` to use the `ServletContext` that
was provided to the initial `onStartup` call rather than the
one from the `ServletContextEvent`. This allows the `getClassLoader()`
call to complete without throwing an `UnsupportedOperationException`.

Fixes gh-21684
2020-06-03 19:18:12 -07:00
Phillip Webb e39d7971fb Merge branch '2.2.x' into 2.3.x 2020-06-02 22:48:01 -07:00
Phillip Webb 864daab03a Merge branch '2.1.x' into 2.2.x 2020-06-02 22:47:41 -07:00
Phillip Webb b5fe3c3494 Refine YAML type restriction error
Closes gh-21596
2020-06-02 22:46:47 -07:00
Phillip Webb ebb3f5f286 Merge branch '2.2.x' into 2.3.x
Closes gh-21660
2020-06-02 22:28:39 -07:00
Phillip Webb 4fc0dec6c4 Support wrapped random property sources
Update `SpringConfigurationPropertySource` so that wrapped random
property sources can be used. It's assumed that wrapped random
sources will use the name of the source as the prefix.

Closes gh-21595
2020-06-02 22:22:40 -07:00
Phillip Webb 2589f980d5 Merge branch '2.2.x' into 2.3.x
Closes gh-21655
2020-06-02 10:58:36 -07:00
Phillip Webb 09a47c9aad Fix containsDescendantOf for random sources
Fix the `containsDescendantOf` logic for random property sources to
ensure that ancestors are correctly matched.

Closes gh-21654
2020-06-02 10:57:48 -07:00
Phillip Webb 4dff0beb80 Merge branch '2.2.x' into 2.3.x
Closes gh-21645
2020-06-01 15:07:26 -07:00
Phillip Webb 14e6c734a9 Merge branch '2.1.x' into 2.2.x
Closes gh-21643
2020-06-01 14:45:39 -07:00
Phillip Webb 95031295b9 Restore TomcatReactiveWebServerFactoryTests
Restore tests that were previously ignored due to a framework bug.

Closes gh-19702
2020-06-01 14:19:20 -07:00