Go to file
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
build-spring-framework Document MVC Java config side-by-side with the MVC namespace. 2011-11-22 23:25:12 +00:00
org.springframework.aop Introduce @EnableAspectJAutoProxy 2011-10-11 18:51:41 +00:00
org.springframework.asm Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
org.springframework.aspects Introduce @EnableCaching 2011-11-16 04:21:21 +00:00
org.springframework.beans Support by-type lookup/injection of primitive types 2011-11-24 21:39:58 +00:00
org.springframework.context Support by-type lookup/injection of primitive types 2011-11-24 21:39:58 +00:00
org.springframework.context.support Remove stale duplicate copy of spring-cache XSD 2011-11-16 04:20:43 +00:00
org.springframework.core SPR-8858 Fix in AntPathMatcher.combine(..) 2011-11-23 17:53:18 +00:00
org.springframework.expression Add Apache license header where missing in src/main 2011-11-16 18:23:56 +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 Introduce @EnableCaching 2011-11-16 04:21:21 +00:00
org.springframework.jdbc Add Apache license header where missing in src/main 2011-11-16 18:23:56 +00:00
org.springframework.jms Corrected Javadoc: handleListenerException() and invokeErrorHandler() log at WARN level, not at ERROR level. 2011-10-10 22:13:45 +00:00
org.springframework.orm SPR-8750 Refine 'Content-Type' update in MockHttpServletRequest/Response. 2011-11-17 15:07:15 +00:00
org.springframework.oxm [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +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 Fix JUnit version in spring-parent pom 2011-11-16 18:23:58 +00:00
org.springframework.test SPR-8750 Refine 'Content-Type' update in MockHttpServletRequest/Response. 2011-11-17 15:07:15 +00:00
org.springframework.transaction Fix typo in ResourceHolder#isVoid Javadoc 2011-11-16 23:32:42 +00:00
org.springframework.web SPR-8851 Switch to logging debug messages in AbstractWebArgumentResolverAdapter 2011-11-18 16:18:55 +00:00
org.springframework.web.portlet fixed StandardServlet/PortletEnvironment to check for JNDI (for Google App Engine compatibility) 2011-10-20 10:46:16 +00:00
org.springframework.web.servlet Add detectHandlerMethodsInAncestorContexts property to AbstractHandlerMethodMapping. 2011-11-23 18:59:08 +00:00
org.springframework.web.struts [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +00:00
spring-framework-reference Document MVC Java config side-by-side with the MVC namespace. 2011-11-22 23:25:12 +00:00
.gitignore Add ignorable log file to .gitignore 2011-06-05 21:01:37 +00:00
build.properties Reorganize and add comments to build.properties 2011-08-20 03:02:05 +00:00
build.versions [SPR-8222] Upgraded to JUnit 4.9. 2011-08-30 13:16:12 +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 consistently use Unix line separator 2011-10-11 01:14: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