if (matchInfo.isExactMatch()) { return new ReflectiveMethodExecutor(method); else if (matchInfo.isCloseMatch()) { if (this.useDistance) { int matchDistance = ReflectionHelper.getTypeDifferenceWeight(paramDescriptors, argumentTypes); else if (matchInfo.isMatchRequiringConversion()) { if (matchRequiringConversion != null) { multipleOptions = true;
return (match != null ? new ArgumentsMatchInfo(match) : null);
if (matchInfo.isExactMatch()) { return new ReflectiveMethodExecutor(method); else if (matchInfo.isCloseMatch()) { if (this.useDistance) { int matchDistance = ReflectionHelper.getTypeDifferenceWeight(paramDescriptors, argumentTypes); else if (matchInfo.isMatchRequiringConversion()) { if (matchRequiringConversion != null) { multipleOptions = true;
return (match != null ? new ArgumentsMatchInfo(match) : null);
if (matchInfo.isExactMatch()) { return new ReflectiveConstructorExecutor(ctor); else if (matchInfo.isCloseMatch()) { closeMatch = ctor; else if (matchInfo.isMatchRequiringConversion()) { matchRequiringConversion = ctor;
return (match != null ? new ArgumentsMatchInfo(match) : null);
if (matchInfo.isExactMatch()) { return new ReflectiveConstructorExecutor(ctor); else if (matchInfo.isCloseMatch()) { closeMatch = ctor; else if (matchInfo.isMatchRequiringConversion()) { matchRequiringConversion = ctor;
return (match != null ? new ArgumentsMatchInfo(match) : null);
if (matchInfo.isExactMatch()) { return new ReflectiveMethodExecutor(method); else if (matchInfo.isCloseMatch()) { if (this.useDistance) { int matchDistance = ReflectionHelper.getTypeDifferenceWeight(paramDescriptors, argumentTypes); else if (matchInfo.isMatchRequiringConversion()) { if (matchRequiringConversion != null) { multipleOptions = true;
return (match != null ? new ArgumentsMatchInfo(match) : null);
if (matchInfo.isExactMatch()) { return new ReflectiveConstructorExecutor(ctor); else if (matchInfo.isCloseMatch()) { closeMatch = ctor; else if (matchInfo.isMatchRequiringConversion()) { matchRequiringConversion = ctor;
return (match != null ? new ArgumentsMatchInfo(match) : null);
/** * Used to validate the match returned from a compareArguments call. */ private void checkMatch2(Class<?>[] inputTypes, Class<?>[] expectedTypes, StandardTypeConverter typeConverter, ArgumentsMatchKind expectedMatchKind) { ReflectionHelper.ArgumentsMatchInfo matchInfo = ReflectionHelper.compareArgumentsVarargs(getTypeDescriptors(expectedTypes), getTypeDescriptors(inputTypes), typeConverter); if (expectedMatchKind == null) { assertNull("Did not expect them to match in any way: " + matchInfo, matchInfo); } else { assertNotNull("Should not be a null match", matchInfo); } if (expectedMatchKind == ArgumentsMatchKind.EXACT) { assertTrue(matchInfo.isExactMatch()); } else if (expectedMatchKind == ArgumentsMatchKind.CLOSE) { assertTrue(matchInfo.isCloseMatch()); } else if (expectedMatchKind == ArgumentsMatchKind.REQUIRES_CONVERSION) { assertTrue("expected to be a match requiring conversion, but was " + matchInfo, matchInfo.isMatchRequiringConversion()); } }
/** * Used to validate the match returned from a compareArguments call. */ private void checkMatch(Class<?>[] inputTypes, Class<?>[] expectedTypes, StandardTypeConverter typeConverter, ArgumentsMatchKind expectedMatchKind) { ReflectionHelper.ArgumentsMatchInfo matchInfo = ReflectionHelper.compareArguments(getTypeDescriptors(expectedTypes), getTypeDescriptors(inputTypes), typeConverter); if (expectedMatchKind == null) { assertNull("Did not expect them to match in any way", matchInfo); } else { assertNotNull("Should not be a null match", matchInfo); } if (expectedMatchKind == ArgumentsMatchKind.EXACT) { assertTrue(matchInfo.isExactMatch()); } else if (expectedMatchKind == ArgumentsMatchKind.CLOSE) { assertTrue(matchInfo.isCloseMatch()); } else if (expectedMatchKind == ArgumentsMatchKind.REQUIRES_CONVERSION) { assertTrue("expected to be a match requiring conversion, but was " + matchInfo, matchInfo.isMatchRequiringConversion()); } }