Go to file
Chris Beams 7b999c676f Introduce ReflectionUtils#getUniqueDeclaredMethods
This change is in support of certain polymorphism cases in
@Configuration class inheritance hierarchies.  Consider the following
scenario:

@Configuration
public abstract class AbstractConfig {
    public abstract Object bean();
}

@Configuration
public class ConcreteConfig {
    @Override
    @Bean
    public BeanPostProcessor bean() { ... }
}

ConcreteConfig overrides AbstractConfig's #bean() method with a
covariant return type, in this case returning an object of type
BeanPostProcessor.  It is critically important that the container
is able to detect the return type of ConcreteConfig#bean() in order
to instantiate the BPP at the right point in the lifecycle.

Prior to this change, the container could not do this.
AbstractAutowireCapableBeanFactory#getTypeForFactoryMethod called
ReflectionUtils#getAllDeclaredMethods, which returned Method objects
for both the Object and BeanPostProcessor signatures of the #bean()
method.  This confused the implementation sufficiently as not to
choose a type for the factory method at all.  This means that the
BPP never gets detected as a BPP.

The new method being introduced here, #getUniqueDeclaredMethods, takes
covariant return types into account, and filters out duplicates,
favoring the most specific / narrow return type.

Additionally, it filters out any CGLIB 'rewritten' methods, which
is important in the case of @Configuration classes, which are
enhanced by CGLIB.  See the implementation for further details.
2011-05-06 19:07:25 +00:00
build-spring-framework Remove "Feature" support introduced in 3.1 M1 2011-05-06 19:03:52 +00:00
org.springframework.aop Introduce ReflectionUtils#getUniqueDeclaredMethods 2011-05-06 19:07:25 +00:00
org.springframework.asm Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
org.springframework.aspects + revert back deleted resource 2011-03-06 18:19:19 +00:00
org.springframework.beans Introduce ReflectionUtils#getUniqueDeclaredMethods 2011-05-06 19:07:25 +00:00
org.springframework.context Introduce ReflectionUtils#getUniqueDeclaredMethods 2011-05-06 19:07:25 +00:00
org.springframework.context.support moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00
org.springframework.core Introduce ReflectionUtils#getUniqueDeclaredMethods 2011-05-06 19:07:25 +00:00
org.springframework.expression Update MockEnvironment / MockPropertySource types 2011-05-06 18:57:41 +00:00
org.springframework.instrument Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.instrument.tomcat Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.integration-tests Remove "Feature" support introduced in 3.1 M1 2011-05-06 19:03:52 +00:00
org.springframework.jdbc SPR-6922 deprecated SimpleJdbcTemplate/SimpleJdbcOperations/SimpleJdbcDaoSupport in favor of JdbcTemplate/NamedParameterJdbcTemplate and related interfaces support classes 2011-04-14 18:44:40 +00:00
org.springframework.jms Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.orm Fix generics and serialization warnings 2011-05-06 19:00:14 +00:00
org.springframework.oxm SPR-7805 - Add support for package binding in the JibxMashaller 2011-04-04 08:50:15 +00:00
org.springframework.spring-library Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
org.springframework.spring-parent Updating JUnit and TestNG versions for IDEs and Maven. 2011-03-28 19:59:09 +00:00
org.springframework.test Update MockEnvironment / MockPropertySource types 2011-05-06 18:57:41 +00:00
org.springframework.transaction Consolidate annotation processing constants 2011-05-06 19:06:37 +00:00
org.springframework.web SPR-6909 Include URI template vars in data binding 2011-04-26 11:54:54 +00:00
org.springframework.web.portlet Include license.txt and notice.txt in module JARs 2011-02-09 06:56:40 +00:00
org.springframework.web.servlet Remove "Feature" support introduced in 3.1 M1 2011-05-06 19:03:52 +00:00
org.springframework.web.struts [SPR-7850][SPR-7851] Upgraded to JUnit 4.8.1 and TestNG 5.12.1; added changelog entries for 3.1.0.M1. 2010-12-30 08:00:58 +00:00
spring-framework-reference Fix typo in aop reference documentation 2011-04-26 07:44:40 +00:00
src/test/java/org/springframework/core/env Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
.gitignore M1 cut of environment, profiles and property work (SPR-7508) 2011-01-03 09:04:34 +00:00
build.properties Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
build.versions [SPR-7850][SPR-7851] Upgraded to JUnit 4.8.1 and TestNG 5.12.1; added changelog entries for 3.1.0.M1. 2010-12-30 08:00:58 +00:00
ci-build.properties adding properties file to simplify ant use in Bamboo CI build 2008-12-17 15:47:14 +00:00
eclipse-code-formatter.xml h2 embedded db support; updated formatting conventions not to auto-format javadoc; added hsqldb and h2 to jdbc maven pom as optional deps 2009-05-09 22:27:05 +00:00
spring-framework.ipr Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
spring-framework.psf Renamed org.springframework.instrument.classloading module to org.springframework.instrument.tomcat 2009-09-25 12:51:58 +00:00