Commit Graph

193 Commits

Author SHA1 Message Date
Juergen Hoeller
83a7deb594 ConstructorResolver's exception message on null factory-bean hints at potential BeanPostProcessor involvement
Issue: SPR-11951
(cherry picked from commit 6c41cc3)
2014-07-04 22:35:12 +02:00
Juergen Hoeller
010d8b8c89 Defensively check for pre-resolved FactoryBean.getObject() results in circular reference scenarios
Issue: SPR-11937
(cherry picked from commit 07edf11)
2014-07-02 00:32:01 +02:00
Juergen Hoeller
8307447235 CachedIntrospectionResults uses SoftReference instead of WeakReference for non-cache-safe entries
Issue: SPR-11867
(cherry picked from commit f27b949)
2014-07-02 00:31:06 +02:00
Juergen Hoeller
67ebef6b32 BeanFactoryAnnotationUtils consistently applies bean name fallback when no BeanDefinition present
Issue: SPR-11915
(cherry picked from commit b9935e9)
2014-07-01 18:26:26 +02:00
Juergen Hoeller
c033f889bf Polishing (backported from master)
(cherry picked from commit 48f753f)
2014-07-01 14:28:05 +02:00
Juergen Hoeller
f4062bc758 AbstractAutowireCapableBeanFactory's createBean/autowireBean/configureBean use CacheUtils.isCacheSafe to re-enable PropertyDescriptor caching
Issue: SPR-11875
(cherry picked from commit c32d559)
2014-07-01 14:22:03 +02:00
Juergen Hoeller
a139670286 Fixed invalid code tag in javadoc 2014-05-01 00:49:22 +02:00
Juergen Hoeller
a5606a6c46 Polishing 2014-04-29 23:39:17 +02:00
Juergen Hoeller
b13c5b2378 GenericBeanDefinition's toString() takes parent definition into account
Issue: SPR-9671
(cherry picked from commit 0ef29b2)
2014-04-29 21:42:19 +02:00
Juergen Hoeller
9e2060707a General defensiveness about the bootstrap ClassLoader (i.e. null ClassLoader)
Issue: SPR-11721
2014-04-27 22:29:08 +02:00
Juergen Hoeller
5aa93674a3 Consistent documentation for both 'close' and 'shutdown' as inferred destroy methods
Issue: SPR-11680
(cherry picked from commit 14f9dbf)
2014-04-18 12:09:27 +02:00
Juergen Hoeller
5c3f6a1571 Revised naming for prototype inner beans to avoid excessive unique name calculation
Restored original singleton-only adaptInnerBeanName behavior, avoiding endless unique name calculation for every single prototype instance. Non-named inner BeanDefinition objects now suffixed with an identity hex code analogous to non-named XML bean definitions, largely avoiding naming collisions to begin with. After SPR-11246, post-processors can deal with unstable classes per bean name, so occasional collisions aren't a hard problem anymore.

Issue: SPR-11545
(cherry picked from commit 5308b3e)
2014-03-25 00:34:41 +01:00
Juergen Hoeller
f1ba789494 DefaultListableBeanFactory only puts 'cache-safe' Class keys into its by-type cache
Issue: SPR-11520
(cherry picked from commit 93c8b7a)
2014-03-07 14:58:51 +01:00
Juergen Hoeller
d642cd21bb SpringBeanELResolver's setValue should not throw PropertyNotWritableException if provided value is identical to current bean instance
Issue: SPR-11502
(cherry picked from commit 7972b31)
2014-03-07 14:58:16 +01:00
Juergen Hoeller
7e2a214f32 instantiateUsingFactoryMethod avoids NPE and reports argument types in case of explicitArgs and resolved generic arguments as well
Issue: SPR-11517
(cherry picked from commit ad31777)
2014-03-07 14:56:45 +01:00
Juergen Hoeller
b40403cdc9 Polishing
Issue: SPR-11422
(cherry picked from commit 520ef9e)
2014-02-13 00:42:22 +01:00
Juergen Hoeller
0972582880 resolveFactoryMethodIfPossible considers nonPublicAccessAllowed and SecurityManager
Issue: SPR-11422
(cherry picked from commit 603cdea)
2014-02-13 00:42:16 +01:00
Sam Brannen
9f77ef4102 Exclude overloaded from equals & hashCode in MethodOverride
Prior to this commit, the inclusion of the 'overloaded' flag in the
implementations of equals() and hashCode() in MethodOverride could lead
to adverse effects in the outcome of equals() in AbstractBeanDefinition.

For example, given two bean definitions A and B that represent the
exact same bean definition metadata for a bean that relies on method
injection, if A has been validated and B has not, then A.equals(B) will
potentially return false, which is not acceptable behavior.

This commit addresses this issue by removing the 'overloaded' flag from
the implementations of equals() and hashCode() for MethodOverride.

