in src/main/java/org/apache/commons/jexl3/internal/introspection/MethodKey.java [364:399]
private static boolean isInvocationConvertible(
final Class<?> formal, final Class<?> type, final boolean strict, final boolean possibleVarArg) {
Class<?> actual = type;
/* if it is a null, it means the arg was null */
if (actual == null && !formal.isPrimitive()) {
return true;
}
/* system asssignable, both sides must be arrays or not */
if (actual != null && formal.isAssignableFrom(actual) && actual.isArray() == formal.isArray()) {
return true;
}
/* catch all... */
if (!strict && formal == Object.class) {
return true;
}
/* Primitive conversion check. */
if (formal.isPrimitive()) {
final Class<?>[] clist = strict ? STRICT_CONVERTIBLES.get(formal) : CONVERTIBLES.get(formal);
if (clist != null) {
for (final Class<?> aClass : clist) {
if (actual == aClass) {
return true;
}
}
}
return false;
}
/* Check for vararg conversion. */
if (possibleVarArg && formal.isArray()) {
if (actual.isArray()) {
actual = actual.getComponentType();
}
return isInvocationConvertible(formal.getComponentType(), actual, strict, false);
}
return false;
}