Closed
Description
Kenny MacLeod opened SPR-6660 and commented
Having recently encountered an obscure bug where a bean definition had both scope="prototype" and destroy-method specified, I'd like to suggest that when the bean scope is "prototype", the bean definition is not allowed to also specify destroy-method, since it will never be invoked.
Ideally, this would also apply to @PreDestroy-annotated
bean classes, throwing an exception when the bean definition is parsed, but that might be a step too far.
Affects: 3.0 GA
Issue Links:
- Support DisposableBean on prototype and @Configurable beans using weak references [SPR-9391] #14027 Support DisposableBean on prototype and
@Configurable
beans using weak references
1 votes, 2 watchers