/*
Utility methods for parameter InjectionPoints
344361
public <X> List<ParameterInjectionPoint<?, X>> getParameterInjectionPoints(EnhancedAnnotatedCallable<?, X, ?> callable,
            Bean<?> declaringBean, Class<?> declaringComponentClass, BeanManagerImpl manager, boolean observerOrDisposer) {
        List<ParameterInjectionPoint<?, X>> parameters = new ArrayList<ParameterInjectionPoint<?, X>>();

        /*
         * bean that the injection point belongs to this is null for observer and disposer methods
         */
        Bean<?> bean = null;
        if (!observerOrDisposer) {
            bean = declaringBean;
        }

        for (EnhancedAnnotatedParameter<?, X> parameter : callable.getEnhancedParameters()) {
            if (isSpecialParameter(parameter)) {
                parameters.add(SpecialParameterInjectionPoint.of(parameter, bean, declaringBean.getBeanClass(), manager));
            } else {
                parameters.add(createParameterInjectionPoint(parameter, bean, declaringComponentClass, manager));
            }
        }
        return ImmutableList.copyOf(parameters);
    }
1277666
@Override
    Map<String, Object> constructParameterRequestArgs() {
        Map<String, Object> args = new HashMap<String, Object>();

        args.put(KeenQueryConstants.PROPERTY_NAME, propertyName);
        args.put(KeenQueryConstants.OPERATOR, operator.toString());
        args.put(KeenQueryConstants.PROPERTY_VALUE, propertyValue);

        return args;
    }
260402
function executeCommand(parameters) {
    if (parameters.colors === undefined) { parameters.colors = plugin.myrmex.getConfig('colors'); }

    return plugin.findEndpoint(parameters.resourcePath, parameters.httpMethod)
    .then(endpoint => {
      const jsonSpec = endpoint.generateSpec(parameters.specVersion);
      let spec = JSON.stringify(jsonSpec, null, 2);
      if (parameters.colors) {
        spec = icli.highlight(spec, { json: true });
      }
      icli.print(spec);
      return Promise.resolve(jsonSpec);
    });
  }
46248
private void injectArguments(final List<Element> arguments, final MethodIdentifier identifier) {
        final boolean staticMethod = identifier.isStaticMethod();
        final int startIndex = staticMethod ? 0 : 1;
        final int endIndex = staticMethod ? arguments.size() - 1 : arguments.size();

        IntStream.rangeClosed(startIndex, endIndex).forEach(i -> localVariables.put(i, arguments.get(staticMethod ? i : i - 1)));
    }
302034
private Object getParameterValue(ControlBeanContext context, Method method, Object[] args) {
        Object value;
        try {
            value = context.getParameterValue(method, _nameQualifiers[0], args);
        } catch (IllegalArgumentException iae) {
            throw new ControlException("Invalid argument name in SQL statement: " + _nameQualifiers[0], iae);
        }

        for (int i = 1; i < _nameQualifiers.length; i++) {
            // handle maps, properties, and fields...
            value = extractValue(value, _nameQualifiers[i - 1], _nameQualifiers[i]);
        }
        return value;
    }
590613
function getJavaScriptParameterList(parameters, returnType) {
    var result = []

    result.push("<table>")
    parameters.forEach(function(parameter){
        result.push("<tr>")
        result.push("<td>" + Indent2 + "<span class='parameterName'>" + parameter.name + ",</span>")
        result.push("<td><span class='tdIndent'>// " + getIdlType(parameter.type) + "</span>")
    })

    result.push("<tr>")
    result.push("<td>" + Indent2 + "<span class='parameterName'>callback</span>")
    result.push("<td><span class='tdIndent'>// function(error, " + getIdlType(returnType) + ")</span>")

    result.push("</table>")
    return result.join("\n") + Indent
}
620205
static StringMap injectContextData(@Nullable List<Property> properties, StringMap reusable) {
    if (properties == null || properties.isEmpty()) {
      return getContextAndTracingData();
    }
    // Context data has precedence over configuration properties.
    putProperties(properties, reusable);
    // TODO(sebright): The following line can be optimized. See
    //     https://github.com/census-instrumentation/opencensus-java/pull/1422/files#r216425494.
    reusable.putAll(getContextAndTracingData());
    return reusable;
  }
865064
@Override
  public StringMap injectContextData(@Nullable List<Property> properties, StringMap reusable) {
    return ContextDataUtils.injectContextData(properties, reusable);
  }
1210544
@Override
    public <T> List<InjectionPoint> getJEEComponentInjectionPoints(Class<T> clazz) throws CDIException {
        InjectionTarget<T> injectionTarget = getJEEComponentInjectionTarget(clazz);
        List<InjectionPoint> injectionPoints = null;

        if (injectionTarget != null) {
            injectionPoints = new ArrayList<InjectionPoint>();
            Set<InjectionPoint> jeeClassInjectionPoints = injectionTarget.getInjectionPoints();
            if (jeeClassInjectionPoints != null && jeeClassInjectionPoints.size() > 0) {
                injectionPoints.addAll(jeeClassInjectionPoints);
            }

            String mainClassName = archive.getClientModuleMainClass();

            if (mainClassName != null) {
                if (clazz.getName().equals(mainClassName)) {
                    List<InjectionPoint> staticInjectionPoints = this.staticInjectionPoints.get(clazz);
                    if (staticInjectionPoints != null) {
                        injectionPoints.addAll(staticInjectionPoints);
                    }
                }
            }
        }

        return injectionPoints;
    }
707212
function (id, obj, deps) {
            var normId = normalizeServiceName(id);
            injectedMap[normId] = obj;

            if (deps) {
                dependencyMap[normId] = normalizeServiceNames(deps);
            }
        }
936024
function getContextuallyTypedParameterType(parameter) {
            var func = parameter.parent;
            if (isContextSensitiveFunctionOrObjectLiteralMethod(func)) {
                var iife = ts.getImmediatelyInvokedFunctionExpression(func);
                if (iife) {
                    var indexOfParameter = ts.indexOf(func.parameters, parameter);
                    if (iife.arguments && indexOfParameter < iife.arguments.length) {
                        if (parameter.dotDotDotToken) {
                            var restTypes = [];
                            for (var i = indexOfParameter; i < iife.arguments.length; i++) {
                                restTypes.push(getTypeOfExpression(iife.arguments[i]));
                            }
                            return createArrayType(getUnionType(restTypes));
                        }
                        var links = getNodeLinks(iife);
                        var cached = links.resolvedSignature;
                        links.resolvedSignature = anySignature;
                        var type = checkExpression(iife.arguments[indexOfParameter]);
                        links.resolvedSignature = cached;
                        return type;
                    }
                }
                var contextualSignature = getContextualSignature(func);
                if (contextualSignature) {
                    var funcHasRestParameters = ts.hasRestParameter(func);
                    var len = func.parameters.length - (funcHasRestParameters ? 1 : 0);
                    var indexOfParameter = ts.indexOf(func.parameters, parameter);
                    if (indexOfParameter < len) {
                        return getTypeAtPosition(contextualSignature, indexOfParameter);
                    }
                    // If last parameter is contextually rest parameter get its type
                    if (funcHasRestParameters &&
                        indexOfParameter === (func.parameters.length - 1) &&
                        isRestParameterIndex(contextualSignature, func.parameters.length - 1)) {
                        return getTypeOfSymbol(ts.lastOrUndefined(contextualSignature.parameters));
                    }
                }
            }
            return undefined;
        }
