Commit Graph

1861 Commits

Author SHA1 Message Date
Juergen Hoeller 18f2e6a12d AnnotationConfigRegistry exposes registerBean with supplier/qualifiers
Closes gh-22457
2019-03-05 18:26:04 +01:00
www ef91313342 Use String::isEmpty instead of "".equals(arg) when arg is not null 2019-03-05 14:32:56 +01:00
Sam Brannen b7d60b9b89 Improve @EventListener documentation 2019-03-04 14:44:44 +01:00
Sam Brannen 70cf597484 Remove obsolete overview.html files 2019-03-04 14:07:48 +01:00
Sam Brannen 0ca5afd8e4 Fix broken test 2019-03-03 23:08:44 +01:00
Sam Brannen e7bd305e87 Suppress warnings in tests 2019-03-03 22:17:52 +01:00
Sam Brannen 6daf33deff Document that @Async is not supported in @Configuration classes 2019-03-03 18:29:45 +01:00
Sam Brannen 6853d50ddb Polishing 2019-03-03 16:29:49 +01:00
Sam Brannen 02be21d0dc Polishing 2019-03-02 14:22:28 +01:00
Juergen Hoeller a7db395d9b Merge branch '5.1.x' 2019-02-28 19:29:04 +01:00
Juergen Hoeller 7a7c7f51e3 Polishing 2019-02-28 15:37:47 +01:00
Juergen Hoeller fc7948c96b Merge branch '5.1.x' 2019-02-27 17:34:46 +01:00
Juergen Hoeller 0288878bcc Consistent handling of early FactoryBean instantiation failures
Closes gh-22409
2019-02-27 17:26:35 +01:00
pelladigabor a07245caf8 Exclude jdk package in ShadowingClassLoader
Many Java 11 internal classes are located in the jdk package. ShadowingClassLoader should not load them, because it can cause errors, e.g. java.lang.IllegalAccessError: class jdk.internal.reflect.ConstructorAccessorImpl loaded by org.springframework.instrument.classloading.ShadowingClassLoader @2bea5ab4 cannot access jdk/internal/reflect superclass jdk.internal.reflect.MagicAccessorImpl
2019-02-27 16:57:08 +01:00
www c31613dc74 Instantiate ArrayList class with a exact initial capacity 2019-02-25 23:13:35 +01:00
Juergen Hoeller bc0317af3b Merge branch '5.1.x' 2019-02-25 17:57:49 +01:00
Juergen Hoeller 9eb7f7e294 Polishing 2019-02-25 17:36:37 +01:00
Juergen Hoeller 4be41e9e26 Only use payload if it actually matches declared event type
Closes gh-22426
2019-02-25 17:18:07 +01:00
Sam Brannen d61c3d429c Improve Javadoc and exception message for LTW classes 2019-02-25 14:21:23 +01:00
Sebastien Deleuze dc8fb8bc5e Use StringJoiner where possible to simplify String joining 2019-02-25 12:11:57 +01:00
www f2aa374b73 Polish
Closes gh-22463
2019-02-25 08:41:00 +01:00
Juergen Hoeller 0652e4b485 Merge branch '5.1.x' 2019-02-22 14:51:00 +01:00
Juergen Hoeller c3fa900672 Upgrade to Hibernate Validator 5.4.3 and 6.0.15 2019-02-22 14:18:08 +01:00
Juergen Hoeller 6db75956b9 Merge branch '5.1.x' 2019-02-15 17:16:28 +01:00
Juergen Hoeller e307dd58db Polishing 2019-02-15 17:06:11 +01:00
Juergen Hoeller 4e47006a17 Merge branch '5.1.x' 2019-02-12 09:09:19 +01:00
Juergen Hoeller 8637540678 Expose empty annotation array as empty AnnotationAttributes array
Closes gh-22405
2019-02-12 09:07:51 +01:00
Juergen Hoeller 0b617a8c93 Deprecate PreferencesPlaceholderConfigurer along with its base class
Also removing common PropertyPlaceholderConfigurer doc references.

See gh-22181
2019-02-07 16:53:05 +01:00
Juergen Hoeller d25783329a Merge branch '5.1.x' 2019-02-07 16:01:14 +01:00
Juergen Hoeller 0f73a69033 AbstractApplicationContext resets local listeners to pre-refresh state
Closes gh-22325
2019-02-07 15:56:46 +01:00
Juergen Hoeller e9626779ee @Resource provides dependency descriptor for resolving beans by name
Closes gh-22359
2019-02-07 15:56:00 +01:00
Sebastien Deleuze 3787b23a98 Deprecate PropertyPlaceholderConfigurer
This commit deprecates PropertyPlaceholderConfigurer in favor of
PropertySourcesPlaceholderConfigurer.

Closes gh-22181
2019-02-06 16:00:24 +01:00
Sebastien Deleuze 0ad9349d84 Limit ref() and provider() visibility in Kotlin DSL
This commit makes ref() and provider() only available from
inside the bean lambda and not from the root level of the beans DSL.

