spring-framework/org.springframework.context
Chris Beams 2afeb08e3c Fix @Autowired+@PostConstruct+@Configuration issue
A subtle issue existed with the way we relied on isCurrentlyInCreation
to determine whether a @Bean method is being called by the container
or by user code.  This worked in most cases, but in the particular
scenario laid out by SPR-8080, this approach was no longer sufficient.

This change introduces a ThreadLocal that contains the factory method
currently being invoked by the container, such that enhanced @Bean
methods can check against it to see if they are being called by the
container or not.  If so, that is the cue that the user-defined @Bean
method implementation should be invoked in order to actually create
the bean for the first time.  If not, then the cached instance of
the already-created bean should be looked up and returned.

See ConfigurationClassPostConstructAndAutowiringTests for
reproduction cases and more detail.

Issue: SPR-8080
2011-05-12 12:28:13 +00:00
..
.settings Merge 3.1.0 development branch into trunk 2010-10-25 19:48:20 +00:00
src Fix @Autowired+@PostConstruct+@Configuration issue 2011-05-12 12:28:13 +00:00
.classpath moved cache abstraction from context.support to context 2011-02-07 17:41:25 +00:00
.project SPR-6158: Initial implementation and tests for @ImportXml 2009-11-07 00:32:40 +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 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 SPR-6416, initial commit for the conversation management 2011-04-12 13:21:18 +00:00