Commit Graph

224 Commits

Author SHA1 Message Date
Juergen Hoeller 240819f955 Introduced "spring.beaninfo.ignore" system property for optimized Introspector usage
Issue: SPR-9014
(cherry picked from commit f88cbda)
2014-01-03 16:39:34 +01:00
Juergen Hoeller f9e8eb59e1 Fixed hasUnresolvableGenerics() to return false in case of an unresolvable bounded variable as well
Issue: SPR-11250
2013-12-20 16:44:25 +01:00
Juergen Hoeller b1460742c3 InjectionMetadata caching per bean name needs to refresh when bean class changes
Issue: SPR-11246
2013-12-19 23:49:31 +01:00
Juergen Hoeller cb682cd8b7 Revised BeanInfoFactory javadoc
Issue: SPR-9014
2013-12-19 15:10:27 +01:00
Juergen Hoeller 8a3b4c69c8 Fixed primitive type assignability in BeanUtils.copyProperties
Issue: SPR-11231
2013-12-16 20:18:37 +01:00
Juergen Hoeller a3a43448d1 Polishing 2013-12-11 23:56:39 +01:00
Juergen Hoeller 106a973a4d Prevent early FactoryBean creation for type checking purposes when coming from a factory method on yet another bean (e.g. from a configuration class)
Issue: SPR-11202
2013-12-11 22:57:22 +01:00
Juergen Hoeller bc5affa79a Made BeanUtils.copyProperties defensive about property type mismatches
Issue: SPR-11209
2013-12-11 20:49:18 +01:00
Juergen Hoeller 1b4e02b178 RequiredAnnotationBeanPostProcessor skips factory-bean definitions
Also moving the associated unit tests to the correct package beans.factory.annotation

Issue: SPR-10458
2013-12-11 16:11:16 +01:00
Juergen Hoeller 62ea627965 Revised exclusion of java.lang.Class properties
Issue: SPR-11098
2013-12-11 11:58:46 +01:00
Juergen Hoeller cb624e25c5 Fixed ExtendedBeanInfo and its tests to accept JDK 8 b117+ introspection results
Specifically, read and write methods are allowed to express property types with superclass/subclass relationships in both directions now.

Issue: SPR-11139
2013-12-10 22:34:17 +01:00
Juergen Hoeller eb1b3c5a68 Use bean-creating factory's AutowireCandidateResolver even for dependencies in parent factory
Specifically, if the current factory has Qualifier/ContextAnnotationAutowireCandidateResolver set up, it is important to pass it on to ancestor factories to get consistent qualifier matching results.

Issue: SPR-10966
2013-12-10 15:33:57 +01:00
Juergen Hoeller be63c07b2e Polishing 2013-12-10 13:26:52 +01:00
Juergen Hoeller 242ecdc448 Fixed inner bean name determination for multi-level nesting scenario, calculating a unique bean name as early as possible now (and for any kind of bean scope)
Our per-bean caching in AutowiredAnnotationBeanPostProcessor and co relies on unique bean names, so this change fixes potential cache mismatch problems occuring there.

Issue: SPR-11131
2013-12-09 21:45:44 +01:00
Juergen Hoeller 5dcd28761c Fixed type resolution for uninitialized factory-method declaration
Issue: SPR-11112
2013-12-09 18:53:27 +01:00
Juergen Hoeller 6078c27e60 Fixed evaluation of "!" operator in case of multiple profile expressions
Issue: SPR-11093
2013-12-09 13:29:21 +01:00
Juergen Hoeller 8580d2d19e Fixed detection of generic types and qualifier annotations on scoped-proxy factory methods
Issue: SPR-11116
2013-12-08 23:24:16 +01:00
Phillip Webb c2b56c07e5 Cache property TypeDescriptors
Attempt to improve performance by caching TypeDescriptors against bean
PropertyDescriptors in CachedIntrospectionResults.

This change is an attempt to fix the failing performance test case
`testPrototypeCreationWithOverriddenResourcePropertiesIsFastEnough` in
`AnnotationProcessorPerformanceTests`.
2013-12-02 21:55:00 -08:00
Juergen Hoeller bd8469990d Detect depends-on cycles and throw proper exception
Issue: SPR-7966
2013-12-02 12:39:37 +01:00
Phillip Webb 043a41e382 Consistent whitespace after imports
Update code to have a consistent number of new-line characters after
import statements.
2013-11-26 15:14:43 -08:00
Phillip Webb 15698860e1 General polish of new 4.0 classes
Apply consistent styling to new classes introduced in Spring 4.0.

- Javadoc line wrapping, whitespace and formatting
- General code whitespace
- Consistent Assert.notNull messages
2013-11-26 15:11:18 -08:00
Phillip Webb a31ac882c5 Fix various javadoc warnings 2013-11-26 13:25:37 -08:00
Eric Dahl e9f78f6043 Fix various typos
Fix a variety of typos throughout the project, primarily in
comments (javadoc or otherwise) but also in a handful of log messages
and a couple exception messages.

ISSUE: SPR-11123
2013-11-25 15:58:27 -08:00
Phillip Webb 59002f2456 Fix remaining compiler warnings
Fix remaining Java compiler warnings, mainly around missing
generics or deprecated code.

Also add the `-Werror` compiler option to ensure that any future
warnings will fail the build.

