spring-framework/org.springframework.context
Chris Beams d471266d44 @Feature methods accept @Value-annotated params
Previously errors were being raised when trying to inject @Value
annotated paramaters such as:

@Feature
public FeatureSpec feature(@Value("#{environment['foo']}") String foo) {
    return new FeatureSpec(foo);
}

This is not so much because dependency resolution of @Value-annotated
types was failing, but rather because the 'early bean reference'
proxying mechanism was throwing an exception if any final type was
detected as a parameter. This is of course because final types are
non-subclassable by CGLIB.  On review, however, it's obvious that
certain final types must be allowed for injection.  @Value injection
is an obvious one, but the rarer case of a Spring bean of type String
or int is another.

The explicit guard against final types as parameters to @Feature methods
has been removed. Final types are still checked for, however, and if
found, no proxing is attempted.  The dependency is immediately resolved
against the current BeanFactory and injected into the @Feature method.

This means that @Value injection, @Qualifier injection, etc all work
as expected, but does mean that premature bean instantiation may occur
if a user unwittingly injects non-String, non-primitive final bean types
as @Feature method parameters.

Issue: SPR-7974
2011-03-15 07:09:49 +00:00
..
.settings Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
src @Feature methods accept @Value-annotated params 2011-03-15 07:09:49 +00:00
.classpath moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00
.project
.springBeans Introduce FeatureSpecification support 2011-02-08 14:42:33 +00:00
build.xml
context.iml moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00
ivy.xml moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00
pom.xml Sync pom.xml deps with ivy.xml changes since 3.0.5 2011-02-09 06:56:53 +00:00
template.mf moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00