查找忽略分配的大小写和参数类型的方法
/** 来 自 时代Java公众号 - nowjava.com**/ //package com.nowjava; import java.lang.reflect.Method; import java.util.Arrays; public class Main { public static Method findMethodIgnoreCaseAndArgsTypesAssigned( final Method[] methods, final String methodName, final Class<?>... argsClasses) { Method method = null; for (final Method m : methods) { final String name = m.getName(); final Class<?>[] argTypes = m.getParameterTypes(); if (argsClasses.length != argTypes.length) { continue; } if (name.equalsIgnoreCase(methodName)) { if (Arrays.equals(argTypes, argsClasses)) {// 来自 N o w J a v a . c o m - 时 代 Java return m; } int i = 0; for (final Class<?> argType : argTypes) { if (argType.isAssignableFrom(argsClasses[i])) { ++i; } else