spring-framework/org.springframework.context
Chris Beams 0113ea91a3 Support by-type lookup/injection of primitive types
Allowing beans of primitive type to be looked up via getBean(Class), or
to be injected using @Autowired or @Injected or @Resource. Prior to
these changes, an attempt to lookup or inject a bean of, for example,
type boolean would fail because all spring beans are Objects, regardless
of initial type due to the way that ObjectFactory works.

Now these attempts to lookup or inject primitive types work, thanks to
simple changes in AbstractBeanFactory using ClassUtils#isAssignable
methods instead of the built-in Class#isAssignableFrom. The former takes
into account primitives and their object wrapper types, whereas the
latter does not.

The need to declare, look up or inject primitive-typed beans is probably
low -- how often does one need a bean of type boolean or int after all?.
Prior to the introduction of @Bean methods in Spring 3.0, it was not
possible in practice to register primitive beans, so this issue never
came up. Now that one can declare primitive-typed beans, it does make
sense that we properly support by-type lookup and injection without
forcing the user to work with object wrappers.

Issue: SPR-8874
2011-11-24 21:39:58 +00:00
..
.settings Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
src Support by-type lookup/injection of primitive types 2011-11-24 21:39:58 +00:00
.classpath [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
.project revised cache abstraction 2011-05-18 17:43:13 +00:00
.springBeans Remove "Feature" support introduced in 3.1 M1 2011-05-06 19:03:52 +00:00
build.xml + upgrade to AspectJ 1.6.8 2010-02-04 11:46:21 +00:00
context.iml introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6) 2011-08-15 16:41:55 +00:00
ivy.xml introduced ForkJoinPoolFactoryBean for Java 7 (alternative: add new jsr166.jar to Java 6) 2011-08-15 16:41:55 +00:00
pom.xml Update ejb, inject-tck, jsr166 deps in context pom 2011-08-20 03:01:49 +00:00
template.mf cleanup of conversation dependencies 2011-10-20 09:56:07 +00:00