1101151
public static List<EntryPointParameter> getInternalEntryPointParametersRecursively(Class<?> parameterType, Set<Class<?>> typeBlacklist, Set<String> nameBlacklist, int maxDeepLevel) {
		return getInternalEntryPointParametersRecursively(parameterType, typeBlacklist, nameBlacklist, null, 1, maxDeepLevel);
	}
723222
private void setParameters(Map<Parameter, Object> parameterMap, Query q)
    {
        if (parameterMap != null && !parameterMap.isEmpty())
        {
            for (Parameter parameter : parameterMap.keySet())
            {
                Object paramObject = parameterMap.get(parameter);
                if (parameter.getName() != null)
                {
                    if (paramObject instanceof Collection)
                    {
                        q.setParameterList(parameter.getName(), (Collection) paramObject);
                    }
                    else
                    {
                        q.setParameter(parameter.getName(), paramObject);
                    }
                }
                else if (parameter.getPosition() != null)
                {
                    if (paramObject instanceof Collection)
                    {
                        q.setParameterList(Integer.toString(parameter.getPosition()), (Collection) paramObject);
                    }
                    else
                    {
                        q.setParameter(Integer.toString(parameter.getPosition()), paramObject);
                    }
                }
            }
        }
    }
1370557
public void injectParams(JsonObject queryJson) {
        if (this.serverSideTimeout != null) {
            queryJson.put("timeout", this.serverSideTimeout);
        }

        if (this.clientContextId != null) {
            queryJson.put("client_context_id", this.clientContextId);
        }

        if (pretty) {
            queryJson.put("pretty", true);
        }

        if (deferred) {
            queryJson.put("mode", "async");
        }

        if (this.rawParams != null) {
            for (Map.Entry<String, Object> entry : rawParams.entrySet()) {
                queryJson.put(entry.getKey(), entry.getValue());
            }
        }
    }
416155
public static void injectMethod(JavacNode typeNode, JCMethodDecl method, List<Type> paramTypes, Type returnType) {
		JCClassDecl type = (JCClassDecl) typeNode.get();
		
		if (method.getName().contentEquals("<init>")) {
			//Scan for default constructor, and remove it.
			int idx = 0;
			for (JCTree def : type.defs) {
				if (def instanceof JCMethodDecl) {
					if ((((JCMethodDecl) def).mods.flags & Flags.GENERATEDCONSTR) != 0) {
						JavacNode tossMe = typeNode.getNodeFor(def);
						if (tossMe != null) tossMe.up().removeChild(tossMe);
						type.defs = addAllButOne(type.defs, idx);
						ClassSymbolMembersField.remove(type.sym, ((JCMethodDecl) def).sym);
						break;
					}
				}
				idx++;
			}
		}
		
		addSuppressWarningsAll(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext());
		addGenerated(method.mods, typeNode, method.pos, getGeneratedBy(method), typeNode.getContext());
		type.defs = type.defs.append(method);
		
		fixMethodMirror(typeNode.getContext(), typeNode.getElement(), method.getModifiers().flags, method.getName(), paramTypes, returnType);
		
		typeNode.add(method, Kind.METHOD);
	}
167955
function _injectVaribles(value) {
    return value.replace(/\{([\w]+)\}/g, function(exp, varibleName, index, val) {
        return _options[varibleName];
    });
}
1308635
@Override
   public void onEndpointInstantiated(final Endpoint endpoint, final Invocation invocation)
   {
      final Object _targetBean = this.getTargetBean(invocation);
      // TODO: refactor injection to AS IL
      final Reference reference = endpoint.getInstanceProvider().getInstance(_targetBean.getClass().getName());
      final Object targetBean = reference.getValue();

      InjectionHelper.injectWebServiceContext(targetBean, ThreadLocalAwareWebServiceContext.getInstance());

      if (!reference.isInitialized())
      {
         InjectionHelper.callPostConstructMethod(targetBean);
         reference.setInitialized();
      }

      endpoint.addAttachment(PreDestroyHolder.class, new PreDestroyHolder(targetBean));
   }