Build a parameter program from the method's reflected parameter.
509808
private static WebParam buildParam(WebBuilder builder, Parameter param)
  {
    if (RequestWeb.class.equals(param.getType())) {
      return new WebParamRequest();
    }
    else if (Result.class.equals(param.getType())) {
      return new WebParamResult();
    }
    else if (param.isAnnotationPresent(Query.class)) {
      Query query = param.getAnnotation(Query.class);

      Convert<String,?> convert
         = builder.converter(String.class, param.getType());

      return new WebParamQuery(query.value(), convert);
    }
    else if (param.isAnnotationPresent(Path.class)) {
      Path path = param.getAnnotation(Path.class);

      Convert<String,?> convert
         = builder.converter(String.class, param.getType());

      return new WebParamPath(path.value(), convert);
    }
    else if (param.isAnnotationPresent(Header.class)) {
      Header header = param.getAnnotation(Header.class);

      Convert<String,?> convert
         = builder.converter(String.class, param.getType());

      return new WebParamHeader(header.value(), convert);
    }
    else if (param.isAnnotationPresent(Cookie.class)) {
      Cookie cookie = param.getAnnotation(Cookie.class);

      Convert<String,?> convert
         = builder.converter(String.class, param.getType());

      return new WebParamCookie(cookie.value(), convert);
    }
    else if (param.isAnnotationPresent(Body.class)) {
      Body body = param.getAnnotation(Body.class);

      if (Part.class.equals(param.getType())) {
        return new WebParamBodyNamedPart<>(body.value());
      }
      else if (body.value().isEmpty()) {
        return new WebParamBody<>(param.getType());
      }
      else {
        Convert<String,?> convert
           = builder.converter(String.class, param.getType());

        return new WebParamBodyParam<>(body.value(), convert);

      }

    }
    else if (param.getType().isAnnotationPresent(Service.class)) {
      Service service = param.getType().getAnnotation(Service.class);
      String address = service.value();

      if (address.startsWith("session:")) {
        return new WebParamSession(param.getType());
      }
    }

    throw new UnsupportedOperationException(L.l("Unknown param type: " + param));
  }
236829
protected function buildParameter(ReflectionParameter $reflectionParameter) : Node\Param
    {
        $parameterBuilder = new Param($reflectionParameter->getName());

        if ($reflectionParameter->isPassedByReference()) {
            $parameterBuilder->makeByRef();
        }

        if ($reflectionParameter->isArray()) {
            $parameterBuilder->setTypeHint('array');
        }

        if (method_exists($reflectionParameter, 'isCallable') && $reflectionParameter->isCallable()) {
            $parameterBuilder->setTypeHint('callable');
        }

        if ($type = $reflectionParameter->getClass()) {
            $parameterBuilder->setTypeHint($type->getName());
        }

        if ($reflectionParameter->isDefaultValueAvailable()) {
            if (method_exists($reflectionParameter, 'isDefaultValueConstant')
                && $reflectionParameter->isDefaultValueConstant()
            ) {
                $parameterBuilder->setDefault(
                    new ConstFetch(
                        new Name($reflectionParameter->getDefaultValueConstantName())
                    )
                );
            } else {
                $parameterBuilder->setDefault($reflectionParameter->getDefaultValue());
            }
        }

        return $parameterBuilder->getNode();
    }
186690
public Parameter<T> build() {
    if (this.name == null) {
      throw new IllegalArgumentException("Name is missing.");
    }
    if (this.type == null) {
      throw new IllegalArgumentException("Type is missing.");
    }
    if (this.applicationId == null) {
      throw new IllegalArgumentException("Application id is missing.");
    }
    return new Parameter<T>(
        this.name,
        this.type,
        this.applicationId,
        this.defaultOsgiConfigProperty,
        this.defaultValue,
        ImmutableValueMap.copyOf(this.properties));
  }
863240
def _add_parameter(self, parameter):
        '''
        
        '''
        if isinstance(parameter, MethodParameter):
            # create a bound instance of the MethodParameter
            parameter = parameter.bind(alloy=self)
        self._parameters[parameter.name] = parameter
        for alias in parameter.aliases:
            self._aliases[alias] = parameter
1035720
def construct_parameter_pattern(parameter):
    
    name = parameter['name']
    type = parameter['type']

    repeated = '[^/]'

    if type == 'integer':
        repeated = '\d'

    return "(?P<{name}>{repeated}+)".format(name=name, repeated=repeated)
1143576
public static <T> T invokeMethod(final Object target, final String name, final Class<?>[] parameterTypes, final Object[] parameterValues) {
		Method method = getAccessibleMethod(target, name, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + name + "] on target [" + target + ']');
		}

		try {
			return (T) method.invoke(target, parameterValues);
		} catch (ReflectiveOperationException e) {
			throw new ReflectionRuntimeException(e);
		}
	}
1152128
public static <T extends MethodDescription> ElementMatcher.Junction<T> takesArguments(int length) {
        return new MethodParametersMatcher<T>(new CollectionSizeMatcher<ParameterList<?>>(length));
    }
1154259
private CodeBlock constructorCallCode( ClassName className, ImmutableList<? extends JParameterizedMapper> parameters ) {
        CodeBlock.Builder builder = CodeBlock.builder();
        builder.add( "new $T", className );
        return methodCallCodeWithJParameterizedMapperParameters( builder, parameters );
    }
693477
public static <S> TypeInformation<S> fromMethodParameter(Method method, int index) {

        LettuceAssert.notNull(method, "Method must not be null!");
        return new ClassTypeInformation(method.getDeclaringClass()).createInfo(method.getGenericParameterTypes()[index]);
    }
165782
private void processMethodCall() {
        if ("invoke".equals(getNameConstantOperand()) && "java/lang/reflect/Method".equals(getClassConstantOperand())) {
            return;
        }
        String sig = getSigConstantOperand();
        List<String> args = SignatureUtils.getParameterSignatures(sig);
        if (stack.getStackDepth() >= args.size()) {
            for (int i = 0; i < args.size(); i++) {
                String argSig = args.get(i);
                if (argSig.startsWith(Values.SIG_ARRAY_PREFIX)) {
                    OpcodeStack.Item itm = stack.getStackItem(args.size() - i - 1);
                    int arrayReg = itm.getRegisterNumber();
                    WrapperInfo wi = wrappers.get(Integer.valueOf(arrayReg));
                    if (wi != null) {
                        wi.wasArg = true;
                    }
                }
            }
        }
    }
604851
def execute(self, parameters: dict = None):
        """"""
        try:
            parameters = {} if parameters is None else parameters
            return eval(self._compiled_code, parameters, {})
        except:
            info = exc_info()
            error = CompilationError('Error occurred in expression execution', self.code)
            error.add_cause(info[1])
            raise error from info[1]
1190927
private MethodHandle buildProcessor(FunctionManager functionManager, Type fromType, Type toType, boolean isKey)
    {
        MethodHandle getter = nativeValueGetter(fromType);

        // Adapt cast that takes ([ConnectorSession,] ?) to one that takes (?, ConnectorSession), where ? is the return type of getter.
        ScalarFunctionImplementation castImplementation = functionManager.getScalarFunctionImplementation(functionManager.lookupCast(CastType.CAST, fromType.getTypeSignature(), toType.getTypeSignature()));
        MethodHandle cast = castImplementation.getMethodHandle();
        if (cast.type().parameterArray()[0] != ConnectorSession.class) {
            cast = MethodHandles.dropArguments(cast, 0, ConnectorSession.class);
        }
        cast = permuteArguments(cast, methodType(cast.type().returnType(), cast.type().parameterArray()[1], cast.type().parameterArray()[0]), 1, 0);
        MethodHandle target = compose(cast, getter);

        // If the key cast function is nullable, check the result is not null.
        if (isKey && castImplementation.isNullable()) {
            target = compose(nullChecker(target.type().returnType()), target);
        }

        MethodHandle writer = nativeValueWriter(toType);
        writer = permuteArguments(writer, methodType(void.class, writer.type().parameterArray()[1], writer.type().parameterArray()[0]), 1, 0);

        return compose(writer, target.asType(methodType(unwrap(target.type().returnType()), target.type().parameterArray())));
    }
626064
public static MethodParameter createMethodParameter(Parameter parameter) {
		Parameter[] parameters = parameter.getDeclaringExecutable().getParameters();
		for (int i = 0; i < parameters.length; i++) {
			if (parameters[i].equals(parameter)) {
				return createMethodParameter(parameter.getDeclaringExecutable(), i);
			}
		}
		throw new AssertionError("Can't happen");
	}
827976
public static List<ActionParameter> buildActionParameterList(Method method) {
        List<ActionParameter> arguments = new ArrayList<>();
        Annotation[][] annotations = method.getParameterAnnotations();
        Class<?>[] typesOfParameters = method.getParameterTypes();
        Type[] genericTypeOfParameters = method.getGenericParameterTypes();
        for (int i = 0; i < annotations.length; i++) {
            arguments.add(ActionParameter.from(method, annotations[i], typesOfParameters[i],
                    genericTypeOfParameters[i]));
        }
        return arguments;
    }
684073
def create_inline(project, resource, offset):
    
    pyname = _get_pyname(project, resource, offset)
    message = 'Inline refactoring should be performed on ' \
              'a method, local variable or parameter.'
    if pyname is None:
        raise rope.base.exceptions.RefactoringError(message)
    if isinstance(pyname, pynames.ImportedName):
        pyname = pyname._get_imported_pyname()
    if isinstance(pyname, pynames.AssignedName):
        return InlineVariable(project, resource, offset)
    if isinstance(pyname, pynames.ParameterName):
        return InlineParameter(project, resource, offset)
    if isinstance(pyname.get_object(), pyobjects.PyFunction):
        return InlineMethod(project, resource, offset)
    else:
        raise rope.base.exceptions.RefactoringError(message)
1044310
private static Class<?> parameterizedReturnType(Method method) {
    Type type = method.getGenericReturnType();
    if (type instanceof ParameterizedType) {
      try {
        return Class.forName(
            (((ParameterizedType) type).getActualTypeArguments()[0]).getTypeName());
      } catch (ClassNotFoundException e) {
        return Object.class;
      }
    } else {
      return Object.class;
    }
  }
1221213
protected function buildMethod(ReflectionMethod $method)
    {
        $argString = "";
        $paramString = "";
        $returnString = "";
        foreach ($method->getParameters() as $value) {
            $argString .= "\${$value->getName()}, ";
            $paramString .= $this->getParamString($value);
        }

        $methodReturn = $method->getReturnType();
        if (!is_null($methodReturn)) {
            if (!$methodReturn->isBuiltin()) {
                $this->useList[] = sprintf("%s", $methodReturn);
                $arr = explode("\\", $methodReturn);
                $methodReturn = array_pop($arr);
            }

            $returnString = ": {$methodReturn}";
        }

        $argString = trim($argString, ", ");
        $paramString = trim($paramString, ", ");
        $replaces = array(
            $method->getDocComment(),
            $method->getName(),
            $paramString,
            $returnString,
            $argString
        );
        return str_replace(self::METHOD_TPL_SEARCHES, $replaces, $this->template->getMethodTemplate());
    }