Check if there are unused method parameters. In this case an exception
was throws.

@param method
the method
@param usedMethodParameters
the used method parameters
@param excludedClasses
the excluded classes
168780
public static void checkUnusedParameters(SQLiteModelMethod method, Set<String> usedMethodParameters, TypeName excludedClasses) {
		int paramsCount = method.getParameters().size();
		int usedCount = usedMethodParameters.size();

		if (paramsCount > usedCount) {
			StringBuilder sb = new StringBuilder();
			String separator = "";
			for (Pair<String, TypeName> item : method.getParameters()) {
				if (excludedClasses != null && item.value1.equals(excludedClasses)) {
					usedCount++;
				} else {
					if (!usedMethodParameters.contains(item.value0)) {
						sb.append(separator + "'" + item.value0 + "'");
						separator = ", ";
					}
				}
			}

			if (paramsCount > usedCount) {
				throw (new InvalidMethodSignException(method, "unused parameter(s) " + sb.toString()));
			}
		}
	}
309139
public boolean isMethodAllowed(String method) {

		return HttpMethod.isValidMethod(method) && (allowedMethods.isEmpty() || allowedMethods.contains(method));
	}
33578
public static void assertOneParameter(final Method method, Class<? extends Annotation> annotation)
   {
      if (method.getParameterTypes().length != 1)
      {
         throw annotation == null ? MESSAGES.methodHasToDeclareExactlyOneParameter(method) : MESSAGES.methodHasToDeclareExactlyOneParameter2(method, annotation);
      }
   }
169154
public boolean hasDeclaredMethodParameterAnnotation(final String methodParameterAnnotationName) {
        for (final MethodInfo mi : getDeclaredMethodInfo()) {
            if (mi.hasParameterAnnotation(methodParameterAnnotationName)) {
                return true;
            }
        }
        return false;
    }
86317
public static void parametersUsageNotAllowed(String methodName, String className){
		throw new DynamicConversionParameterException(MSG.INSTANCE.message(dynamicConversionParameterException,methodName,className));
	}
690259
@Deprecated
    public static synchronized void suppressMethod(Class<?> clazz, String methodName, Class<?>[] parameterTypes) {
        SuppressCode.suppressMethod(clazz, methodName, parameterTypes);
    }
890415
private Method methodExists(Class<?> clazz, String method, Class<?>[] params) {
		try {
			return clazz.getMethod(method, params);
		} catch (NoSuchMethodException e) {
			return null;
		}
	}
339966
public static int countParameterOfType(ModelMethod method, TypeName parameter) {
		int counter = 0;
		for (Pair<String, TypeName> item : method.getParameters()) {
			if (item.value1.equals(parameter)) {
				counter++;
			}
		}

		return counter;
	}
1283404
@Override
    public void setMethod(String method) throws UnsupportedMethodException {
        MethodValues val = MethodValues.match(method, 0, method.length());
        if (null == val) {
            throw new UnsupportedMethodException("Illegal method " + method);
        }
        setMethod(val);
    }
825958
public void checkUrlPatternVariableCount(Method executeMethod, List<String> urlPatternVarList, List<Class<?>> pathParamTypeList) {
        if (urlPatternVarList.size() != pathParamTypeList.size()) {
            throwActionPathParameterDifferentArgsException(executeMethod, urlPatternVarList, pathParamTypeList);
        }
    }
182884
public static void javaMethodParam2WhereConditions(MethodSpec.Builder methodBuilder, SQLiteModelMethod method,
			String methodParamName, String paramName, TypeName paramType) {
		if (method.hasAdapterForParam(methodParamName)) {
			
			checkTypeAdapterForParam(method, methodParamName, BindSqlParam.class);
			
			methodBuilder.addCode(
					AbstractSQLTransform.PRE_TYPE_ADAPTER_TO_STRING + "$L" + AbstractSQLTransform.POST_TYPE_ADAPTER,
					SQLTypeAdapterUtils.class, method.getAdapterForParam(methodParamName), paramName);
		} else {
			SQLTransform transform = lookup(paramType);

			AssertKripton.assertTrueOrUnsupportedFieldTypeException(transform != null, paramType);
			transform.generateWriteParam2WhereCondition(methodBuilder, method, paramName, paramType);
		}
	}
