Commit Graph

1871 Commits

Author SHA1 Message Date
Sam Brannen 984f9de191 Fix Checkstyle violation
See gh-24375
2020-01-16 18:14:14 +01:00
Sam Brannen 2a2efbe611 Introduce @Disabled regression test for gh-24375 2020-01-16 17:16:57 +01:00
Sébastien Deleuze 3f1882c4eb Support noarg callable references in Kotlin beans DSL
Closes gh-23395
2020-01-13 10:53:23 +01:00
Stephane Nicoll bdb9f9570e Polish 2020-01-09 17:08:48 +01:00
Juergen Hoeller 4936a637fe Polishing 2020-01-09 17:03:17 +01:00
Juergen Hoeller b0e4b7e29c Re-calculate SimpleKey's hashCode field on deserialization
Closes gh-24320
2020-01-09 15:39:04 +01:00
stsypanov 8e5cad2af3 Add fast path for ClassUtils.hasMethod() 2020-01-08 18:52:15 +01:00
Sam Brannen e3e7d90415 Improve documentation for FullyQualifiedAnnotationBeanNameGenerator
See gh-24114
2020-01-08 16:47:39 +01:00
Sam Brannen b4c91e7dac Introduce BeanNameGenerator based on fully qualified class name
Prior to this commit, Spring offered two top-level implementations of
the BeanNameGenerator strategy: DefaultBeanNameGenerator and
AnnotationBeanNameGenerator. The latter is used as the default bean
name generator for beans picked up via component scanning. In a typical
application, this strategy works well; however, if multiple component
scanned beans have the same simple class name (i.e., identical names
ignoring the package), a BeanDefinitionStoreException is thrown.

To address such naming conflicts, users of Spring have had to implement
a custom BeanNameGenerator based on the fully qualified class name of
such components.

Similar conflicts can arise with components registered via
configuration class imports (i.e., via @Import), and
ConfigurationClassPostProcessor addresses this via an anonymous inner
class that extends AnnotationBeanNameGenerator but falls back to using
the fully qualified class name if an explicit bean name is not provided
via an annotation.

This commit extracts the implementation of
ConfigurationClassPostProcessor's internal BeanNameGenerator into a new
top-level FullyQualifiedAnnotationBeanNameGenerator class that can be
used to disambiguate between same-named components residing in
different packages that are picked up via component scanning. This bean
name generator can be configured via @ComponentScan's nameGenerator
attribute.

Closes gh-24114
2020-01-07 19:39:28 +01:00
Sam Brannen e1fb4a1966 Polishing 2020-01-07 18:47:54 +01:00
Sam Brannen 8a371c7669 Use Gradle test fixture support for spring-aop
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 57b771ba92 Move common FactoryMethods to spring-beans test fixtures
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 726b1bb1d0 Rename test fixture package in spring-context
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 7cd4ddf5fc Rename test fixture package in spring-beans
See gh-23550
2020-01-02 16:01:35 +01:00
Sam Brannen 4260c34b47 Rename test fixture package in spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 61d4ee594d Use Gradle test fixture support for spring-beans and spring-context
See gh-23550
2020-01-02 16:01:34 +01:00
Sam Brannen 5718bf424b Use Gradle test fixture support for spring-core
See gh-23550
2020-01-02 16:01:34 +01:00
Juergen Hoeller 7474ee7041 Polishing 2019-12-16 16:50:30 +01:00
Sam Brannen 47b18e5ea9 Polishing 2019-12-13 16:12:39 +01:00
lixiaolong11000 bee2b7cd73 Add missing test cases in XmlBeanFactoryTests
Closes gh-24189
2019-12-13 15:56:06 +01:00
Johnny Lim 1e83e889aa Use hasSize() where possible
See gh-24172
2019-12-10 07:58:53 +01:00
Sam Brannen 093323beeb Introduce Checkstyle rule to prohibit class names ending with "Test" 2019-11-29 17:30:29 +01:00
Sam Brannen 59e250c93c Consistent use of SCOPE_PROTOTYPE and SCOPE_SINGLETON constants
Closes gh-19905
2019-11-24 13:49:43 +01:00
Sébastien Deleuze 6c7250b0ae Make Kotlin DSL class constructors internal
Closes gh-24059
2019-11-22 16:10:42 +01:00
Sam Brannen fd6efb9a65 Polishing 2019-11-19 15:53:20 +01:00
Sam Brannen 8df3afd0b6 Polish contribution
See gh-23895
2019-11-14 13:26:38 +01:00
Sam Brannen 8186b77b58 Polish contribution
See gh-23895
2019-11-14 09:59:42 +01:00
monosoul a0e4ac39bf Inverse condition to fix ISO-formatted Instant parsing
Prior to this commit, InstantFormatter was able to properly serialize
an Instant that is far in the future (or in the past), but it could not
properly deserialize it, because in such scenarios an ISO-formatted
Instant starts with a +/- sign.

