collect exceptions across all constructors that have been tried (SPR-6720)
git-svn-id: https://src.springframework.org/svn/spring-framework/trunk@2839 50f2f4bb-b051-0410-bef5-90022cba6387
This commit is contained in:
parent
74217ea0b9
commit
4aa17d8f22
|
|
@ -1,5 +1,5 @@
|
||||||
/*
|
/*
|
||||||
* Copyright 2002-2009 the original author or authors.
|
* Copyright 2002-2010 the original author or authors.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
|
@ -157,6 +157,7 @@ class ConstructorResolver {
|
||||||
AutowireUtils.sortConstructors(candidates);
|
AutowireUtils.sortConstructors(candidates);
|
||||||
int minTypeDiffWeight = Integer.MAX_VALUE;
|
int minTypeDiffWeight = Integer.MAX_VALUE;
|
||||||
Set<Constructor> ambiguousConstructors = null;
|
Set<Constructor> ambiguousConstructors = null;
|
||||||
|
List<Exception> causes = null;
|
||||||
|
|
||||||
for (int i = 0; i < candidates.length; i++) {
|
for (int i = 0; i < candidates.length; i++) {
|
||||||
Constructor<?> candidate = candidates[i];
|
Constructor<?> candidate = candidates[i];
|
||||||
|
|
@ -175,8 +176,6 @@ class ConstructorResolver {
|
||||||
}
|
}
|
||||||
|
|
||||||
ArgumentsHolder args;
|
ArgumentsHolder args;
|
||||||
List<Exception> causes = null;
|
|
||||||
|
|
||||||
if (resolvedValues != null) {
|
if (resolvedValues != null) {
|
||||||
try {
|
try {
|
||||||
String[] paramNames = null;
|
String[] paramNames = null;
|
||||||
|
|
@ -215,7 +214,6 @@ class ConstructorResolver {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
else {
|
else {
|
||||||
// Explicit arguments given -> arguments length must match exactly.
|
// Explicit arguments given -> arguments length must match exactly.
|
||||||
if (paramTypes.length != explicitArgs.length) {
|
if (paramTypes.length != explicitArgs.length) {
|
||||||
|
|
@ -383,7 +381,7 @@ class ConstructorResolver {
|
||||||
// Need to determine the factory method...
|
// Need to determine the factory method...
|
||||||
// Try all methods with this name to see if they match the given arguments.
|
// Try all methods with this name to see if they match the given arguments.
|
||||||
factoryClass = ClassUtils.getUserClass(factoryClass);
|
factoryClass = ClassUtils.getUserClass(factoryClass);
|
||||||
Method[] rawCandidates = null;
|
Method[] rawCandidates;
|
||||||
|
|
||||||
final Class factoryClazz = factoryClass;
|
final Class factoryClazz = factoryClass;
|
||||||
if (System.getSecurityManager() != null) {
|
if (System.getSecurityManager() != null) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue