Ensure method has the same signature matching method on parent interface.

        :param method: L{quarkc.ast.Method} instance.
494969
def visit_Method(self, method):
        
        resolved_method = method.resolved.type

        def get_params(method, extra_bindings):
            # The Method should already be the resolved version.
            result = []
            for param in method.params:
                resolved_param = texpr(param.resolved.type, param.resolved.bindings, extra_bindings)
                result.append(resolved_param.id)
            return result

        def get_return_type(method, extra_bindings):
            # The Method should already be the resolved version.
            return texpr(method.type.resolved.type, method.type.resolved.bindings,
                         extra_bindings).id

        def signature(method, return_type, params):
            return "%s %s(%s)" % (return_type, method.name.text, ", ".join(params))

        # Ensure the method has the same signature as matching methods on parent
        # interfaces:
        interfaces = list(t for t in method.clazz.bases if isinstance(t.resolved.type, Interface))
        for interface in interfaces:
            interfaceTypeExpr = interface.resolved
            for definition in interfaceTypeExpr.type.definitions:
                if definition.name.text == method.name.text:
                    resolved_definition = definition.resolved.type
                    method_params = get_params(resolved_method, method.clazz.resolved.bindings)
                    definition_params = get_params(resolved_definition, interfaceTypeExpr.bindings)
                    method_return = get_return_type(resolved_method, method.clazz.resolved.bindings)
                    definition_return = get_return_type(resolved_definition, interfaceTypeExpr.bindings)

                    if method_params != definition_params or method_return != definition_return:
                        self.errors.append(
                            "%s: method signature '%s' on %s does not match method '%s' on interface %s" % (
                                lineinfo(method), signature(resolved_method, method_return, method_params),
                                method.clazz.resolved.type.id,
                                signature(resolved_definition, definition_return, definition_params),
                                interface.resolved.type.id))
292641
public static boolean isParticleMethod(FrameworkMethod method) {
        return ((null != method.getAnnotation(Test.class)) ||
                (null != method.getAnnotation(Before.class)) ||
                (null != method.getAnnotation(After.class)) ||
                (null != method.getAnnotation(BeforeClass.class)) ||
                (null != method.getAnnotation(AfterClass.class)));
    }
302681
@Override
  public Description matchMethodInvocation(MethodInvocationTree t, VisitorState state) {
    String arg1;
    String arg2;
    if (instanceEqualsMatcher.matches(t, state)) {
      arg1 = state.getSourceForNode(((JCFieldAccess) t.getMethodSelect()).getExpression());
      arg2 = state.getSourceForNode(t.getArguments().get(0));
    } else if (staticEqualsMatcher.matches(t, state)) {
      arg1 = state.getSourceForNode(t.getArguments().get(0));
      arg2 = state.getSourceForNode(t.getArguments().get(1));
    } else {
      return NO_MATCH;
    }

    Fix fix =
        SuggestedFix.builder()
            .replace(t, "Arrays.equals(" + arg1 + ", " + arg2 + ")")
            .addImport("java.util.Arrays")
            .build();
    return describeMatch(t, fix);
  }
745164
public static boolean isMatch(Method methodA, Method methodB)
  {
    if (! methodA.getName().equals(methodB.getName()))
      return false;

    return isMatch(methodA.getParameterTypes(),
                   methodB.getParameterTypes());
  }