This commit fixes this issue, while maintaining the previous contract,
and also introduces tests for InstantFormatter.

Closes gh-23895
2019-11-14 09:59:42 +01:00
Juergen Hoeller 3dc5e7b1d5 Avoid String concatenation for lookup in StaticMessageSource
Closes gh-22451
2019-11-13 23:41:26 +01:00
Juergen Hoeller 22211a01ce Polishing 2019-11-13 17:23:23 +01:00
stsypanov f2b3953d76 Use array.clone() instead of manual array creation 2019-11-13 13:53:42 +01:00
Juergen Hoeller f61d728db9 Fallback Locale other than the system Locale through setDefaultLocale
Closes gh-23977
2019-11-13 13:48:08 +01:00
Juergen Hoeller c4ec6aea68 Fix Checkstyle violations
See gh-23784
2019-11-11 17:18:52 +01:00
Steven Schlansker fc55e66d50 ApplicationListenerMethodAdapter: gracefully handle beans which are actually NullBean
Currently, if you have an optional event listener (via a @Bean method returning `null`)
this causes the event multicaster to explode violently.  Now, we just safely skip it.
2019-11-11 15:43:29 +01:00
GungnirLaevatain d494621ee3 avoid store all bean name 2019-11-11 15:43:05 +01:00
Sam Brannen 64dfa462a6 Fix Javadoc for SmartLifecycle.DEFAULT_PHASE regarding ordering
Closes gh-23956
2019-11-09 18:03:07 +01:00
stsypanov f5ae3c77c6 Use Method::getParameterCount where possible 2019-11-07 18:00:15 +01:00
Sam Brannen d6002092c4 Clean up build warnings for ApplicationContextExpressionTests 2019-11-04 15:44:53 +01:00
Sam Brannen 74b7b550f6 Make MBeanServer tests more robust
This commit refactors several tests to use SocketUtils to find an
available port, compose a custom JMX service URL using that port, and
start an MBeanServer for the particular test using that port.

This commit also makes other changes to MBeanServer related tests in an
effort to make them more robust when executed concurrently.

Closes gh-23699
2019-10-31 14:34:57 +01:00
Sam Brannen 57b4b74e7d Polish Javadoc for JMX factory beans 2019-10-31 13:55:13 +01:00
Sam Brannen 9f00eb68e9 Clean up warnings 2019-10-30 19:14:58 +01:00
Christoph Dreis 3c17178b16 Fix Mockito deprecations 2019-10-30 18:30:05 +01:00
Brian Clozel 4beb25b318 Reorder date formatting converter in registrar
Prior to this commit, the `DateFormatterRegistrar` would register the
annotation-based formatter before the pattern-based formatter. This
would create an issue when an application tries to convert a `String` to
an annotated `@DateTimeFormat Date`: since the converters are considered
in reversed order of registration in
`GenericConversionServicei#ConvertersForPair`, the pattern-based variant
would always be considered before the annotation-based variant,
overriding the developer's opinion.

This commit aligns the `DateFormatterRegistrar` with the
`DateTimeFormatterRegistrar` and registers the annotation-based variant
last.

Closes gh-23893
2019-10-30 17:15:59 +01:00
Juergen Hoeller 19ff7d84ab Polishing 2019-10-30 14:31:46 +01:00
Sam Brannen 4dc966b04b Include @Inject TCK tests in the build again
Commit 979508a7f3 removed the JUnit 4
dependency from all modules except spring-test. Unfortunately, the
@Inject TCK tests (SpringAtInjectTckTests) are still based on JUnit 3.
Thus, that commit accidentally excluded those tests from the build.

This commit includes SpringAtInjectTckTests in the build again by
introducing a test runtime dependency on the JUnit Vintage TestEngine
in spring-context.

See gh-23451
2019-09-27 13:57:31 +02:00
Juergen Hoeller 2861fc65bd Polishing 2019-09-27 10:17:56 +02:00
Sam Brannen 6a207d0012 Polish AnnotationConfigApplicationContextTests 2019-09-26 16:45:49 +02:00
Johnny Lim 2a4dbcc623 Fix an assertion in AnnotationConfigApplicationContextTests
Closes gh-23719
2019-09-26 16:34:27 +02:00
Sam Brannen f05b4625de Merge branch '5.1.x' 2019-09-26 10:55:55 +02:00
Sam Brannen 7d126d3288 Improve documentation regarding "annotated classes"
See gh-23638
2019-09-26 10:26:36 +02:00