Tests if an annotated method matches a name and parameter types.
174240
public static boolean isMatch(Method javaMethod,
                                String name, Class<?> []param)
  {
    if (! javaMethod.getName().equals(name))
      return false;

    Class<?> []mparam = javaMethod.getParameterTypes();

    return isMatch(mparam, param);
  }
1117147
public static void validateReturnType(Method method, Class<? extends Annotation> annotationType,
                                          Class<?> expectedReturnType) {
        if (!method.getReturnType().equals(expectedReturnType)) {
            throw new BeanCreationException("Method " + method.getName() + " annotated with @"
                  + annotationType.getName() + " must have a return type of "
                  + expectedReturnType.getName());
        }
    }
1099031
private static boolean compareAnnotatedParameters(List<? extends AnnotatedParameter<?>> p1, List<? extends AnnotatedParameter<?>> p2) {
        if (p1.size() != p2.size()) {
            return false;
        }
        for (int i = 0; i < p1.size(); ++i) {
            if (!compareAnnotated(p1.get(i), p2.get(i))) {
                return false;
            }
        }
        return true;
    }
1288634
static <T extends Annotation> List<List<T>> getParameterAnnotations(Method method, Class<T> type) {
		List<List<T>> annotations = new ArrayList<>();
		for (List<Annotation> paramAnnotations : getParameterAnnotations(method)) {
			annotations.add(filterAnnotations(paramAnnotations, type));
		}
		return annotations;
	}
289549
private static boolean isPotentialVarArgsMethod(Method method, Object[] arguments) {
        return doesParameterTypesMatchForVarArgsInvocation(method.isVarArgs(), method.getParameterTypes(), arguments);
    }
1060333
private static List<List<Annotation>> getParameterAnnotations(Method method) {
		if (methodParamAnnotationCache.containsKey(method)) {
			return methodParamAnnotationCache.get(method);
		}
		List<List<Annotation>> annotations = new ArrayList<>();
		for (Annotation[] paramAnnotations : method.getParameterAnnotations()) {
			List<Annotation> listAnnotations = new ArrayList<>();
			Collections.addAll(listAnnotations, paramAnnotations);
			annotations.add(listAnnotations);
		}
		annotations = Collections.unmodifiableList(annotations);
		methodParamAnnotationCache.put(method, annotations);
		return annotations;
	}
1144561
private boolean matches(ParameterizedType requiredType, ParameterizedType beanType) {
        if (!requiredType.getRawType().equals(beanType.getRawType())) {
            return false;
        }
        if (requiredType.getActualTypeArguments().length != beanType.getActualTypeArguments().length) {
            throw new IllegalArgumentException("Invalid argument combination " + requiredType + "; " + beanType);
        }
        for (int i = 0; i < requiredType.getActualTypeArguments().length; i++) {
            if (!parametersMatch(requiredType.getActualTypeArguments()[i], beanType.getActualTypeArguments()[i])) {
                return false;
            }
        }
        return true;
    }
127591
public boolean hasParameterAnnotation(final String annotationName) {
        for (final MethodParameterInfo methodParameterInfo : getParameterInfo()) {
            if (methodParameterInfo.hasAnnotation(annotationName)) {
                return true;
            }
        }
        return false;
    }
1262085
public static Matcher<ClassTree> hasMethod(final Matcher<MethodTree> methodMatcher) {
    return new Matcher<ClassTree>() {
      @Override
      public boolean matches(ClassTree t, VisitorState state) {
        for (Tree member : t.getMembers()) {
          if (member instanceof MethodTree) {
            if (methodMatcher.matches((MethodTree) member, state)) {
              return true;
            }
          }
        }
        return false;
      }
    };
  }
1247374
private static boolean isMatching(Method base, Method compare) {

		// if names and argument types match ... then this are the same method
		if (base.getName().equals(compare.getName()) &&
		    base.getParameterCount() == compare.getParameterCount()) {

			Class<?>[] typeBase = base.getParameterTypes();
			Class<?>[] typeCompare = compare.getParameterTypes();

			for (int index = 0; index < typeBase.length; index++) {
				Class clazzBase = typeBase[index];
				Class clazzCompare = typeCompare[index];
				if (!clazzBase.equals(clazzCompare)) {
					return false;
				}
			}

			return true;
		}

		return false;
	}