40615
private static boolean checkParameters(Method method, Object... data)
	{
		Parameter[] parameters = method.getParameters();
		if (ArrayUtils.isEmpty(data) && parameters.length != 0)
			return false;
		if (parameters.length != data.length)
			return false;

		for (int i = 0; i < parameters.length; i++)
		{
			Class<?> paramClass = parameters[i].getType();
			if (data[i] != null)
			{
				Class<?> dataClass = data[i].getClass();
				if (!ClassUtils.isAssignable(dataClass, paramClass, true))
					return false;
			}
		}

		return true;
	}
574128
private List<Map<Class<? extends Annotation>, ParameterInfo<?>>> createParametersInfos(Method method) {
    if (method.getParameterTypes().length <= 2) {
      return Collections.emptyList();
    }

    List<Map<Class<? extends Annotation>, ParameterInfo<?>>> result = new ArrayList<>();
    Type[] parameterTypes = method.getGenericParameterTypes();
    Annotation[][] parameterAnnotations = method.getParameterAnnotations();

    for (int i = 2; i < parameterAnnotations.length; i++) {
      Annotation[] annotations = parameterAnnotations[i];
      Map<Class<? extends Annotation>, ParameterInfo<?>> paramAnnotations = new IdentityHashMap<>();

      for (Annotation annotation : annotations) {
        Class<? extends Annotation> annotationType = annotation.annotationType();
        ParameterInfo<?> parameterInfo;

        if (PathParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createPathParamConverter(parameterTypes[i]));
        } else if (QueryParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createQueryParamConverter(parameterTypes[i]));
        } else if (HeaderParam.class.isAssignableFrom(annotationType)) {
          parameterInfo = ParameterInfo.create(annotation,
                                               ParamConvertUtils.createHeaderParamConverter(parameterTypes[i]));
        } else {
          parameterInfo = ParameterInfo.create(annotation, null);
        }

        paramAnnotations.put(annotationType, parameterInfo);
      }

      // Must have either @PathParam, @QueryParam or @HeaderParam, but not two or more.
      int presence = 0;
      for (Class<? extends Annotation> annotationClass : paramAnnotations.keySet()) {
        if (SUPPORTED_PARAM_ANNOTATIONS.contains(annotationClass)) {
          presence++;
        }
      }
      if (presence != 1) {
        throw new IllegalArgumentException(
          String.format("Must have exactly one annotation from %s for parameter %d in method %s",
                        SUPPORTED_PARAM_ANNOTATIONS, i, method));
      }

      result.add(Collections.unmodifiableMap(paramAnnotations));
    }

    return Collections.unmodifiableList(result);
  }
964896
public function methodExcludedByOptions($method, array $options)
	{
		return ( ! empty($options['only']) && ! in_array($method, (array) $options['only'])) ||
			( ! empty($options['except']) && in_array($method, (array) $options['except']));
	}
954570
private void processMethods(Set<ExecutableElement> hookMethodsFromInterfaces) {
    List<ExecutableElement> templateMethods = ElementFilter
        .methodsIn(component.getEnclosedElements())
        .stream()
        .filter(ComponentGeneratorsUtil::isMethodVisibleInTemplate)
        .filter(method -> !isHookMethod(component, method, hookMethodsFromInterfaces))
        .collect(Collectors.toList());

    templateMethods.forEach(method -> {
      String methodName = method.getSimpleName().toString();
      String exposedMethodName = exposeExistingJavaMethodToJs(method);
      optionsBuilder.addStatement("options.addMethod($S, p.$L)", methodName, exposedMethodName);
    });
  }
425073
private boolean inMethodConfigs(String methodConfigs, String methodName) {
        String[] excludeMethodCollections = StringUtils.splitWithCommaOrSemicolon(methodConfigs);
        for (String excludeMethodName : excludeMethodCollections) {
            boolean exist = StringUtils.equals(excludeMethodName, methodName);
            if (exist) {
                return true;
            }
        }
        return false;
    }
968092
private static Method getMethod(final Class<?> mbean,
                                  final String method,
                                  final String... params) {
    try {
      final ClassLoader loader = mbean.getClassLoader();
      final Class<?>[] paramClasses = new Class<?>[params.length];
      for (int i = 0; i < params.length; i++) {
        paramClasses[i] = primitives.get(params[i]);
        if (paramClasses[i] == null) {
          paramClasses[i] = Class.forName(params[i], false, loader);
        }
      }
      return mbean.getMethod(method, paramClasses);
    } catch (RuntimeException e) {
      throw e;
    } catch (Exception e) {
      return null;
    }
  }