BATCH-1605: fix loop that looks for matching argumemts

This commit is contained in:
dsyer
2010-08-13 10:47:24 +00:00
parent 2922b2d3d1
commit b37dbd2c06
2 changed files with 19 additions and 6 deletions

View File

@@ -54,11 +54,11 @@ public class HippyMethodInvoker extends MethodInvoker {
for (int j = 0; j < arguments.length; j++) {
for (int k = 0; k < paramTypes.length; k++) {
// Pick the first assignable of the right type that
// matches this slot...
if (ClassUtils.isAssignableValue(paramTypes[k], arguments[j])
&& candidateArguments[k] == null) {
// matches this slot and hasn't already been filled...
if (ClassUtils.isAssignableValue(paramTypes[k], arguments[j]) && candidateArguments[k] == null) {
candidateArguments[k] = arguments[j];
assignedParameterCount++;
break;
}
}
}
@@ -73,9 +73,9 @@ public class HippyMethodInvoker extends MethodInvoker {
}
}
}
if (transformedArguments==null) {
throw new IllegalArgumentException("No matching arguments found for method: "+targetMethod);
if (transformedArguments == null) {
throw new IllegalArgumentException("No matching arguments found for method: " + targetMethod);
}
if (transformedArgumentCount < transformedArguments.length) {