331978
def method_signature(e, method)
      file, line, call_method = e.backtrace.first.split(':')
      call_method             = call_method.gsub(/[']/, '').split('`').last
      if call_method && call_method.to_sym == method.to_sym
        source_line = File.open(file).to_a[line.to_i - 1].chomp!
        if source_line =~ /def #{method}/
          signature = source_line.strip.gsub(/,/, '').split(%r{[ ()]})
          signature.shift # remove def
          return signature.reject { |a| a =~ /^([={}\)\(])*$/ }
        end
      end
      []
    rescue
      []
    end
384077
private void classifyMethod(ExecutableElement method) {
    switch (method.getParameters().size()) {
      case 0:
        classifyMethodNoArgs(method);
        break;
      case 1:
        classifyMethodOneArg(method);
        break;
      default:
        errorReporter.reportError("Builder methods must have 0 or 1 parameters", method);
    }
  }
410506
public static boolean isObjectMethod(Method method) {
        return OBJECT_METHOD.stream().filter(meta -> meta.equals(method)).limit(1).count() > 0;
    }
758011
private static boolean isMatchesMethod(Method method) {
        if (method.getParameterTypes().length != 1) {
            return false;
        }
        if (method.isBridge()) {
            return false;
        }
        return "matches".equals(method.getName());
    }
931451
def _verify_method(self):
        

        class_level = self._target.is_class_or_module()

        verify_method(self._target, self._method_name, class_level=class_level)
1084204
boolean isConsiderateMethod(Collection<String> methodProceeds, ExecutableElement methodElement) {
//		int argNum methodElement.getParameters().size();
		String signature = methodElement.getSimpleName().toString(); // + "(" + argNum + ")";
		// Check if method ith same signature has been already proceed.
		if (methodProceeds.contains(signature)) {
			return false;
		}
		// Herited from Object
		TypeElement objectElement = environment.getElementUtils().getTypeElement(Object.class.getName());
		if (objectElement.getEnclosedElements().contains(methodElement)) {
			return false;
		}
		// Static, not public ?
		if (!methodElement.getModifiers().contains(Modifier.PUBLIC) || methodElement.getModifiers().contains(Modifier.STATIC)) {
			return false;
		}
		// TransientDataService ?
		List<? extends AnnotationMirror> annotationMirrors = methodElement.getAnnotationMirrors();
		for (AnnotationMirror annotationMirror : annotationMirrors) {
			if (annotationMirror.getAnnotationType().toString().equals(TransientDataService.class.getName())) {
				return false;
			}
		}
		methodProceeds.add(signature);
		return true;
	}
1316688
private Status overwriteMatchingMethod(MethodSnippet msi) {
        String qpt = msi.qualifiedParameterTypes();
        List<MethodSnippet> matching = state.methods()
                .filter(sn ->
                           sn != null
                        && sn != msi
                        && sn.status().isActive()
                        && sn.name().equals(msi.name())
                        && qpt.equals(sn.qualifiedParameterTypes()))
                .collect(toList());

        // Look through all methods for a method of the same name, with the
        // same computed qualified parameter types
        Status overwrittenStatus = null;
        for (MethodSnippet sn : matching) {
            overwrittenStatus = sn.status();
            SnippetEvent se = new SnippetEvent(
                    sn, overwrittenStatus, OVERWRITTEN,
                    false, msi, null, null);
            sn.setOverwritten();
            secondaryEvents.add(se);
            state.debug(DBG_EVNT,
                    "Overwrite event #%d -- key: %s before: %s status: %s sig: %b cause: %s\n",
                    secondaryEvents.size(), se.snippet(), se.previousStatus(),
                    se.status(), se.isSignatureChange(), se.causeSnippet());
        }
        return overwrittenStatus;
    }
283436
def _VerifyMethodCall(self):
    

    expected = self._PopNextMethod()

    # Loop here, because we might have a MethodGroup followed by another
    # group.
    while isinstance(expected, MethodGroup):
      expected, method = expected.MethodCalled(self)
      if method is not None:
        return method

    # This is a mock method, so just check equality.
    if expected != self:
      raise UnexpectedMethodCallError(self, expected)

    return expected
282926
private void checkMethod(String methodName, String signature) {
    JavaClass javaClass = checkClass();
    if (javaClass == null) {
      return;
    }

    for (JavaClass current = javaClass; current != null; current = getSuperclass(current)) {
      for (Method method : current.getMethods()) {
        if (methodName.equals(method.getName()) && signature.equals(method.getSignature())) {
          // method has been found - check if it's beta
          if (isBeta(method.getAnnotationEntries())) {
            bugReporter.reportBug(createBugInstance(BETA_METHOD_USAGE).addCalledMethod(this));
          }
          return;
        }
      }
    }
    if (!javaClass.isAbstract()) {
      bugReporter.logError(
          "Can't locate method " + javaClass.getClassName() + "." + methodName + signature);
    }
  }
408497
private boolean isMethodApi(Method method)
  {
    if (_type == _api) {
      return true;
    }
    
    for (Method methodApi : _api.getMethods()) {
      if (methodApi.getName().equals(method.getName())) {
        return true;
      }
    }
    
    return false;
  }
911662
def methods_matching(methods, singleton = false)
      count = 0

      @method_list.each do |m|
        if methods.include? m.name and m.singleton == singleton then
          yield m
          count += 1
        end
      end

      return if count == methods.size || singleton

      # perhaps we need to look at attributes

      @attributes.each do |a|
        yield a if methods.include? a.name
      end
    end
442434
def _add_method_dunders(self, method):
        
        try:
            method.__module__ = self._cls.__module__
        except AttributeError:
            pass

        try:
            method.__qualname__ = ".".join(
                (self._cls.__qualname__, method.__name__)
            )
        except AttributeError:
            pass

        return method
561072
public static void validateMethodOrThrow(Method method) {
    Class<?> returnType = method.getReturnType();
    if (returnType.equals(Void.TYPE)) {
      return;
    } else if (!Publisher.class.isAssignableFrom(returnType)) {
      throw new UnsupportedOperationException("Service method return type can be Publisher only");
    }
    if (method.getParameterCount() > 1) {
      throw new UnsupportedOperationException("Service method can accept 0 or 1 parameters only");
    }
  }