Commit Graph

1371 Commits

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