931406
private static void checkTypeAdapterForParam( SQLiteModelMethod method,
			String methodParamName, Class<? extends Annotation> annotation) {
		
		TypeName paramType=method.findParameterType(methodParamName);
		if (method.isSpreadParameter(methodParamName)) {
			if (paramType instanceof ArrayTypeName) {				
				paramType = ((ArrayTypeName) paramType).componentType;
			} else if (paramType instanceof ParameterizedTypeName) {				
				paramType = ((ParameterizedTypeName) paramType).typeArguments.get(0);
			} 
		}
		
		TypeName adapterType = method.getAdapterForParam(methodParamName);
		
		
		TypeName sourceType = TypeUtility.typeName(TypeAdapterHelper.detectSourceType(method, adapterType));
		TypeName uboxSourceType=sourceType;
		
		if (TypeUtility.isTypeWrappedPrimitive(sourceType)) {
			uboxSourceType=sourceType.unbox();
		}
		
		boolean expr=uboxSourceType.toString().equals(paramType.toString()) || sourceType.toString().equals(paramType.toString());
		
		
		AssertKripton.fail(!expr,
				"In DAO '%s', method '%s' has parameter '%s' uses @%s that manages type '%s' instead of '%s'", method.getParent().getName(), method.getName(),
				methodParamName, annotation.getSimpleName(),sourceType, paramType);

	}
719777
protected boolean isSetterMethod(Method method) {
        Matcher matcher = _setterRegex.matcher(method.getName());
        if (matcher.matches()) {

            if (Modifier.isStatic(method.getModifiers())) return false;
            if (!Modifier.isPublic(method.getModifiers())) return false;
            if (!Void.TYPE.equals(method.getReturnType())) return false;

            // method parameter checks
            Class[] params = method.getParameterTypes();
            if (params.length != 1) return false;
            if (TypeMappingsFactory.TYPE_UNKNOWN == _tmf.getTypeId(params[0])) return false;

            return true;
        }
        return false;
    }
313367
private ParameterName[] parameterNames(Method method) {
        ParameterName[] parameterNames;
        if (method != null) {
            String[] annotatedNames = annotatedParameterNames(method);
            String[] paranamerNames = paranamerParameterNames(method);
            String[] contextNames = contextParameterNames(method);

            parameterNames = new ParameterName[annotatedNames.length];
            for (int i = 0; i < annotatedNames.length; i++) {
                parameterNames[i] = parameterName(annotatedNames, paranamerNames, contextNames, i);
            }
        } else {
            String[] stepMatcherParameterNames = stepMatcher.parameterNames();
            parameterNames = new ParameterName[stepMatcherParameterNames.length];
            for (int i = 0; i < stepMatcherParameterNames.length; i++) {
                parameterNames[i] = new ParameterName(stepMatcherParameterNames[i], false, false);
            }
        }
        return parameterNames;
    }
890415
private Method methodExists(Class<?> clazz, String method, Class<?>[] params) {
		try {
			return clazz.getMethod(method, params);
		} catch (NoSuchMethodException e) {
			return null;
		}
	}
424273
function matchesMethod(method, opts) {
  var methods = !opts.method || Array.isArray(opts.method) ?
    opts.method : [opts.method];

  if (methods) {
    return !!~methods.indexOf(method);
  }
}
19140
def check_return_types(self, method):
        ''''''
        mn = method.__name__
        retanno = method.__annotations__.get('return', None)
        # Take a look at the syntax
        if not retanno:
            return ['Missing return types for method "{}"'.format(mn)]
        if not isinstance(retanno, (list, tuple)):
            msg = 'Return annotation for method "{}" not tuple nor list'
            return [msg.format(mn)]
        if (any(map(lambda t: not isinstance(t, (list, tuple)), retanno)) or
                any(map(lambda t: not (2 <= len(t) <= 3), retanno))):
            msg = ('Return values series for "{}" should be composed of '
                   '2 or 3-items tuples (code, msg, type).')
            return [msg.format(mn)]
        errors = []
        # Take a look at the codes
        declared = set([t[0] for t in retanno])
        actual = set(int(s)
                     for s in HTTP_STATUSES_REGEX.findall(method.source))
        if declared != actual:
            if declared.issubset(actual):
                msg = 'Method {} returns undeclared codes: {}.'
                errors.append(msg.format(mn, actual - declared))
            elif actual.issubset(declared):
                msg = 'Method {} declares codes {} that are never used.'
                errors.append(msg.format(mn, declared - actual))
            else:
                msg = 'Declared {} and Used {} codes mismatch.'
                errors.append(msg.format(declared, actual))
        # Take a look at the types
        ret_with_types = filter(lambda t: len(t) == 3, retanno)
        msg = 'Method {} return type for code {} must be class (not instance).'
        msg_mod = 'Method {} return type for code {} must subclass from Model.'
        for code, _, type_ in ret_with_types:
            try:
                if Model not in type_.__bases__:
                    errors.append(msg_mod.format(mn, code))
            except AttributeError:
                errors.append(msg.format(mn, code))
        return errors
736088
public boolean isAnnotated(ExecutableElement method) {
        List<? extends AnnotationMirror> annotationMirrors = method.getAnnotationMirrors();
        for (AnnotationMirror annotationMirror : annotationMirrors) {
            String typeName = annotationMirror.getAnnotationType().toString();
            if (!AnnotationUtil.INTERNAL_ANNOTATION_NAMES.contains(typeName)) {
                return true;
            }
        }
        return false;
    }