You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason is when we get a widenedTarget, the getExactMatch method doesn't check the method varargs type, but override a method like this maybe not recommended. So should we make a change of ParseTools like this,
public static Method getExactMatch(String name, Class[] args, Class returnType, Class cls, boolean varArgs) {
outer:
for (Method meth : cls.getMethods()) {
if (name.equals(meth.getName()) && returnType == meth.getReturnType() && varArgs == meth.isVarArgs()) {
Class[] parameterTypes = meth.getParameterTypes();
if (parameterTypes.length != args.length) continue;
for (int i = 0; i < parameterTypes.length; i++) {
if (parameterTypes[i] != args[i]) continue outer;
}
return meth;
}
}
return null;
}
to make this rare case result same
The text was updated successfully, but these errors were encountered:
it's a rare case when someone override the method with parameter of varargs by an array type and vice versa.
for example
the console shows
The reason is when we get a widenedTarget, the getExactMatch method doesn't check the method varargs type, but override a method like this maybe not recommended. So should we make a change of ParseTools like this,
to make this rare case result same
The text was updated successfully, but these errors were encountered: