validates method signature as described at {@link Pact}
11177
private boolean conformsToSignature(Method m) {
        Pact pact = m.getAnnotation(Pact.class);
        boolean conforms =
            pact != null
            && MessagePact.class.isAssignableFrom(m.getReturnType())
            && m.getParameterTypes().length == 1
            && m.getParameterTypes()[0].isAssignableFrom(MessagePactBuilder.class);

        if (!conforms && pact != null) {
            throw new UnsupportedOperationException("Method " + m.getName() +
                " does not conform required method signature 'public MessagePact xxx(MessagePactBuilder builder)'");
        }
        return conforms;
    }
252054
private void validateMethod(Method method, CallbackType callbackType) {
    int modifiers = method.getModifiers();
    if (!Modifier.isPublic(modifiers)) {
      String message = String.format("Method %s in class %s must be public", method.getName(),
          method.getDeclaringClass().getName());
      throw new EntityManagerException(message);
    }
    if (Modifier.isStatic(modifiers)) {
      String message = String.format("Method %s in class %s must not be static", method.getName(),
          method.getDeclaringClass().getName());
      throw new EntityManagerException(message);
    }
    if (Modifier.isAbstract(modifiers)) {
      String message = String.format("Method %s in class %s must not be abstract", method.getName(),
          method.getDeclaringClass().getName());
      throw new EntityManagerException(message);
    }
    Class<?>[] parameters = method.getParameterTypes();
    if (parameters.length != 0) {
      String pattern = "Method %s in class %s is not a valid %s callback method. Method must not "
          + "have any parameters. ";
      String message = String.format(pattern, method.getName(),
          method.getDeclaringClass().getName(), callbackType);
      throw new EntityManagerException(message);
    }
    if (method.getReturnType() != void.class) {
      String message = String.format("Method %s in class %s must have a return type of %s",
          method.getName(), method.getDeclaringClass().getName(), void.class.getName());
      throw new EntityManagerException(message);
    }
  }
848810
private void validateClassDeclaration(Node n, boolean isAmbient) {
    validateClassHelper(n, isAmbient);
    validateName(n.getFirstChild());
  }
107192
private String createMethodSignature(Method method)
   {
      StringBuilder sb = new StringBuilder();
      sb.append("(");
      for (Class<?> type : method.getParameterTypes())
      {
         sb.append(getTypeString(type));
      }
      sb.append(")");
      Class<?> type = method.getReturnType();
      if (type.getName().equals("void"))
      {
         sb.append("V");
      }
      else
      {
         sb.append(getTypeString(type));
      }
      return sb.toString();
   }
1028669
private boolean verifyProvide(Node methodName, Node arg) {
    if (!verifyLastArgumentIsString(methodName, arg)) {
      return false;
    }

    if (!NodeUtil.isValidQualifiedName(
        compiler.getOptions().getLanguageIn().toFeatureSet(), arg.getString())) {
      compiler.report(
          JSError.make(
              arg,
              INVALID_PROVIDE_ERROR,
              arg.getString(),
              compiler.getOptions().getLanguageIn().toString()));
      return false;
    }

    return true;
  }
849035
public static <T> void checkAbstractMethods(Set<Type> decoratedTypes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {

        if (decoratedTypes == null) {
            decoratedTypes = new HashSet<Type>(type.getInterfaceClosure());
            decoratedTypes.remove(Serializable.class);
        }

        Set<MethodSignature> signatures = new HashSet<MethodSignature>();

        for (Type decoratedType : decoratedTypes) {
            for (EnhancedAnnotatedMethod<?, ?> method : ClassTransformer.instance(beanManager)
                    .getEnhancedAnnotatedType(Reflections.getRawType(decoratedType), beanManager.getId()).getEnhancedMethods()) {
                signatures.add(method.getSignature());
            }
        }

        for (EnhancedAnnotatedMethod<?, ?> method : type.getEnhancedMethods()) {
            if (Reflections.isAbstract(((AnnotatedMethod<?>) method).getJavaMember())) {
                MethodSignature methodSignature = method.getSignature();
                if (!signatures.contains(methodSignature)) {
                    throw BeanLogger.LOG.abstractMethodMustMatchDecoratedType(method, Formats.formatAsStackTraceElement(method.getJavaMember()));
                }
            }
        }
    }
407881
private static String getMethodSignature(ExecutableElement executableElement) throws IOException
    {
        Result sb = new Result();
        formalTypeParameters(sb, executableElement.getTypeParameters());
        sb.append('(');
        for (VariableElement param : executableElement.getParameters())
        {
            typeSignature(sb, param.asType());
        }
        sb.append(')');
        // ReturnType:
        //    TypeSignature
        //    VoidDescriptor
        TypeMirror returnType = executableElement.getReturnType();
        if (TypeKind.VOID.equals(returnType.getKind()))
        {
            sb.append('V');
        }
        else
        {
            typeSignature(sb, returnType);
        }

        for (TypeMirror param : executableElement.getThrownTypes())
        {
            getThrowsSignature(sb, param);
        }
        return sb.toString();
    }
654912
static void validateExceptions(
      Binder binder,
      Iterable<TypeLiteral<?>> actualExceptionTypes,
      Iterable<Class<? extends Throwable>> expectedExceptionTypes,
      Class<? extends CheckedProvider> checkedProvider) {
    // Validate the exceptions in the method match the exceptions
    // in the CheckedProvider.
    for (TypeLiteral<?> exType : actualExceptionTypes) {
      Class<?> exActual = exType.getRawType();
      // Ignore runtime exceptions & errors.
      if (RuntimeException.class.isAssignableFrom(exActual)
          || Error.class.isAssignableFrom(exActual)) {
        continue;
      }

      boolean notAssignable = true;
      for (Class<? extends Throwable> exExpected : expectedExceptionTypes) {
        if (exExpected.isAssignableFrom(exActual)) {
          notAssignable = false;
          break;
        }
      }
      if (notAssignable) {
        binder.addError(
            "%s is not compatible with the exceptions (%s) declared in "
                + "the CheckedProvider interface (%s)",
            exActual, expectedExceptionTypes, checkedProvider);
      }
    }
  }
999528
public void buildSignature(XMLNode node, Content methodDocTree) {
        methodDocTree.addContent(writer.getSignature(currentMethod));
    }
1194748
private void validate() throws MojoExecutionException {
		if ((file == null && libId == null) || (file != null && libId != null)) {
			getLog()
					.warn(
							"You specified <file> and <libId>.  The <libId> always wins.");
		}

		// check that COM target exists
		if (file != null && !file.exists()) {
			getLog().warn("Can't find file: " + file);
			throw new MojoExecutionException(
					"The native COM target file couldn't be found: " + file);
		}
	}
1043799
protected void writeMethodSignature(Writer out, int indent, MethodForConnection method) throws IOException
   {
      writeWithIndent(out, indent, "/**\n");
      writeWithIndent(out, indent, " * " + method.getMethodName());
      writeEol(out);
      for (MethodParam param : method.getParams())
      {
         writeIndent(out, indent);
         out.write(" * @param " + param.getName() + " " + param.getName());
         writeEol(out);
      }
      if (!method.getReturnType().equals("void"))
      {
         writeIndent(out, indent);
         out.write(" * @return " + method.getReturnType());
         writeEol(out);
      }
      for (String ex : method.getExceptionType())
      {
         writeIndent(out, indent);
         out.write(" * @throws " + ex + " " + ex);
         writeEol(out);
      }

      writeWithIndent(out, indent, " */\n");

      writeWithIndent(out, indent, "public " + method.getReturnType() + " " +
            method.getMethodName() + "(");
      int paramSize = method.getParams().size();
      for (int i = 0; i < paramSize; i++)
      {
         MethodParam param = method.getParams().get(i);
         out.write(param.getType());
         out.write(" ");
         out.write(param.getName());
         if (i + 1 < paramSize)
            out.write(", ");
      }
      out.write(")");
      int exceptionSize = method.getExceptionType().size();
      for (int i = 0; i < exceptionSize; i++)
      {
         if (i == 0)
            out.write(" throws ");
         String ex = method.getExceptionType().get(i);
         out.write(ex);
         if (i + 1 < exceptionSize)
            out.write(", ");
      }
   }
284796
@Override
    public boolean validateAction(String action) {
        boolean result = false;
        if (action.equals(MessagingSecurityConstants.OPERATION_TYPE_SEND) ||
            action.equals(MessagingSecurityConstants.OPERATION_TYPE_RECEIVE)) {
            result = true;
        }
        return result;
    }
101586
protected void writeSimpleMethodSignature(Writer out, int indent, String javadoc, String signature)
         throws IOException
   {
      writeWithIndent(out, indent, "/**\n");
      writeIndent(out, indent);
      out.write(javadoc);
      writeEol(out);
      writeWithIndent(out, indent, " */\n");

      writeIndent(out, indent);
      out.write(signature);
   }
552535
private void validateContract(final Contract contract, Connection connection)
            throws RegistrationException {
        QueryRunner run = new QueryRunner();
        try {
            Api api = run.query(connection, "SELECT bean FROM gw_apis WHERE org_id = ? AND id = ? AND version = ?", //$NON-NLS-1$
                    Handlers.API_HANDLER, contract.getApiOrgId(), contract.getApiId(), contract.getApiVersion());
            if (api == null) {
                String apiId = contract.getApiId();
                String orgId = contract.getApiOrgId();
                throw new ApiNotFoundException(Messages.i18n.format("JdbcRegistry.ApiNotFoundInOrg", apiId, orgId));  //$NON-NLS-1$
            }
        } catch (SQLException e) {
            throw new RegistrationException(Messages.i18n.format("JdbcRegistry.ErrorValidatingApp"), e); //$NON-NLS-1$
        }
    }
474713
public String createMethodTypeSignature(ExecutableElement method) {
    if (!hasGenericSignature(method)) {
      return null;
    }
    StringBuilder sb = new StringBuilder();
    genMethodTypeSignature(method, sb);
    return sb.toString();
  }
826147
public static function checkMethodSignatureMustOmitReturnType(
        MethodStorage $method_storage,
        CodeLocation $code_location
    ) {
        if ($method_storage->signature_return_type === null) {
            return null;
        }

        $cased_method_name = $method_storage->cased_name;
        $methodsOfInterest = ['__clone', '__construct', '__destruct'];
        if (in_array($cased_method_name, $methodsOfInterest)) {
            if (IssueBuffer::accepts(
                new MethodSignatureMustOmitReturnType(
                    'Method ' . $cased_method_name . ' must not declare a return type',
                    $code_location
                )
            )) {
                return false;
            }
        }

        return null;
    }
1074757
protected static String getMethodSignature(Method method) {
    return getMethodSignature(method.getName(), method.getParameterTypes(), method.getReturnType());
  }