1791 Commits

Author SHA1 Message Date
dreis2211
5eb5bf0a2d Polish
See gh-21009
2020-04-25 08:54:47 +02:00
Stephane Nicoll
85e9f713b0 Update copyright year of changed files
See gh-21007
2020-04-25 08:50:51 +02:00
Johnny Lim
29717423a3 Remove this keyword on member method invocations
See gh-21007
2020-04-25 08:49:44 +02:00
Mikael
c06edbe6f4 Polish ApplicationHome
See gh-20992
2020-04-25 08:44:37 +02:00
Andy Wilkinson
dc75ca3942 Avoid capturing TCCL when creating DefaultResourceLoaders
Previously, DefaultResourceLoader instances were created using the
default constructor. This causes the resource loader to capture the
TCCL that was in place at that time. This can lead to a class loader
leak if the resource loader is referenced directly or indirectly from
a static field of a class loaded by a different class loader.

This commit updates the creation of DefaultResourceLoader instances
in main code so that the resource load will use the class loader of
the creating class. In almost all cases this will be the same class
loader as was the thread context class loader that was being captured
so the change in behavior is minimal. Crucially, it will still address
the situation where the TCCL was different.

Note the DevTools' ApplicationContextResourceLoader has been updated
to explicitly use the TCCL. This ensures that it uses the restart
class loader which is required for DevTools to function correctly.

Fixes gh-20900
2020-04-24 13:29:29 +01:00
Andy Wilkinson
d53be18582 Deprecate support for Bitronix
Closes gh-20823
2020-04-24 11:37:44 +01:00
Phillip Webb
db28c0c65c Backport "Attempt to fix CI" 2020-04-23 16:35:01 -07:00
Phillip Webb
4de69c380d Attempt to fix CI 2020-04-23 15:55:10 -07:00
Phillip Webb
49345025ac Merge branch '2.2.x'
Closes gh-21105
2020-04-23 14:44:08 -07:00
Phillip Webb
93f7e2b6ba Limit when PortInUseException is thrown
Refactor `PortInUseException` logic to a single place and refine when
the exception is thrown.

Prior to this commit, we assumed that a `BindException` was only thrown
when the port was in use. In fact, it's possible that the exception
could be thrown because the requested address "could not be assigned".

We now only throw a `PortInUserException` if the `BindException` message
includes the phrase "in use".

Fixes gh-21101
2020-04-23 14:42:30 -07:00
Stephane Nicoll
ddcd1bc7bb Remove metadata for configuration keys that were removed in 2.0
Closes gh-19706
2020-04-23 16:14:13 +02:00
Stephane Nicoll
6c02daf2bc Merge branch '2.2.x'
Closes gh-21098
2020-04-23 14:12:37 +02:00
Stephane Nicoll
311952730e Merge branch '2.1.x' into 2.2.x
Closes gh-21097
2020-04-23 14:07:31 +02:00
Stephane Nicoll
291165f060 Order additional metadata according to lexicographic order
Closes gh-21095
2020-04-23 13:58:49 +02:00
Phillip Webb
bf41da5322 Update copyright year of changed files 2020-04-21 18:12:27 -07:00
Phillip Webb
03a9738f3b Merge branch '2.2.x'
Closes gh-21053
2020-04-20 17:57:57 -07:00
Phillip Webb
7d68c7c4c4 Merge branch '2.1.x' into 2.2.x
Closes gh-21052
2020-04-20 17:55:33 -07:00
Phillip Webb
a2fdf23e41 Don't throw NettyWebServer on permission errors
Update `NettyWebServer` so that the `PortInUseException` is not thrown
for permission denied errors.

Fixes gh-19807
2020-04-20 17:54:13 -07:00
Phillip Webb
c7611112f7 Include cause when throwing PortInUseException
Update classes that throw `PortInUseException` so that they also
include the cause. Prior to this commit the cause was not included
which could make diagnosing the real cause difficult.

See gh-19807
2020-04-20 17:54:10 -07:00
Madhura Bhave
5d56d652fb Merge branch '2.2.x'
Closes gh-21050
2020-04-20 17:10:16 -07:00
Madhura Bhave
4e0fdbee17 Process additional locations when non-default location configured
Fixes gh-20745
2020-04-20 17:08:54 -07:00
Madhura Bhave
2cac264624 Merge branch '2.2.x'
Closes gh-21049
2020-04-20 15:58:45 -07:00
Madhura Bhave
af6d538781 Add support for initializing nested object when nothing bound
When using constructor binding, if no properties are bound to
a nested property, the top-level instance will be created with a
null value for the nested property.
This commit introduces support for an empty `@DefaultValue` which
indicates that an instance of the nested property must be created
even if nothing is bound to it. It honors any `@DefaultValue`
annotations that the nested property might have in its constructor.

Closes gh-18917
2020-04-20 15:39:55 -07:00
Phillip Webb
de8915432a Allow square bracket notation profiles properties
Update `ConfigFileApplicationListener` so that `spring.profiles.active`
and `spring.profiles.include` can use the square bracket list notation.

Prior to this commit, only comma-separated lists could be used for
those values.

Closes gh-21006
2020-04-17 17:34:14 -07:00
Phillip Webb
e3b8478621 Polish 2020-04-17 16:12:11 -07:00
Scott Frederick
1caca6e3d0 Deprecate unused ErrorController interface method
This commit marks as deprecated an interface method that is no longer
used, and changes all internal implementations to return `null` to
make the fact that the return value is not used more obvious.