Issue: SPR-11064
2013-11-25 12:52:42 -08:00
Sam Brannen e910326bf7 Polish Javadoc for ListableBeanFactory 2013-11-17 14:59:47 +00:00
Juergen Hoeller 54571bf038 Introduced getBeanNamesForAnnotation method on ListableBeanFactory
Issue: SPR-11069
2013-11-15 16:04:11 +01:00
Juergen Hoeller b093b84954 Use non-lenient constructor resolution mode for @Bean methods
Since @Bean methods are never used with externally specified constructor argument values but rather just with autowiring, the non-lenient constructor resolution mode is appropriate in case of an overloaded @Bean method, not performing any type difference weight checks. This change includes a refinement of Spring's existing non-lenient constructor resolution (which needs to be explicitly turned on and is therefore not well tested), narrowing the conditions for the ambiguity check (only in case of the same number of arguments and not for overridden methods).

Issue: SPR-10988
2013-11-04 00:19:55 +01:00
Juergen Hoeller 44dee37130 Added further author tags
Issue: SPR-1528
2013-11-01 22:43:02 +01:00
Juergen Hoeller 6e418fe43d QualifierAnnotationAutowireCandidateResolver matches regular bean name for FactoryBean dependency type as well 2013-10-31 15:26:10 +01:00
Juergen Hoeller 3402628a74 Polishing 2013-10-30 22:06:51 +01:00
Juergen Hoeller 148f8f011d AutowireCandidateResolver receives original bean name (including FactoryBean prefix if applicable) for correct generic type check in case of a FactoryBean definition
Issue: SPR-11045
2013-10-30 22:05:33 +01:00
Juergen Hoeller f9584184ef Allow for specific instance-based match to override factory method signature match
Issue: SPR-11046
2013-10-30 22:02:04 +01:00
Juergen Hoeller 8c1767e223 Defensive handling of exceptions during factory method type checking
Also using ClassUtils.forName in AutowireUtils now in order to accept all common class name formats.

Issue: SPR-11034
2013-10-28 13:25:45 +01:00
Juergen Hoeller 56dfcd153e Aligned with refinements in 3.2.x branch
Issue: SPR-11034
2013-10-27 23:17:47 +01:00
Juergen Hoeller 2c2ed7edd3 Polishing 2013-10-27 21:26:16 +01:00
Juergen Hoeller 960ba379ca Fixed resolveReturnTypeForFactoryMethod to unwrap TypedStringValue
XML-defined arguments values are initially turned into TypedStringValue wrappers. If we encounter an unresolved argument, we need to unwrap such a TypedStringValue and then try to treat its content as a class name.

Issue: SPR-11034
2013-10-27 21:26:04 +01:00
Juergen Hoeller 671fad3cb5 Added further tests for raw matching of generic types
Issue: SPR-11034
Issue: SPR-11004
2013-10-27 11:02:16 +01:00
Juergen Hoeller 4cb453bbdc Polishing 2013-10-27 01:21:55 +02:00
Juergen Hoeller a6b0261000 Proper matching of raw generic types and generically typed factory methods
Also optimized getTypeForFactoryMethod's implementation for non-generic factory methods, and reduced calls to getResolvedFactoryMethod in order to avoid repeated synchronization.

Issue: SPR-11034
2013-10-27 00:35:36 +02:00
Juergen Hoeller 2d91309fdf Fixed detection of setter in case of getter with covariant return type narrowing
Issue: SPR-10995
(cherry picked from commit 045f78e)
2013-10-26 17:36:50 +02:00
Juergen Hoeller b32451ac9f Polishing 2013-10-26 15:18:34 +02:00
Juergen Hoeller 614387fe0e Sneaked in test for covariant return type narrowing in a getter method
Issue: SPR-10995
2013-10-26 15:14:31 +02:00
Juergen Hoeller 109faaced8 Factory method type resolution works with indexed and named arguments as well
Issue: SPR-11019
2013-10-26 14:05:37 +02:00
Juergen Hoeller 4675bc4e0c Cache InjectionMetadata per bean name instead of per Class, if possible
Issue: SPR-11027
2013-10-26 14:03:11 +02:00
Juergen Hoeller 393cfcff40 Cache InjectionMetadata per bean name instead of per Class
Issue: SPR-11027
2013-10-26 02:21:38 +02:00
Juergen Hoeller 0851766738 Accept non-generic type match as a fallback
DefaultListableBeanFactory performs a fallback check for autowire candidates now, which GenericTypeAwareAutowireCandidateResolver implements to accept raw type matches if the target class has unresolvable type variables. Full generic matches are still preferred; the BeanFactory will only start looking for fallback matches if the first pass led to an empty result.

Issue: SPR-10993
Issue: SPR-11004
2013-10-25 17:52:38 +02:00
Phillip Webb c9aace4da2 Skip convert to Object from TypeConverterDelegate
Update TypeConverterDelegate to bypass conversion when the target type
is Object.class. Prior to this commit converting a single element array
to an Object would result in the element being returned, rather than
the array itself.

Issue: SPR-10996
2013-10-18 17:19:41 -07:00
Juergen Hoeller 8d6406bbae Groovy-based bean definitions
Formerly known as the Grails BeanBuilder, now in Spring proper. Based on https://github.com/spring-projects/spring-framework/pull/355 but heavily refactored and restructured.

Issue: SPR-7123
2013-10-17 19:24:08 +02:00
Juergen Hoeller bb8cf277fb Polishing 2013-10-17 19:23:51 +02:00
Sam Brannen 8fdc7d4e8f Polish type prediction for generic factory methods
- Now avoiding NullPointerExceptions in GenericTypeResolver's
   resolveReturnTypeForGenericMethod() in case the supplied ClassLoader
   is null.
 - AutowireUtils.resolveReturnTypeForFactoryMethod() now properly
   asserts that the supplied ClassLoader is not null.
 - Fixed copy-n-paste errors in Javadoc for
   AutowireUtils.resolveReturnTypeForFactoryMethod().

Issue: SPR-10411
2013-10-15 15:21:47 +02:00