1248 Commits

Author SHA1 Message Date
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 44d832158a60ba518565869e868052f72d0a972e.

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
Phillip Webb
d11d5ceb29 Split up JUnit 5 OutputCapture class
Split the JUnit 5 `OutputCapture` class into separate `OutputExtension`
and `CapturedOutput` classes. The JUnit 5 callback methods are now
contained only in the `OutputExtension` class so no longer pollute the
public API that users will interact with.

The `CapturedOutput` class has also been updated to capture System.err
and System.out separately to allow distinct assertions if required.

Closes gh-17029
2019-05-30 23:44:35 -07:00
Phillip Webb
ad5e905bd7 Update copyright header of changed files 2019-05-30 11:30:43 -07:00
Phillip Webb
68aec8b6ee Polish 2019-05-30 11:30:27 -07:00
Phillip Webb
791be953fe Merge branch 'spring-projects/2.1.x'
Closes gh-17018
2019-05-29 16:11:52 -07:00
Phillip Webb
8e268987ff Improve thread safety in property source cache
Update `SpringIterableConfigurationPropertySource` so that they cache
and cache key are not stored in different fields. Prior to this commit
it was possible that the an incorrect cache could be returned from
because the key and cache were out of sync.

This commit also allows more lenient handling of ConcurrentModification
exceptions if they are thrown during cache retrieval.

Closes gh-17017
See gh-17013
2019-05-29 16:05:24 -07:00
Phillip Webb
6509322bd8 Merge branch '2.1.x'
Closes gh-17016
2019-05-29 14:36:34 -07:00
Johnny Lim
f52ab0040f Handle all getters first in JavaBeanBinder
Update `JavaBeanBinder.addProperties` to add both `get` and `is` methods
before `set`.

See gh-17005
2019-05-29 11:15:41 -07:00
Andy Wilkinson
e481eccd57 Merge branch '2.1.x'
Closes gh-17006
2019-05-29 14:19:57 +01:00
Johnny Lim
765b66c599 Add a missing @Test in JavaBeanBinderTests
See gh-17002
2019-05-29 14:17:41 +01:00
Andy Wilkinson
86380ab8db Add missing package-info.java files 2019-05-29 07:20:34 +01:00
Phillip Webb
6d413afecf Merge branch '2.1.x'
Closes gh-16995
2019-05-28 16:31:36 -07:00
Phillip Webb
09373622ca Polish "Allow Tomcat be destroyed regardless of exceptions"
See gh-16892
2019-05-28 16:15:26 -07:00
Joao Silva
2b33e31a7c Allow Tomcat be destroyed regardless of exceptions
Update `TomcatWebServer` so that lifecycle exceptions are silently
swallowed when attempting shutdown. Prior to this commit it was
possible that a Tomcat instance might not be properly destroyed and
could leave non daemon threads running, which prevent the JVM from
exiting.

Fixes gh-16892
2019-05-28 16:10:37 -07:00
Phillip Webb
af1720aa2e Fix checkstyle issue 2019-05-28 15:52:00 -07:00
Phillip Webb
5fc67c545c Work around Framework regression in handling of null model values
See https://github.com/spring-projects/spring-framework/issues/23038.
2019-05-28 14:33:08 -07:00
Phillip Webb
89f8e187d5 Merge branch '2.1.x'
Closes gh-16988
2019-05-28 13:26:14 -07:00
Phillip Webb
07ebfc036b Polish 2019-05-28 13:17:56 -07:00
Johnny Lim
e2f69d040a Use actual resolvedType when checking Binder cache
Update `JavaBeanBinder` so that the `isOfDifferentType` method checks
both the actual type and the resolved type. Prior to this commit, it
was possible that when `canCallGetValue` is `true` the `resolvedType`
could be different from `type.resolve`.

Closes gh-16974
2019-05-28 13:13:08 -07:00