Issue: SPR-11420
(cherry picked from commit 9534245)
2014-02-12 17:20:43 +01:00
Juergen Hoeller
f558396e91 Introduced SpringNamingPolicy for CGLIB
Issue: SPR-11398
(cherry picked from commit 8c4e372)
2014-02-06 23:25:52 +01:00
Juergen Hoeller
60b24cffdb Related polishing
Issue: SPR-11386
(cherry picked from commit 6634c19)
2014-02-04 16:53:50 +01:00
Juergen Hoeller
35753eb54d Backported test for fallback for non-resolvable property type
(cherry picked from commit 8570f60)
2014-01-28 17:25:12 +01:00
Juergen Hoeller
d26a570192 Polishing 2014-01-28 01:46:19 +01:00
Juergen Hoeller
ac3c670f70 Fixed type resolution in case of inconsistencies between read and write method
Issue: SPR-11361
2014-01-28 01:20:27 +01:00
Juergen Hoeller
e07ad5a19b Polishing 2014-01-25 00:15:00 +01:00
Juergen Hoeller
87179b075b Optimized Introspector.flushFromCaches calls to skip Object.class
Issue: SPR-11356
2014-01-24 19:18:39 +01:00
Juergen Hoeller
866c7847e3 Introduced SpringProperties class and optional "spring.properties" file
This in particular allows for specifying "spring.getenv.ignore" and "spring.beaninfo.ignore" in a local way within the application, in case that JVM-level system properties are locked.

Issue: SPR-9014
Issue: SPR-11297
(cherry picked from commit 8543b91)
2014-01-24 16:58:16 +01:00
Juergen Hoeller
fdd31c0e66 Preserve visitBeanDefinition stacktrace in BeanDefinitionStoreException
Issue: SPR-11346
2014-01-22 22:40:10 +01:00
Juergen Hoeller
d9ab6aaf6c Revised RootBeanDefinition's externallyManaged* Sets to rely on postProcessingLock
This allows us to avoid early initialization of footprint-heavy ConcurrentHashMaps, and reuses the existing postProcessingLock which will typically be active already when registerExternallyManaged* calls come in from the bean factory's post-processing phase.

Issue: SPR-11343
(cherry picked from commit a599b57)
2014-01-22 14:48:26 +01:00
Juergen Hoeller
52c11eab41 Polishing
(cherry picked from commit e670f4e)
2014-01-15 17:54:37 +01:00
Juergen Hoeller
b6362c5016 Introduced "spring.getenv.ignore" system property for preventing System.getenv calls
Issue: SPR-11297
(cherry picked from commit 961f42b)
2014-01-15 17:52:36 +01:00
Juergen Hoeller
f88cbda6ef Introduced "spring.beaninfo.ignore" system property for optimized Introspector usage
Issue: SPR-9014
2014-01-03 14:14:10 +01:00
Juergen Hoeller
08aa22ff1f InjectionMetadata caching per bean name needs to refresh when bean class changes
Issue: SPR-11246
2013-12-20 00:15:09 +01:00
Juergen Hoeller
a115a7dad5 Revised BeanInfoFactory javadoc
Issue: SPR-9014
2013-12-20 00:09:49 +01:00
Juergen Hoeller
0a4d28d5d5 Fixed primitive type assignability in BeanUtils.copyProperties
Issue: SPR-11231
(cherry picked from commit 8a3b4c6)
2013-12-16 22:57:50 +01:00
Juergen Hoeller
bf31f7178d Polishing
(cherry picked from commit a3a4344)
2013-12-11 23:58:16 +01:00
Juergen Hoeller
bfcfbe41a1 Made BeanUtils.copyProperties defensive about property type mismatches
Issue: SPR-11209
(cherry picked from commit bc5affa)
2013-12-11 23:12:33 +01:00
Juergen Hoeller
779d5716e5 Moved RequiredAnnotationBeanPostProcessorTests to correct package beans.factory.annotation 2013-12-11 18:45:23 +01:00
Juergen Hoeller
7f895222e1 Revised exclusion of java.lang.Class properties
Issue: SPR-11098
(cherry picked from commit 62ea627)
2013-12-11 17:44:16 +01:00
Juergen Hoeller
6e275b7663 Polishing 2013-12-10 22:48:42 +01:00
Juergen Hoeller
882726377f 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
(cherry picked from commit cb624e2)
2013-12-10 22:48:35 +01:00
Juergen Hoeller
d0fc38ec76 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
(cherry picked from commit 242ecdc)
2013-12-10 13:12:41 +01:00
Juergen Hoeller
8e52e650f4 Fixed type resolution for uninitialized factory-method declaration
Issue: SPR-11112
(cherry picked from commit 5dcd287)
2013-12-10 13:12:32 +01:00
Juergen Hoeller
71650c0a44 Fixed evaluation of "!" operator in case of multiple profile expressions
Issue: SPR-11093
(cherry picked from commit 6078c27)
2013-12-10 12:16:22 +01:00
Juergen Hoeller
6bed18004e Fixed detection of qualifier annotations on scoped-proxy factory methods
Issue: SPR-11116
2013-12-09 00:11:41 +01:00
Juergen Hoeller
b00c31a620 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
(cherry picked from commit b093b84)
2013-11-04 16:11:04 +01:00
Juergen Hoeller
1ac8e48ebf Polishing (backported from several master changes) 2013-10-30 22:47:16 +01:00
Phillip Webb
bcf7aecf0f 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
(cherry picked from commit c9aace4d)
2013-10-30 13:02:07 -07:00
Juergen Hoeller
c8e8d6cd49 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
(cherry picked from commit 8c1767e)
2013-10-28 13:47:11 +01:00
Juergen Hoeller
094ff8883d Polishing 2013-10-27 22:52:36 +01:00
Juergen Hoeller
44f79f95a7 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 22:48:57 +01:00