code: public static int allParametersAndArgumentsMatch(Parameter[] params, ClassNode[] args) {
          if (params==null) {
              params = Parameter.EMPTY_ARRAY;
          }
          int dist = 0;
          if (args.length<params.length) return -1;
          // we already know the lengths are equal
          for (int i = 0; i < params.length; i++) {
              ClassNode paramType = params[i].getType();
              ClassNode argType = args[i];
              if (!isAssignableTo(argType, paramType)) return -1;
              else {
                  if (!paramType.equals(argType)) dist+=getDistance(argType, paramType);
              }
          }
          return dist;
      }
docs: Checks that arguments and parameter types match.
  @param params method parameters
  @param args type arguments
  @return -1 if arguments do not match, 0 if arguments are of the exact type and >0 when one or more argument is
  not of the exact type but still match