private static boolean isMethodInvocationConvertible(Class formal,Class actual){
  if (actual == null && !formal.isPrimitive()) {
    return true;
  }
  if (actual != null && formal.isAssignableFrom(actual)) {
    return true;
  }
  if (formal.isPrimitive()) {
    if (formal == Boolean.TYPE && actual == Boolean.class)     return true;
    if (formal == Character.TYPE && actual == Character.class)     return true;
    if (formal == Byte.TYPE && actual == Byte.class)     return true;
    if (formal == Short.TYPE && (actual == Short.class || actual == Byte.class))     return true;
    if (formal == Integer.TYPE && (actual == Integer.class || actual == Short.class || actual == Byte.class))     return true;
    if (formal == Long.TYPE && (actual == Long.class || actual == Integer.class || actual == Short.class || actual == Byte.class))     return true;
    if (formal == Float.TYPE && (actual == Float.class || actual == Long.class || actual == Integer.class || actual == Short.class || actual == Byte.class))     return true;
    if (formal == Double.TYPE && (actual == Double.class || actual == Float.class || actual == Long.class || actual == Integer.class || actual == Short.class || actual == Byte.class))     return true;
  }
  return false;
}

private static boolean isMethodInvocationConvertible ( Class formal , Class actual ) { if ( actual == null && ! formal . isPrimitive ( ) ) { return true ; } if ( actual != null && formal . isAssignableFrom ( actual ) ) { return true ; } if ( formal . isPrimitive ( ) ) { if ( formal == Boolean . TYPE && actual == Boolean . class ) return true ; if ( formal == Character . TYPE && actual == Character . class ) return true ; if ( formal == Byte . TYPE && actual == Byte . class ) return true ; if ( formal == Short . TYPE && ( actual == Short . class || actual == Byte . class ) ) return true ; if ( formal == Integer . TYPE && ( actual == Integer . class || actual == Short . class || actual == Byte . class ) ) return true ; if ( formal == Long . TYPE && ( actual == Long . class || actual == Integer . class || actual == Short . class || actual == Byte . class ) ) return true ; if ( formal == Float . TYPE && ( actual == Float . class || actual == Long . class || actual == Integer . class || actual == Short . class || actual == Byte . class ) ) return true ; if ( formal == Double . TYPE && ( actual == Double . class || actual == Float . class || actual == Long . class || actual == Integer . class || actual == Short . class || actual == Byte . class ) ) return true ; } return false ; }
determines whether a type represented by a class object is convertible to another type represented by a class object using a method invocation conversion , treating object types of primitive types as if they were primitive types ( that is , a boolean actual parameter type matches boolean primitive formal type ) . this behavior is because this method is used to determine applicable methods for an actual parameter list , and primitive types are represented by their object duals in reflective method calls .