Closes gh-22177
2019-02-05 16:59:56 +01:00
Juergen Hoeller 0ebc020b21 Load-time weaving support for WildFly 13+ (JBoss Modules 1.8+)
Fixes gh-22297
2019-02-05 00:44:52 +01:00
Juergen Hoeller a27a6470f7 Polishing 2019-02-05 00:10:22 +01:00
kudrevatykh 85474297be Load-time weaving support for WildFly 13+ (#22297)
Load-time weaving support for WildFly 13+ (JBoss Modules 1.8+)
2019-02-04 23:31:21 +01:00
Juergen Hoeller 5aed117b68 Model interface exposes getAttribute method (next to add/contains)
Fixes gh-22145
2019-01-28 22:50:29 +01:00
Juergen Hoeller d0033f12d0 ApplicationListenerMethodAdapter uses target method for order lookup
Fixes #22307
2019-01-25 15:44:43 +01:00
Rossen Stoyanchev bdac937a43 Replace more references to issue tracker
Fixes #22254
2019-01-17 17:08:39 -05:00
Juergen Hoeller f56fa91430 Polishing 2019-01-08 17:11:34 +01:00
Juergen Hoeller 9cb5369cb9 DependencyDescriptor supports TypeDescriptor resolution for fields
This allows for proper nested type conversion in @Value Optional fields analogous to method parameters, through a new TypeDescriptor-based method in the TypeConverter SPI. As an additional and less involved measure that is worth backporting, DefaultListableBeanFactory defensively checks for pre-converted Optional wrappers.

Issue: SPR-17607
2019-01-08 17:11:27 +01:00
Juergen Hoeller 199be6aec5 ValidationUtils.invokeValidator assertion for non-null target object 2018-12-17 14:24:56 +01:00
Juergen Hoeller aab421167b Revised format annotation docs 2018-12-13 17:19:50 +01:00
igor-suhorukov 93189a6733 String.indexOf() expressions can be replaced with a call to the String.contains() method available in Java 5 and newer. 2018-12-13 12:29:31 +01:00
diguage ee95a110bd Fix sample in EnableAsync Javadoc
Closes gh-2050
2018-12-13 10:16:56 +01:00
Juergen Hoeller c48672c4c7 ParameterNameDiscoverer may return individual null entries in an array
Issue: SPR-17565
2018-12-12 21:56:17 +01:00
Rossen Stoyanchev 38ae282c3b Update log category precision for all tests
Replace the full category capped at 36 chars with the class name only
and 1 char per package, e.g. org.apache.commons.Foo -> o.a.c.Foo
2018-12-12 11:40:33 -05:00
Juergen Hoeller 2c98c1b81a Relaxed assertion in NotificationPublisherAwareLazyTargetSource
Issue: SPR-17592
2018-12-12 12:16:14 +01:00
Juergen Hoeller ebbe14c363 ResolvableType-based matching consistently respects generic factory method return type (even for pre-initialized raw singleton instance)
Issue: SPR-17524
2018-11-25 21:27:19 +01:00
Juergen Hoeller ae8f680d2e Polishing 2018-11-22 18:21:56 +01:00
Juergen Hoeller bf272b0b21 Nullability fine-tuning based on IntelliJ IDEA 2018.3 inspection
Issue: SPR-15540
2018-11-22 16:12:38 +01:00
Juergen Hoeller 8c7579eba8 Polishing 2018-11-20 22:06:44 +01:00
Juergen Hoeller 2a5d7690b6 CglibAopProxy skips method proxy for equals/hashCode/toString override
Issue: SPR-17500
2018-11-20 22:04:28 +01:00
Juergen Hoeller ce5c65c0b0 Upgrade to JAXB 2.3.1, Groovy 2.5.4, Jetty 9.4.14, Tomcat 9.0.13
Includes JAX-WS 2.3.1, Awaitility 3.1.3, OkHttp 3.12, Woodstox 5.2.
2018-11-19 12:41:26 +01:00
Stephane Nicoll 7b6f2f8fb3 Polish contribution
Closes gh-2019
2018-11-19 08:45:33 +01:00
Hanope bfb49c7249 Fix typos
See gh-2019
2018-11-19 08:41:21 +01:00
Juergen Hoeller 40148c0560 Consistent use of ResolvableType.toClass() for assignability checks
Issue: SPR-17086
2018-11-12 20:29:37 +01:00
Juergen Hoeller f65408f646 Avoid references to groovy-all artifact across all modules
Issue: SPR-17446
2018-11-05 12:27:07 +01:00
Juergen Hoeller 991e9f4269 Upgrade to Joda-Time 2.10.1 2018-10-29 18:33:36 +01:00
Juergen Hoeller dc1e3b4628 Exclude FactoryBean implementation methods on CGLIB proxies as well
Issue: SPR-17374
2018-10-27 14:36:56 +02:00
Juergen Hoeller 00b7782b5f Clarify destruction order effect in @DependsOn annotation javadoc
Issue: SPR-17384
2018-10-18 18:03:44 +02:00
Juergen Hoeller 93bb78ec23 Avoid private bean classes in integration tests (for CGLIB on JDK 11)
Issue: SPR-16391
2018-10-15 12:26:38 +02:00
Juergen Hoeller 5f2d47a17e MethodValidationInterceptor excludes FactoryBean metadata methods
Issue: SPR-17374
2018-10-14 21:07:56 +02:00
Juergen Hoeller 309e70a48e Separate factory method cache for introspection purposes
Issue: SPR-17358
Issue: SPR-8891
2018-10-12 22:53:50 +02:00
volkovandr 61403e3bd3 Updated Javadoc: date format patterns SPR-17366 2018-10-11 10:52:32 +02:00
Juergen Hoeller c89e3e6e0d Restore original factory method caching (addressing Boot regressions)
Issue: SPR-17358
2018-10-10 23:53:13 +02:00
Stephane Nicoll 82a211fa96 Fix checkstyle violation 2018-10-10 10:45:08 +02:00
Stephane Nicoll 062805fcb3 Recursively process DeferredImportSelector properly
Previously, if a DeferredImportSelector was identified at a later stage
as part of processing the collected set of deferred imports, such
selector was processed as a regular import selector.

Semantically, it makes sense as we already are in the deferred phase at
this point and it doesn't make much sense to bother about the extra
contract.

However, Spring Framework 5 introduced the notion of Group that a
deferred import selector can define. When it does, the container has to
honour the contract of the Group rather than calling the simpler
ImportSelector parent contract.

This commit restructures the processing of such case. When a deferred
import selector is detected while processing deferred import selectors,
a group is created with only that selector and the group API is invoked.

Issue: SPR-17351
2018-10-10 10:19:11 +02:00
Juergen Hoeller f662e3b85e BeanFactoryAnnotationUtils provides qualifiedBeansOfType method
Includes consistent upfront resolution of factory method annotations.

Issue: SPR-8891
2018-10-09 23:14:27 +02:00
Juergen Hoeller c8c0737ce7 AbstractApplicationContext.getApplicationListeners() exposes all statically registered listeners
Issue: SPR-17324
2018-10-09 23:13:37 +02:00
Sebastien Deleuze af6a5566a3 Replace context by provider<T>() in Kotlin bean DSL
Spring Framework 5.1.0 exposed by mistake context in the Kotlin bean DSL
API in order to fix SPR-16269. Now that BeanFactory#getBeanprovider is
available, it should be exposed via a provider<Foo>() function in order
to provide a more clean API instead.

Issue: SPR-17352
2018-10-08 14:00:12 +02:00
Juergen Hoeller 9063e66c5d AbstractApplicationEventMulticaster pre-sorts singleton listeners
Issue: SPR-17307
2018-09-29 17:15:53 +02:00
Sebastien Deleuze f7839675f6 Don't set role in Kotlin bean DSL unless specified
Issue: SPR-17275
2018-09-20 00:21:38 +02:00
Sebastien Deleuze 47d6e91227 Leverage non-default ctor support in Kotlin bean DSL
Since non-default constructors are now evaluated for autowiring,
there is no need anymore for setting autowiring mode or exposing
it in Kotlin bean DSL.

Issue: SPR-17292
2018-09-20 00:21:38 +02:00
Juergen Hoeller b6b880ce27 Polishing 2018-09-19 23:05:40 +02:00
Juergen Hoeller 082c524cbe Polishing 2018-09-19 22:19:49 +02:00
Juergen Hoeller d3c08552e9 Revisit GenericApplicationContext.registerBean constructor handling
Support for Kotlin primary constructor and non-default public constructors in addition to default instantiation, aligned with AnnotationConfigApplicationContext and model attribute processing.

Issue: SPR-17292
2018-09-19 22:19:43 +02:00
Juergen Hoeller 0948edb39d Nested configuration class introspection check on concrete class
Issue: SPR-16839
2018-09-17 19:09:55 +02:00
Juergen Hoeller c8869d99f5 Deprecate autowire attribute on @Bean annotation
Issue: SPR-17281
2018-09-17 19:09:21 +02:00
Juergen Hoeller 34663300a6 Avoid regex pattern matching for simple String replacement steps
Issue: SPR-17279
2018-09-17 14:22:19 +02:00
Sebastien Deleuze c4aea626fe Update Kotlin bean DSL with new BeanDefinition methods
Issue: SPR-17275
2018-09-17 12:01:33 +02:00
Juergen Hoeller 97cea7f36e BeanDefinition interface exposes initMethodName and destroyMethodName
Also includes setters for role and description.

Issue: SPR-17275
2018-09-13 20:24:36 +02:00
Juergen Hoeller 77887ef739 BeanValidationPostProcessor validates singleton target behind proxy
Issue: SPR-17273
2018-09-13 20:24:27 +02:00
Juergen Hoeller 65c8fa400f Consistent ordered list access and lazy streaming for ObjectProvider
Includes fallback match for collection/map dependency if qualified.

Issue: SPR-17272
Issue: SPR-17197
2018-09-13 18:23:19 +02:00
Pascal Schumacher 184340ff8e Remove duplicate blank in log message of ExecutorConfigurationSupport#initialize
(obvious fix)
2018-09-12 21:32:43 +02:00
Juergen Hoeller b6d32ef55f Bean definition DSL generates unique bean names for bean classes
Issue: SPR-17242
2018-09-12 14:59:10 +02:00
Juergen Hoeller b83bc39ecd Restrict nested configuration class introspection to component types
Issue: SPR-16839
2018-09-12 14:02:45 +02:00
Johnny Lim 43a814b070 Remove duplicate assertions in AsyncExecutionTests 2018-09-11 17:19:32 +02:00
Juergen Hoeller c803ad7998 ConfigurationClassParser consistently uses ClassUtils.forName
Issue: SPR-17253
2018-09-07 12:56:23 +02:00
Sam Brannen f55a6051df Document default embedded value resolver support for property
placeholders

Spring 4.3 introduced support for registering a default embedded value
resolver for the default environment, in case of none having been
registered through post-processors (like PropertyPlaceholderConfigurer
and PropertySourcesPlaceholderConfigurer. However, the existing
documentation – stating that a static
PropertySourcesPlaceholderConfigurer bean is required in order for
values coming from @PropertySource declarations to be honored – was not
updated to reflect the change.

This commit addresses this by updating the JavaDoc for @Configuration
and @PropertySource accordingly

Issue: SPR-17212
2018-09-06 18:36:49 +02:00
Sam Brannen bff2d2cc85 Polishing 2018-09-04 14:47:37 +02:00
Korovin Anatoliy ab086f4225 Fix fragile tests for asynchronous events
This commit introduces a dependency on the Awaitility assertion
framework and makes use of asynchronous assertions in order to make
tests for asynchronous events more robust.

Issue: SPR-17211
2018-09-04 14:20:05 +02:00
Juergen Hoeller 95a56cd28d Polishing 2018-08-31 12:41:40 +02:00
stsypanov 7dba79c7c1 Use String::isEmpty instead of "".equals(arg) when arg is not null 2018-08-26 22:48:21 +02:00
Sam Brannen 4883b8aa03 Polish JavaDoc for @Configuration 2018-08-26 22:07:07 +02:00
Sam Brannen 52c91910b2 Polish JavaDoc for @Configuration 2018-08-26 15:03:05 +02:00
Juergen Hoeller 1d59e52f11 EventListenerMethodProcessor accepts internal configuration classes
Issue: SPR-17160
2018-08-18 12:05:39 +02:00
Juergen Hoeller 84300b796c Fix recent javadoc errors
Issue: SPR-17174
2018-08-16 18:51:31 +02:00
Juergen Hoeller 04d2d1da0d Consistently use double quotes (even if no interpolation needed)
Includes upgrade to Hibernate ORM 5.3.5, EclipseLink 2.7.3, Selenium HtmlUnit Driver 2.32.1, Jetty 9.4.12 RC2.
2018-08-16 15:32:44 +02:00
Juergen Hoeller 2ec8fa9cac SmartLifecycle default methods for auto-startup in default phase
Issue: SPR-17188
2018-08-16 12:08:02 +02:00
Juergen Hoeller 109a2b49e5 Consistently skip unnecessary search on superclasses and empty elements
Includes caching of declared annotation arrays and combined searching for several annotation types (used in SpringCacheAnnotationParser).

Issue: SPR-16933
2018-08-15 17:30:14 +02:00
Juergen Hoeller 04a7f0884b SpringCacheAnnotationParser.parseCacheAnnotations cannot be protected
Its parameter DefaultCacheConfig is just package-visible...
2018-08-13 12:43:59 +02:00
Sam Brannen aebbd949a8 Suppress deprecation warnings in AnnotationProcessorPerformanceTests 2018-08-13 12:35:19 +02:00
Juergen Hoeller c4a7567a5e Post-processors consistently ignore ScopedObject/AopInfrastructureBean
JmsListenerAnnotationBeanPostProcessor also ignores JmsListenerContainerFactory and JmsListenerEndpointRegistry, avoiding unnecessary annotation introspection on framework classes.

Issue: SPR-17166
Issue: SPR-16933
2018-08-12 11:47:28 +02:00
Juergen Hoeller 71d4dbea13 Post-processors ignore AopInfrastructureBean (includes ScopedObject)
Issue: SPR-17166
2018-08-11 23:10:57 +02:00
Juergen Hoeller 8bf8092740 Post-processors consistently ignore ScopedObject/AopInfrastructureBean
ScheduledAnnotationBeanPostProcessor also ignores TaskScheduler and ScheduledExecutorService, avoiding unnecessary annotation introspection on framework classes.

Issue: SPR-17166
Issue: SPR-16933
2018-08-11 22:20:07 +02:00
Juergen Hoeller aebb2d52e0 Logging refinements for transaction and cache processing (debug/trace)
Issue: SPR-16946
2018-08-10 15:45:46 +02:00
Juergen Hoeller c437a0d1c3 Declare default methods for supportsSourceType and getOrder
Issue: SPR-17163
2018-08-10 15:42:30 +02:00
Juergen Hoeller 20f2e23bfb Polishing 2018-08-09 23:57:25 +02:00
Juergen Hoeller b3ca2d50a2 DefaultLifecycleProcessor properly counts dependent beans in same phase
Includes log level revision towards TRACE for cleaner DEBUG experience.

Issue: SPR-16901
Issue: SPR-16946
2018-08-09 17:31:29 +02:00
Juergen Hoeller 3a5def047f @Scheduled supports "-" as cron expression value for disabled triggers
Issue: SPR-16858
2018-08-09 16:12:05 +02:00
Juergen Hoeller 8e571decc1 Polishing 2018-08-09 11:59:15 +02:00
Juergen Hoeller 7cf98261ce Polishing 2018-08-08 23:56:17 +02:00
Juergen Hoeller 3f7d4b107e Avoid unnecessary annotation introspection on framework classes
Issue: SPR-16933
2018-08-08 23:53:45 +02:00
Juergen Hoeller b8b6367f9b ConcurrentModel ignores null value for put (also used by putAll)
Issue: SPR-17141
2018-08-08 23:51:55 +02:00
Sam Brannen 52f6dcf525 Fix typo 2018-08-08 13:25:14 +02:00
Kazuhiro Sera be211ceead Fix typos detected by github.com/client9/misspell 2018-08-08 12:50:46 +02:00
Juergen Hoeller b325c74216 Pruning of outdated JDK 6/7 references (plus related polishing) 2018-08-07 20:36:47 +02:00
Juergen Hoeller 2b051b8b32 Deprecate support classes for Sun's JDK HTTP server
Issue: SPR-17143
2018-08-07 20:35:53 +02:00
Juergen Hoeller 34ddb88851 ConcurrentModel.addAttribute(String, Object) ignores null value
Issue: SPR-17141
2018-08-07 20:35:34 +02:00
Juergen Hoeller 2938a95435 Pre-size LinkedHashSet for annotation parsers
Issue: SPR-17074
2018-08-07 01:35:57 +02:00
Juergen Hoeller d72d376f03 Avoid unnecessary annotation introspection on framework methods
Issue: SPR-16933
2018-08-07 01:35:32 +02:00
Juergen Hoeller e64c6dfa3d MergedBeanDefinitionPostProcessors clear internal caches on bean reset
Issue: SPR-17126
2018-08-06 15:41:35 +02:00
Juergen Hoeller 50550717d6 SchedulingTaskExecutor provides prefersShortLivedTasks default method
Issue: SPR-17116
2018-08-02 14:36:53 +02:00
Juergen Hoeller 589b7048ec Avoid synthesizable annotation creation for @Bean/@Scope processing
Includes consistent (non-)use of AnnotationUtils/AnnotatedElementUtils.

Issue: SPR-16933
2018-08-01 11:43:28 +02:00
Сергей Цыпанов f8340838b3 Use lambda expressions for lazy instantiation (#1911)
Issue: SPR-17074
2018-07-31 13:03:18 +02:00
Juergen Hoeller f74a631ea1 Nullability refinements in spring-webmvc
Includes revision of web.servlet.tags.form for non-null conventions.

Issue: SPR-15540
2018-07-30 22:08:11 +02:00
Juergen Hoeller 4a147d26fc Initialize pre-filled HashMaps with large enough capacity
Empty Maps are preferably initialized without capacity (not initializing them at all or lazily initializing with default capacity when needed).

Issue: SPR-17105
2018-07-30 22:07:31 +02:00
Juergen Hoeller 1fd6248d84 Polishing 2018-07-27 17:46:21 +02:00
Juergen Hoeller c037e75f26 Improve debug logging at BeanDefinitionReader and BeanFactory level
Issue: SPR-17090
2018-07-27 17:46:05 +02:00
Juergen Hoeller 025fd2962e Polishing 2018-07-26 23:51:52 +02:00
Juergen Hoeller 7c9ba80f85 Polishing 2018-07-26 23:20:50 +02:00
Bhavani Shekhawat ee95f171c8 Update PropertySourcesPlaceholderConfigurer.java
Fix the error message when PropertySources are not applied
2018-07-26 20:48:50 +02:00
Juergen Hoeller e458777925 Properly identify event-related ClassCastExceptions on JDK 11
Issue: SPR-17093
2018-07-26 14:41:53 +02:00
Rossen Stoyanchev 14d0fee86c Improve context-related logging on web startup
Sample output at TRACE:
```
DispatcherServlet - Initializing Servlet 'org.springframework.web.servlet.DispatcherServlet-7a8c8dcf'
AnnotationConfigWebApplicationContext - Refreshing WebApplicationContext for namespace 'org.springframework.web.servlet.DispatcherServlet-7a8c8dcf-servlet', started on Wed Jul 25 17:46:38 EDT 2018
AnnotationConfigWebApplicationContext - Registering [org.springframework.web.servlet.mvc.method.annotation.RequestPartIntegrationTests$CommonsMultipartResolverTestConfig]
AnnotationConfigWebApplicationContext - No 'messageSource' bean, using [Empty MessageSource]
AnnotationConfigWebApplicationContext - No 'applicationEventMulticaster' bean, using [SimpleApplicationEventMulticaster]
AnnotationConfigWebApplicationContext - No 'lifecycleProcessor' bean, using [DefaultLifecycleProcessor]
...
DispatcherServlet - Initialization completed in 3361 ms
```

Issue: SPR-16946
2018-07-25 17:50:03 -04:00
Sebastien Deleuze d3b244a81b Optimize class detection by sharing the ClassLoader
Issue: SPR-17083
2018-07-25 11:09:42 +02:00
Juergen Hoeller 47d8fe83df Upgrade to Interceptor API 1.2.2, Moneta 1.3, Rome 1.11 2018-07-24 14:44:56 +02:00
Juergen Hoeller 20c34cbb9b Provide predetermined capacity for cache operation collections
Issue: SPR-17079
2018-07-24 13:27:02 +02:00
Juergen Hoeller a9c9ba6601 Generic matching for ObjectProvider stream and empty vararg resolution
Issue: SPR-11419
Issue: SPR-15338
2018-07-24 13:03:54 +02:00
Juergen Hoeller 1603c4ab2f Programmatic ObjectProvider retrieval through BeanFactory API
Introduces getBeanProvider(Class) and getBeanProvider(ResolvableType), also narrowing getBean(String, Class) and isTypeMatch(String, Class) to a non-null Class argument and enriching NoUniqueBeanDefinitionException with a full ResolvableType. In addition, ObjectProvider supports iterable/stream access for collection-style resolution of multiple matching beans now, and collection injection falls back to an empty collection in a single-constructor case with non-null arguments.

Issue: SPR-17075
Issue: SPR-11419
Issue: SPR-15338
2018-07-24 00:42:03 +02:00
Juergen Hoeller 13873dafb7 Polishing 2018-07-22 17:55:31 +02:00
Juergen Hoeller 9a43d2ec20 Revised log levels: less WARN and INFO, fine-tuned DEBUG vs TRACE
Issue: SPR-16946
2018-07-20 15:05:16 +02:00
Juergen Hoeller 252f52ab07 Tighten (IntroductionAware)MethodMatcher contract
Provides a non-null guarantee for MethodMatcher's targetClass argument and strict separation between IntroductionAwareMethodMatcher and regular MethodMatcher, enabling DefaultAdvisorChainFactory to defer its IntroductionAdvisor determination until encountering an actual IntroductionAwareMethodMatcher (even behind union/intersection).

Issue: SPR-17068
2018-07-20 00:17:31 +02:00
Juergen Hoeller 478d7255d2 GenericApplicationListenerAdapter caches resolved event types
Issue: SPR-16970
2018-07-19 16:34:19 +02:00
Juergen Hoeller 52d124de6f Use supplier-aligned type information for FactoryBean type resolution
Issue: SPR-17063
2018-07-19 13:14:20 +02:00
Juergen Hoeller 0b60447c49 Javadoc update: ConfigurationClassPostProcessor is priority-ordered
Issue: SPR-17062
2018-07-19 11:59:40 +02:00
Juergen Hoeller 9c08a482d1 Prefer ArrayList/ArrayDeque over LinkedList for multi-element holders
LinkedList remains in place where a List is likely to remain empty or single-element (in order to avoid unused capacity).

Issue: SPR-17037
2018-07-18 22:17:42 +02:00
Juergen Hoeller 28f7b26294 Null-returning instance supplier resolves to NullBean
Issue: SPR-17057
2018-07-18 15:26:06 +02:00
Juergen Hoeller 5fcfe0fa8e Polishing 2018-07-18 14:27:16 +02:00
Juergen Hoeller 955665b419 Consistent processing of binding/validation failures for data classes
Includes an extension of SmartValidator for candidate value validation, as well as nullability refinements in Validator and BindingResult.

Issue: SPR-16840
Issue: SPR-16841
Issue: SPR-16854
2018-07-17 17:01:34 +02:00
Juergen Hoeller faef363e85 Evaluate @Cacheable(condition) once per method invocation only
Issue: SPR-17024
2018-07-16 13:04:14 +02:00
Juergen Hoeller f6fdffd663 Lazily retrieve delegate beans in AsyncConfigurer and CachingConfigurer
Introduces a configure method pattern for Supplier-style configuration and a common SingletonSupplier decorator for method reference suppliers. Also declares jcache.config and jcache.interceptor for non-null conventions.

Issue: SPR-17021
2018-07-14 19:29:32 +02:00
Juergen Hoeller f123d6c3bc Upgrade to Netty 4.1.27 and Commons Pool 2.6 2018-07-12 16:53:37 +02:00
Juergen Hoeller fc699b2b37 @Bean provides autowireCandidate flag (analogous to XML definitions)
Issue: SPR-16204
2018-07-04 22:41:05 +02:00
Juergen Hoeller a5dd0f0c09 Fix accidental @Nullable declaration on addAttribute(Object)
Issue: SPR-16831
2018-07-04 15:06:56 +02:00
Juergen Hoeller f2787cfb35 Same method filtering in ConstructorResolver and getTypeForFactoryMethod
Issue: SPR-16999
2018-07-03 15:53:17 +02:00
Juergen Hoeller e5a6711d29 Consistent final declaration for static delegate classes
Issue: SPR-16968
2018-07-02 13:55:18 +02:00
Juergen Hoeller 4ff1e3e74b Consistent abstract declaration for utility classes (plus polishing)
Issue: SPR-16968
2018-07-01 02:31:20 +02:00
Juergen Hoeller d58c09b89f Up-to-date coverage of task executor and scheduler variants
Includes a clarification of ThreadPoolExecutor configuration options and a note on early AsyncConfigurer initialization.

Issue: SPR-16944
Issue: SPR-16945
2018-06-29 19:43:14 +02:00
Juergen Hoeller 8ad5299f4a Polishing 2018-06-28 17:12:29 +02:00
Juergen Hoeller 40efcc933c Polishing 2018-06-28 14:51:33 +02:00
Juergen Hoeller 81cb740e0a New postProcessProperties variant on InstantiationAwareBeanPostProcessor
Allows for skipping the now-deprecated postProcessPropertyValues callback with its expensive PropertyDescriptor retrieval requirement. RequiredAnnotationBeanPostProcessor (which is dependent on postProcessPropertyValues) and the @Required annotation itself are also deprecated now: in favor of constructor injection (or afterPropertiesSet).

Issue: SPR-16918
2018-06-28 14:15:16 +02:00
Phillip Webb a89e716cc7 Use tabs rather than spaces in tests
Update tests to ensure that tabs are used instead of spaces. Also
consistently apply a new line at the end of each file.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 1c25cec44f Polish test code
Polish a few issue identified when adding checkstyle to the
build. Although checkstyle is not enforcing rules on tests,
these are a few minor changes that are still worth making.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 81451aa800 Organize imports
Reorganize imports to ensure consistent ordering. This commit also
expands any `.*` static imports in favor of using fully-qualified
method references.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb b220d94cc2 Never use parenthesis for single lambda arguments
Update all lambdas that take a single argument so that parenthesis
are never used.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 5cedd0d5d4 Consistently use tabs rather than spaces
Update code that has accidentally used spaces instead of tabs.
Also remove all trailing whitespace.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 9de3689f63 Never use 'this.' when accessing loggers
Ensure that `this.` is never used when accessing loggers.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 0b53c1096a Always use 'this.' when accessing fields
Ensure that `this.` is used consistently when accessing class
fields.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb eeebd51f57 Use consistent class design
Update all classes so that inner classes are always last. Also
ensure that utility classes are always final and have a private
constructor and make exceptions final whenever possible.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 0ad0f341bd Don't use single letter catch variables
Update existing catch blocks to ensure that `ex` is always used
in preference to `e` or `t` as the variable name.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb 866e9d702e Use consistent block style
Update all code to use a consistent block style.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb c3a17dfd47 Ensure all files end with a newline
Update all files to ensure that they always end with a new line.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Phillip Webb e0480f75ac Fix javadoc checkstyle issues
Fix checkstyle violations for javadoc.

Issue: SPR-16968
2018-06-28 10:28:44 +02:00
Sam Brannen 4184ebe799 Polish profile expression support
Issue: SPR-12458
2018-06-16 21:40:22 +03:00
Stephane Nicoll 1f3b4f1863 Polish "Add profile expression support"
Issue: SPR-12458
2018-06-15 16:01:16 +02:00
Juergen Hoeller 0dc434b35e Polishing 2018-06-13 22:04:10 +02:00
Juergen Hoeller 9aed9bf823 Allow for custom ScheduledTaskRegistrar and/or ScheduledMethodRunnable
Issue: SPR-16834
Issue: SPR-16812
2018-06-13 22:03:01 +02:00
Juergen Hoeller b71795ba36 Restore original DefaultLifecycleProcessor behavior for the time being
Issue: SPR-16901
2018-06-10 23:52:27 +02:00
Brian Clozel 0092653d42 Fix JDK9 build after Groovy 2.5 upgrade
After the Groovy 2.5 upgrade, the Spring Framework build on JDK9 hit
GROOVY-8631. Adding the relevant `jax-api` dependency to the module
didn't fix this issue. The Groovy release notes mention the use of the
`--add-modules` JVM flag, but this is not an option for this build which
should run on JDK8 -> JDK11.

This commit changes the dependency from `groovy-all` to more focused
dependencies on Groovy in the `spring-beans` and `spring-context`
modules. This change seems to avoid the automatic loading of Groovy
enhancements to JAXB (shipped with `groovy-xml`).

See:

* http://groovy-lang.org/releasenotes/groovy-2.5.html#Groovy2.5releasenotes-Knownissues
* https://issues.apache.org/jira/browse/GROOVY-8631

Issue: SPR-15407
2018-06-08 13:37:44 +02:00
Juergen Hoeller 6cf197864c DefaultLifecycleProcessor properly handles count for dependent beans
Issue: SPR-16901
2018-06-06 21:25:26 +02:00
Stephane Nicoll f1871f9e3f Fix faulty BeanPostProcessorChecker logs with @EnableCaching
Issue: SPR-16896
2018-06-04 14:51:14 +02:00
Sebastien Deleuze b71d0eeec9 Fix Kotlin bean DSL conditional handling
Issue: SPR-16412
2018-06-01 14:40:27 +02:00
Juergen Hoeller 356bfe6e2e Upgrade to Joda-Time 2.10 2018-05-31 23:35:15 +02:00
Sebastien Deleuze a7a29a8226 Revisit PropertyResolver Kotlin extensions
Issue: SPR-16883
2018-05-31 12:20:37 +02:00
Juergen Hoeller 1b728fb244 Polishing 2018-05-30 11:10:37 +02:00
Juergen Hoeller b39ce80c87 Doc: @EnableScheduling needs to be declared per application context
Issue: SPR-16852
2018-05-29 21:52:51 +02:00
Juergen Hoeller 46a89d9534 Restore lenient null return value for ConditionContext.getBeanFactory()
Includes nullable return value for getClassLoader() with corresponding notes in applicable javadoc.

Issue: SPR-16866
2018-05-29 21:51:06 +02:00
Juergen Hoeller 5bbeadec0c Detect nested configuration classes even for empty outer classes
Issue: SPR-16839
2018-05-29 21:47:53 +02:00
Sebastien Deleuze be416ef9c4 Polish BeanDefinitionDsl
Issue: SPR-16412
2018-05-29 09:34:35 +02:00
Juergen Hoeller 5b3bbad6a0 ConcurrentModel.addAttribute javadoc: null value not supported
Issue: SPR-16831
2018-05-18 22:20:08 +02:00
Juergen Hoeller 795e5d306c Upgrade to JSR-354 Money & Currency API 1.0.3 and Moneta 1.2.1 2018-05-05 20:38:28 +02:00
Johnny Lim fb898e1727 Remove inconsistent spaces 2018-05-05 11:07:35 +02:00
Juergen Hoeller 9281f820f1 Expose FactoryBean's raw object on retrieval during post-processing
Issue: SPR-16783
2018-05-02 15:21:40 +02:00
Juergen Hoeller c8b6233bd0 Introspect originating bean definition as configuration class candidate
Issue: SPR-16756
2018-05-02 15:20:42 +02:00
Juergen Hoeller ad0d79a97b Lenient fallback to plain getBundle call without Control handle
Includes defaultEncoding variant for platform default encoding.

Issue: SPR-16776
2018-05-01 23:50:34 +02:00
Juergen Hoeller d5aedac6db Avoid custom ResourceBundle.Control on Jigsaw (as far as possible)
Issue: SPR-16776
2018-04-27 18:24:31 +02:00
Juergen Hoeller eaff2c28a7 Consistent target method resolution for event and caching expressions
Issue: SPR-16779
2018-04-27 18:23:42 +02:00
Juergen Hoeller aa11721ff0 AopUtils.getMostSpecificMethod exposes dynamic proxy class methods
Includes efficient canApply check for IntroductionAwareMethodMatcher.

Issue: SPR-16757
2018-04-27 18:23:34 +02:00
Juergen Hoeller a2a8d0c754 Workaround for generic parameter types on inner class constructors
Issue: SPR-16734
2018-04-17 12:58:32 +02:00
Juergen Hoeller d4a55a257b OperatorMatches flags misguided evaluation attempts as FLAWED_PATTERN
Issue: SPR-16731
2018-04-17 11:10:15 +02:00
Juergen Hoeller b95e05db04 AspectJExpressionPointcut consistently resolves superinterface methods
Includes efficient check for same ClassLoader in ClassUtils.isVisible, efficient MethodMatchers check for IntroductionAwareMethodMatcher, and supertype method resolution in MethodMapTransactionAttributeSource.

Issue: SPR-16723
2018-04-14 15:10:05 +02:00
sdeleuze 97ee94f4ca Expose env and context in Kotlin beans DSL
This commit introduces a deferred initialization of the declared beans
in order to make it possible to access to the environment (and even
to the context for advanced use-cases) in the beans { } Kotlin DSL.

Issues: SPR-16269, SPR-16412
2018-04-12 11:31:37 +02:00
Juergen Hoeller 61c3db0869 MethodHandles.Lookup.defineClass for CGLIB class definition purposes
Spring's CGLIB fork is patched with local copies of affected files here, introducing the notion of a "contextClass" (e.g. the proxy superclass) which gets passed through to ReflectUtils.defineClass for delegating to MethodHandles.Lookup.defineClass eventually, against a privateLookupIn(contextClass) lookup context on JDK 9/10/11.

Issue: SPR-15859
2018-04-11 12:47:55 +02:00
Juergen Hoeller cdaa247861 Unwind _TestTypes to top-level public test classes in AOP test suite 2018-04-11 12:43:49 +02:00
Juergen Hoeller 6102715b8d Consistent treatment of proxy classes and interfaces for introspection
Issue: SPR-16675
Issue: SPR-16677
2018-04-03 02:42:41 +02:00
Juergen Hoeller cc379f1cc7 Polishing 2018-04-01 12:57:19 +02:00
Juergen Hoeller bc07a54075 Clear AnnotationUtils cache after context refresh (along with others)
Issue: SPR-16675
2018-03-31 23:08:30 +02:00
Juergen Hoeller 912c270f2b Polishing 2018-03-31 17:49:21 +02:00
Juergen Hoeller 4da27c2a73 Avoid unnecessary introspection on methods and meta-annotations
Issue: SPR-16667
2018-03-31 00:18:14 +02:00
Juergen Hoeller 78681c6369 JndiRmiServiceExporter still calls PortableRemoteObject when available
Issue: SPR-16670
2018-03-30 15:19:38 +02:00
Juergen Hoeller d553ddc5b3 Nullability refinements (based on IntelliJ IDEA 2018.1 introspection)
Issue: SPR-15756
2018-03-29 23:50:17 +02:00
igor-suhorukov e6020ed377 avoid unnecessary autoboxing 2018-03-28 23:48:12 +02:00
Stephane Nicoll d1a0b8d53f Clarify the format supported by @PropertySource
Issue: SPR-16563
2018-03-28 11:03:53 +02:00
igor-suhorukov 4aae6a6dda Use Map.forEach instead of manual Map.Entry iteration wherever possible SPR-16646 2018-03-28 01:09:03 +02:00
Juergen Hoeller e3d0ef6015 Use Map.forEach instead of manual Map.Entry iteration wherever possible
Issue: SPR-16646
2018-03-27 00:38:32 +02:00
Juergen Hoeller 8d5587fe4f Consistent thread-safe iteration in DefaultSingletonBeanRegistry
Issue: SPR-16620
2018-03-24 16:30:51 +01:00
Christoph Dreis d3a0a8e007 Use Collection.removeIf() where possible (#1747)
Use Collection.removeIf() where possible

Issue: SPR-16622
2018-03-22 11:36:11 +01:00
Juergen Hoeller 99399084a6 Consistent Future check (even if typically encountering RunnableFuture)
Issue: SPR-16607
2018-03-19 12:42:49 +01:00
Juergen Hoeller 3c1adf7f6a ThreadPoolTaskExecutor/Scheduler cancels remaining Futures on shutdown
Issue: SPR-16607
2018-03-19 01:45:22 +01:00
Juergen Hoeller 4fef1fe820 Polishing 2018-03-16 18:49:12 +01:00
Juergen Hoeller 914b2470dc Scope annotation in class hierarchies vs XML bean definition inheritance
Issue: SPR-16602
2018-03-16 18:49:00 +01:00
Juergen Hoeller c4e9ce8d0e Clarified repeatable PropertySource annotation vs use as meta-annotation
Issue: SPR-16592
2018-03-14 18:53:50 +01:00
Juergen Hoeller 3988dd9ebb Polishing 2018-03-14 17:24:58 +01:00
Stephane Nicoll cc12afdea2 Add support for deferred import selector group
This commit allows several DeferredImportSelector instances to be
grouped and managed in a centralized fashion. This typically allows
different instances to provide a consistent ordered set of imports to
apply.

Issue: SPR-16589
2018-03-13 16:52:26 -04:00
Juergen Hoeller 04a8f81710 Polishing 2018-03-12 20:42:03 +01:00
Juergen Hoeller 50e980c02f Validate declared annotations before deciding between reflection and ASM
Issue: SPR-16564
2018-03-12 13:40:26 +01:00
Stephane Nicoll fb7c4a3066 Polish 2018-03-11 10:26:41 +01:00
igor-suhorukov 6163f2d32f use more modern java API for empty collections 2018-03-08 21:41:57 +01:00
Juergen Hoeller 139dc1d373 Polishing (collapsed if checks, consistent downcasts, refined javadoc) 2018-03-08 18:11:57 +01:00
igor-suhorukov 0f7485b01d Polish: reorder the modifiers to comply with the Java Language Specification. 2018-03-08 17:57:47 +01:00
Sam Brannen 0f5a3e2647 Polish formatting in Groovy scripts 2018-03-07 16:09:04 +01:00
Sam Brannen df0b39e8ac Add missing packages to Groovy scripts 2018-03-07 16:09:03 +01:00
Juergen Hoeller f57fcdee3c Polishing 2018-03-07 15:49:58 +01:00
igor-suhorukov 129530f792 Polish
Closes gh-1715
2018-03-03 12:12:15 +01:00
igor-suhorukov ed936cbd89 Polish: Overriding methods should do more than simply call the same method in the super class 2018-03-02 00:06:27 +01:00
Juergen Hoeller 33cd160861 Upgrade to Reactor Bismuth SR7, Hibernate ORM 5.2.14, Common Annotations 1.3.2 2018-02-28 14:01:04 +01:00
igor-suhorukov 7bce04c06c Polish: combine catches block with same body 2018-02-27 12:51:28 +01:00
Juergen Hoeller c2d5ca9811 Proper nullable return declaration for AbstractValueAdaptingCache.lookup
Issue: SPR-15540
2018-02-26 13:05:12 +01:00
Juergen Hoeller 7d89de06e3 Enforce GMT timezone for testBindInstantFromJavaUtilDate
Issue: SPR-16534
2018-02-26 13:02:17 +01:00
igor-suhorukov c782075a13 Polish: Array designators "[]" should be on the type, not the variable 2018-02-25 13:14:20 +01:00
Juergen Hoeller 3531c104b0 Prefer Collections.addAll call with array over Set.addAll(Arrays.asList) 2018-02-25 00:21:39 +01:00
Juergen Hoeller a5cbf5fe24 Consistent use of Collection.toArray with zero-sized array argument
Includes consistent use of ClassUtils.toClassArray (as non-null variant)

Issue: SPR-16523
2018-02-22 11:29:46 +01:00
Juergen Hoeller d7cab23e6d Consistent use of StringUtils.toStringArray
(cherry picked from commit 6d11b40)
2018-02-16 20:49:17 +01:00
Juergen Hoeller 8d3264f680 Prefer List.sort(Comparator) over Collections.sort(List, Comparator) 2018-02-16 10:23:18 +01:00
Juergen Hoeller 3b810f3544 Consistent Class array vs vararg declarations (and related polishing) 2018-02-14 14:44:00 +01:00
igor-suhorukov 7826567df6 Polish: lamdbas containing only one statement should not nest this statement in a block 2018-02-14 01:22:01 +01:00
Juergen Hoeller 37609e4ede Object/FieldError exposes source object through unwrap/contains methods
Issue: SPR-16372
2018-02-13 17:58:31 +01:00
Juergen Hoeller d3cee45f30 Polishing 2018-02-13 13:15:29 +01:00
Juergen Hoeller d5cabca2f7 Internal adaptation to Deque semantics 2018-02-12 15:55:09 +01:00