optimized @Bean error messages (SPR-7628, SPR-7629)

This commit is contained in:
Juergen Hoeller
2010-10-10 18:31:03 +00:00
parent 4e43ba544b
commit 061063257a
3 changed files with 39 additions and 18 deletions

View File

@@ -466,7 +466,7 @@ class ConstructorResolver {
this.beanFactory.logger.trace("Ignoring factory method [" + candidate +
"] of bean '" + beanName + "': " + ex);
}
if (i == candidates.length - 1 && factoryMethodToUse == null) {
if (i == candidates.length - 1 && argsHolderToUse == null) {
if (causes != null) {
for (Exception cause : causes) {
this.beanFactory.onSuppressedException(cause);
@@ -547,7 +547,7 @@ class ConstructorResolver {
ambiguousFactoryMethods);
}
if (explicitArgs == null) {
if (explicitArgs == null && argsHolderToUse != null) {
argsHolderToUse.storeCache(mbd, factoryMethodToUse);
}
}