Returns the matching method
974536
private void getMethods(ArrayList<JMethod> methodList)
  {
    for (JMethod method : getDeclaredMethods()) {
      if (! methodList.contains(method))
        methodList.add(method);
    }

    if (getSuperClass() != null) {
      for (JMethod method : getSuperClass().getMethods()) {
        if (! methodList.contains(method))
          methodList.add(method);
      }
    }
  }
618930
function methodMatch(part) {
    let maxMatch = null
    let maxMatchCount = 0

    // Go through each mapper and check if the name matches. Then, take the highest match to avoid matching
    // 'any', if 'any character' was given, and so on.
    Object.keys(mapper).forEach((key) => {
        const regex = new RegExp(`^(${key.replace(' ', ') (')})`, 'i')
        const matches = part.match(regex)

        const count = matches ? matches.length : 0

        if (count > maxMatchCount) {
            maxMatchCount = count
            maxMatch = key
        }
    })

    if (maxMatch) {
        // We've got a match. Create the desired object and populate it.
        const item = mapper[maxMatch]
        return new item['class'](maxMatch, item.method, buildQuery)
    }

    throw new SyntaxException(`Invalid method: ${part}`)
}
1369282
def find_method(method_name)
      reg = Regexp.new(method_name.to_s, true)
      methods.sort.select { |meth| reg.match(meth) }
    end
1262022
public static Set<MethodSymbol> findMatchingMethods(
      Name name, final Predicate<MethodSymbol> predicate, Type startClass, Types types) {
    Filter<Symbol> matchesMethodPredicate =
        sym -> sym instanceof MethodSymbol && predicate.apply((MethodSymbol) sym);

    Set<MethodSymbol> matchingMethods = new HashSet<>();
    // Iterate over all classes and interfaces that startClass inherits from.
    for (Type superClass : types.closure(startClass)) {
      // Iterate over all the methods declared in superClass.
      TypeSymbol superClassSymbol = superClass.tsym;
      Scope superClassSymbols = superClassSymbol.members();
      if (superClassSymbols != null) { // Can be null if superClass is a type variable
        for (Symbol symbol :
            superClassSymbols.getSymbolsByName(name, matchesMethodPredicate, NON_RECURSIVE)) {
          // By definition of the filter, we know that the symbol is a MethodSymbol.
          matchingMethods.add((MethodSymbol) symbol);
        }
      }
    }
    return matchingMethods;
  }
731051
public static <T extends MethodDescription> ElementMatcher.Junction<T> isDefaultMethod() {
        return new MethodSortMatcher<T>(MethodSortMatcher.Sort.DEFAULT_METHOD);
    }
126605
public static Method findMatchingMethod(Method originalMethod, String methodName) {
        Class<?> originalClass = originalMethod.getDeclaringClass();

        return AccessController.doPrivileged(new PrivilegedAction<Method>() {
            @Override
            public Method run() {
                return findMatchingMethod(originalMethod, methodName, originalClass, new ResolutionContext(), originalClass);
            }
        });
    }
854352
public static Method findMethod(Class<?> clazz, String name) {
		for (Method me : clazz.getDeclaredMethods()) {
			if (me.getName().equalsIgnoreCase(name)) {
				return me;
			}
		}
		if (clazz.getSuperclass() != null) {
			return findMethod(clazz.getSuperclass(), name);
		}
		return null;
	}
558336
def match(self, name):
        
        if self.method == Ex.Method.PREFIX:
            return name.startswith(self.value)
        elif self.method == Ex.Method.SUFFIX:
            return name.endswith(self.value)
        elif self.method == Ex.Method.CONTAINS:
            return self.value in name
        elif self.method == Ex.Method.EXACT:
            return self.value == name
        elif self.method == Ex.Method.REGEX:
            return re.search(self.value, name)
        return False
346988
private static RouteDefinition find(Map<RouteDefinition, Method> add, Method method) {

		if (add == null || add.size() == 0) {
			return null;
		}

		for (RouteDefinition additional : add.keySet()) {
			Method match = add.get(additional);

			if (isMatching(method, match)) {
				return additional;
			}
		}

		return null;
	}
459151
public static Method getMethod(Class<?> clazz, String methodName, Class<?>... parameterTypes) {
        if (clazz == null || methodName == null || methodName.length() == 0) {
            return null;
        }

        for (Class<?> itr = clazz; hasSuperClass(itr); ) {
            Method[] methods = itr.getDeclaredMethods();

            for (Method method : methods) {
                if (method.getName().equals(methodName) && Arrays.equals(method.getParameterTypes(), parameterTypes)) {
                    return method;
                }
            }

            itr = itr.getSuperclass();
        }
        return null;
    }
345648
public static Method findMethod(Class clazz, String methodName) {
        final List<Method> methods = getDeclaredMethodsRecursively(clazz).get(methodName);
        if (methods.isEmpty()) {
            throw new IllegalArgumentException(clazz.getName() + "::" + methodName + " not found");
        }
        final List<Method> specificMethods;
        if (methods.size() > 1) {
            specificMethods
                = methods.stream().filter(m -> m.getReturnType() != Object.class).collect(Collectors.toList());
        } else {
            specificMethods = methods;
        }
        if (specificMethods.size() != 1) {
            throw new IllegalArgumentException(
                clazz.getName() + "::" + methodName
                + " more then one method found, can not decide which one to use. "
                + methods
            );
        }
        return specificMethods.get(0);
    }
1158691
public static <T extends MethodDescription> ElementMatcher.Junction<T> isToString() {
        return named("toString").and(takesArguments(0)).and(returns(TypeDescription.STRING));
    }
63017
def get(self):
        
        self.log.info('starting the ``get`` method')

        match = self._query_sdss()

        self.log.info('completed the ``get`` method')
        return match
422234
public static Filter matchMethodDescription(final Description desiredDescription) {
        return new Filter() {
            @Override
            public boolean shouldRun(Description description) {
                if (description.isTest()) {
                    return desiredDescription.equals(description);
                }

                // explicitly check if any children want to run
                for (Description each : description.getChildren()) {
                    if (shouldRun(each)) {
                        return true;
                    }
                }
                return false;
            }

            @Override
            public String describe() {
                return String.format("Method %s", desiredDescription.getDisplayName());
            }
        };
    }
954867
@Override
  public Description matchMethod(MethodTree methodTree, VisitorState state) {
    SuggestedFix.Builder fix = null;
    if (isInjectedConstructor(methodTree, state)) {
      for (AnnotationTree annotationTree : methodTree.getModifiers().getAnnotations()) {
        if (OPTIONAL_INJECTION_MATCHER.matches(annotationTree, state)) {
          // Replace the annotation with "@Inject"
          if (fix == null) {
            fix = SuggestedFix.builder();
          }
          fix = fix.replace(annotationTree, "@Inject");
        } else if (BINDING_ANNOTATION_MATCHER.matches(annotationTree, state)) {
          // Remove the binding annotation
          if (fix == null) {
            fix = SuggestedFix.builder();
          }
          fix = fix.delete(annotationTree);
        }
      }
    }
    if (fix == null) {
      return Description.NO_MATCH;
    } else {
      return describeMatch(methodTree, fix.build());
    }
  }
1024257
public Set<Method> getMethodsMatchParams(Class<?>... types) {
        return getMethodsFromDescriptors(store.get(index(MethodParameterScanner.class), names(types).toString()), loaders());
    }
723596
def get_methods_by_name(self, name):
        

        return (m for m in self.methods if m.get_name() == name)