Fixes gh-19844
2020-04-16 16:50:03 -05:00
Scott Frederick
70d4994502 Disable exception details on default error views
Prior to this commit, default error responses included the message
from a handled exception. When the exception was a BindException, the
error responses could also include an errors attribute containing the
details of the binding failure. These details could leak information
about the application.

This commit removes the exception message and binding errors detail
from error responses by default, and introduces a
`server.error.include-details` property that can be used to cause
these details to be included in the response.

Fixes gh-20505
2020-04-16 10:46:36 -05:00
Stephane Nicoll
fb2f6bb1af Polish
See gh-20975
2020-04-16 13:57:42 +02:00
Phillip Webb
bb79c847b2 Allow custom availability states
Create a general purpose `AvailabilityState` interface and refactor
the existing `LivenessState` and `ReadinessState` to use it. A single
`AvailabilityChangeEvent` is now used to carry all availability state
updates.

This commit also renames `ApplicationAvailabilityProvider` to
`ApplicationAvailabilityBean` and extracts an `ApplicationAvailability`
interface that other beans can inject. The helps to hide the event
listener method, which is really internal.

Finally the state enums have been renamed as follows:

 - `LivenessState.LIVE` -> `LivenessState.CORRECT`
 - `ReadinessState.READY` -> `ReadinessState.ACCEPTING_TRAFFIC`
 - `ReadinessState.UNREADY` -> `ReadinessState.REFUSING_TRAFFIC`

See gh-20962
2020-04-14 16:40:36 -07:00
Brian Clozel
939bb87a02 Merge branch '2.2.x'
Closes gh-20957
2020-04-14 14:18:48 +02:00
Brian Clozel
49bbcceda9 Fix Undertow compression config with invalid Mime Types
Prior to this commit, the Undertow compression configuration provided by
Spring Boot would fail and throw an exception for invalid MIME Types
when trying to check them against the list of configured types for
compression.

This commit ensures that invalid MIME Types are ignored and that
compression is disabled for those.

Fixes gh-20955
2020-04-14 14:15:39 +02:00
dreis2211
43936d66d3 Improve Binder performance slightly
See gh-20755
2020-04-10 14:23:56 +02:00
dreis2211
d4575bc122 Fix unused parameters
See gh-20911
2020-04-10 14:06:42 +02:00
Andy Wilkinson
8e695b0cc5 Configure OncePerRequestFilters with all dispatcher types by default
Closes gh-18953
2020-04-09 15:08:05 +01:00
Scott Frederick
ba4eec87e4 Continue processing properties files on error
Prior to this commit, processing of multiple properties files
discovered using a wildcard pattern would stop on any error
encountered while processing a file or when an empty properties file
was found, causing subsequent files from the pattern to be ignored.

This commit changes the behavior such that subsequent files are
processed on error or on an empty file.

Fixes gh-20873
2020-04-08 09:26:41 -05:00
Phillip Webb
3ca896e63f Polish 2020-04-07 12:10:49 -07:00
Stephane Nicoll
dc94a87694 Merge branch '2.2.x'
Closes gh-20869
2020-04-07 15:10:02 +02:00
Stephane Nicoll
cb66e4a206 Update copyright year
See gh-20832
2020-04-07 15:09:27 +02:00
dreis2211
235e693906 Fix WebappLoader constructor deprecations
See gh-20832
2020-04-07 15:08:28 +02:00
Phillip Webb
01c7623f5d Polish 2020-04-02 22:08:30 -07:00
Scott Frederick
6a0d620860 Polish javadoc 2020-04-02 14:48:54 -05:00
Brian Clozel
ffc2cff8de Override CloudPlatform auto-detection with configuration property
This commit adds the new "`spring.main.cloud-platform`" configuration
property. This allows applications to override the auto-detection and
force a specific Cloud Platform. This is useful for testing behavior on
a local machine or force the detection of a particular platform.

This commit also adds a new `CloudPlatform.NONE` value that allows
applications to disable the auto-detection of the Cloud Platform, thus
avoiding issues with false positives.

Closes gh-20553
2020-04-02 20:28:55 +02:00
Andy Wilkinson
d8cead5457 Use accessor for in-progress async count added in Tomcat 9.0.33
Closes gh-20440
2020-04-01 11:16:54 +01:00
Andy Wilkinson
281f4d4ceb Clear system property set by log file registration
Closes gh-20790
2020-04-01 11:10:16 +01:00
Brian Clozel
9eed719c44 Do not register shutdownHook for WAR deployments
The application context shutdownHook is not needed for WAR deployments,
and we should let the Servlet container handle the application lifecycle
here.

Closes gh-19398
2020-03-24 23:11:18 +01:00
Brian Clozel
eb70fd952f Turn LivenessState and ReadinessState into enums
Prior to this commit, `LivenessState` and `ReadinessState` were
immutable classes. This was done in order to have additional behavior
and information in those classes.

Because the current implementation doesn't need this, this commit turns
those classes into simple enums.
Additional state and information can be added to the
`*StateChangedEvent` classes.

See gh-19593
2020-03-24 18:25:52 +01:00
Phillip Webb
0717de723f Polish 2020-03-23 20:03:44 -07:00
Phillip Webb
9a33a723fe Update copyright year of changed files 2020-03-23 14:15:08 -07:00
Phillip Webb
ce1ae11c26 Merge branch '2.2.x' 2020-03-23 14:14:47 -07:00
Phillip Webb
16b5ea3414 Update copyright year of changed files 2020-03-23 14:13:33 -07:00