This method is exposed so test classes can overload
and test the arguments without actually spawning the
compiler
341612
protected int runCommand(final CCTask task, final File workingDir, final String[] cmdline) throws BuildException {
    return CUtil.runCommand(task, workingDir, cmdline, this.newEnvironment, this.env);
  }
194610
private static Class<?>[] convertArgumentTypesToPrimitive(Class<?>[] paramTypes, Object[] arguments) {
        Class<?>[] types = new Class<?>[arguments.length];
        for (int i = 0; i < arguments.length; i++) {
            Class<?> argumentType = null;
            if (arguments[i] == null) {
                argumentType = paramTypes[i];
            } else {
                argumentType = getType(arguments[i]);
            }
            Class<?> primitiveWrapperType = PrimitiveWrapper.getPrimitiveFromWrapperType(argumentType);
            if (primitiveWrapperType == null) {
                types[i] = argumentType;
            } else {
                types[i] = primitiveWrapperType;
            }
        }
        return types;
    }
1203463
public static Optional<ExecutableElement> override(
      DeclaredType type, Types types, String methodName, TypeMirror... params) {
    return override(asElement(type), types, methodName, params);
  }
468463
function showWarning() {
    var method = showWarning.caller.name;
    if (!configurations.areTestsRunnning()) {
      console.warn('This method (' + method + ') is deprecated and its going to be removed on next versions');
    }
  }
1268478
private void tryReplaceArguments(Scope scope) {
    // Find the number of parameters that can be accessed without using `arguments`.
    Node parametersList = NodeUtil.getFunctionParameters(scope.getRootNode());
    checkState(parametersList.isParamList(), parametersList);
    int numParameters = parametersList.getChildCount();

    // Determine the highest index that is used to make an access on `arguments`. By default, assume
    // that the value is the number of parameters to the function.
    int highestIndex = getHighestIndex(numParameters - 1);
    if (highestIndex < 0) {
      return;
    }

    ImmutableSortedMap<Integer, String> argNames =
        assembleParamNames(parametersList, highestIndex + 1);
    changeMethodSignature(argNames, parametersList);
    changeBody(argNames);
  }
301385
View build() throws IOException {
        final Class<? extends T> proxyClass = generateProxyClass();
        if (proxyClass == null) {
            return null;
        }

        final Constructor<? extends T> constructor = getProxyClassConstructor(proxyClass);

        final View result;
        try {
            result = constructor.newInstance(CONSTRUCTOR_ARG_VALUES);
        } catch (InstantiationException e) {
            // Should not be thrown, generated class is not abstract.
            throw new AssertionError(e);
        } catch (IllegalAccessException e) {
            // Should not be thrown, the generated constructor is accessible.
            throw new AssertionError(e);
        } catch (InvocationTargetException e) {
            // Thrown when the base class constructor throws an exception.
            throw launderCause(e);
        }

        ((ViewProxy) result).setInterceptor(mInterceptor);
        return result;
    }
797485
public static <T> Method[] getAllMethodsExcept(Class<T> type, String methodNameToExclude, Class<?>[] argumentTypes) {
        Method[] methods = getAllMethods(type);
        List<Method> methodList = new ArrayList<Method>();
        outer:
        for (Method method : methods) {
            if (method.getName().equals(methodNameToExclude)) {
                if (argumentTypes != null && argumentTypes.length > 0) {
                    final Class<?>[] args = method.getParameterTypes();
                    if (args != null && args.length == argumentTypes.length) {
                        for (int i = 0; i < args.length; i++) {
                            if (args[i].isAssignableFrom(getOriginalUnmockedType(argumentTypes[i]))) {
                                /*
                                         * Method was not found thus it should not be
                                         * mocked. Continue to investigate the next
                                         * method.
                                         */
                                continue outer;
                            }
                        }
                    }
                } else {
                    continue;
                }
            }
            methodList.add(method);
        }
        return methodList.toArray(new Method[0]);
    }
366383
def has_args():
        '''  '''
        no_args_syntax = '@overload'
        args_syntax = no_args_syntax + '('
        args, no_args = [(-1,-1)], [(-1,-1)]
        for i, line in enumerate(Overload.traceback_lines()):
            if args_syntax in line:
                args.append((i, line.find(args_syntax)))
            if no_args_syntax in line:
                no_args.append((i, line.find(no_args_syntax)))
        args, no_args = max(args), max(no_args)
        if sum(args)+sum(no_args) == -4:
            # couldnt find invocation
            return False
        return args >= no_args
1240031
def compile_func(arg_names, statements, name='_the_func', debug=False):
    
    func_def = ast.FunctionDef(
        name=name,
        args=ast.arguments(
            args=[ast.arg(arg=n, annotation=None) for n in arg_names],
            kwonlyargs=[],
            kw_defaults=[],
            defaults=[ex_literal(None) for _ in arg_names],
        ),
        body=statements,
        decorator_list=[],
    )

    mod = ast.Module([func_def])
    ast.fix_missing_locations(mod)

    prog = compile(mod, '<generated>', 'exec')

    # Debug: show bytecode.
    if debug:
        dis.dis(prog)
        for const in prog.co_consts:
            if isinstance(const, types.CodeType):
                dis.dis(const)

    the_locals = {}
    exec(prog, {}, the_locals)
    return the_locals[name]
32309
Optional<ExecutableElement> findAccessibleNoArgumentInstanceMethod(TypeElement classElement, String methodName) {
        return ElementFilter.methodsIn(elementUtils.getAllMembers(classElement))
                .stream().filter(m -> m.getSimpleName().toString().equals(methodName) && !isPrivate(m) && !isStatic(m))
                .findFirst();
    }
163592
private void simulateMethodHandle(final InvokeDynamicInstruction instruction) {
        final List<Element> arguments = IntStream.range(0, instruction.getDynamicIdentifier().getParameters().size())
                .mapToObj(t -> runtimeStack.pop()).collect(Collectors.toList());
        Collections.reverse(arguments);

        if (!instruction.getDynamicIdentifier().isStaticMethod())
            // first parameter is `this`
            arguments.remove(0);

        // adds the transferred arguments of the bootstrap call
        runtimeStack.push(new MethodHandle(instruction.getDynamicIdentifier().getReturnType(), instruction.getIdentifier(), arguments));
    }
1239308
public static void invalidArgIf(boolean tester, String msg, Object... args) {
        if (tester) {
            throw invalidArg(msg, args);
        }
    }
1307691
private Map<StandardMethod, UnderrideLevel> findUnderriddenMethods(
      Iterable<ExecutableElement> methods) {
    Map<StandardMethod, ExecutableElement> standardMethods = new LinkedHashMap<>();
    for (ExecutableElement method : methods) {
      Optional<StandardMethod> standardMethod = maybeStandardMethod(method);
      if (standardMethod.isPresent() && isUnderride(method)) {
        standardMethods.put(standardMethod.get(), method);
      }
    }
    if (standardMethods.containsKey(StandardMethod.EQUALS)
        != standardMethods.containsKey(StandardMethod.HASH_CODE)) {
      ExecutableElement underriddenMethod = standardMethods.containsKey(StandardMethod.EQUALS)
          ? standardMethods.get(StandardMethod.EQUALS)
          : standardMethods.get(StandardMethod.HASH_CODE);
      messager.printMessage(ERROR,
          "hashCode and equals must be implemented together on FreeBuilder types",
          underriddenMethod);
    }
    ImmutableMap.Builder<StandardMethod, UnderrideLevel> result = ImmutableMap.builder();
    for (StandardMethod standardMethod : standardMethods.keySet()) {
      if (standardMethods.get(standardMethod).getModifiers().contains(Modifier.FINAL)) {
        result.put(standardMethod, UnderrideLevel.FINAL);
      } else {
        result.put(standardMethod, UnderrideLevel.OVERRIDEABLE);
      }
    }
    return result.build();
  }
276461
private static synchronized void verifyClass(Class<?>... types) {
        for (Class<?> type : types) {
            final EasyMockMethodInvocationControl invocationHandler = (EasyMockMethodInvocationControl) MockRepository.getStaticMethodInvocationControl(type);
            if (invocationHandler != null) {
                invocationHandler.verify();
            }
            EasyMockNewInvocationControl<?> newInvocationControl = (EasyMockNewInvocationControl<?>) MockRepository.getNewInstanceControl(type);
            if (newInvocationControl != null) {
                try {
                    newInvocationControl.verify();
                } catch (AssertionError e) {
                    NewInvocationControlAssertionError.throwAssertionErrorForNewSubstitutionFailure(e, type);
                }
            }
        }
    }
791693
def yield_arg_block(compiler)
      arg_index = compiler.get_method.arguments_type.get_length - 1
      setup  = Mom::MessageSetup.new( arg_index )
      mom_receive = @receiver.slot_definition(compiler)
      arg_target = [:message , :next_message , :arguments]
      args = []
      @arguments.each_with_index do |arg , index| # +1 because of type
        args << Mom::SlotLoad.new( arg_target + [index + 1] , arg.slot_definition(compiler))
      end
      setup << Mom::ArgumentTransfer.new( mom_receive , args )
      setup << Mom::BlockYield.new( arg_index )
    end
14252
@Override
    public void interceptSetupMethod(IMethodInvocation invocation) throws Throwable {
        log.fine("before " + invocation.getFeature().getFeatureMethod().getReflection().getName());
        getTestRunner().before(invocation.getTarget(), invocation.getFeature().getFeatureMethod().getReflection(),
            new InvocationExecutor(invocation));
    }
1010844
private void processComputed() {
    getMethodsWithAnnotation(component, Computed.class).forEach(method -> {
      ComputedKind kind = ComputedKind.GETTER;
      if ("void".equals(method.getReturnType().toString())) {
        kind = ComputedKind.SETTER;
      }

      String exposedMethodName = exposeExistingJavaMethodToJs(method);
      String fieldName = computedPropertyNameToFieldName(getComputedPropertyName(method));
      TypeMirror propertyType = getComputedPropertyTypeFromMethod(method);
      fieldsWithNameExposed.add(new ExposedField(fieldName, propertyType));
      optionsBuilder.addStatement(
          "options.addJavaComputed(p.$L, $T.getFieldName(this, () -> this.$L = $L), $T.$L)",
          exposedMethodName,
          VueGWTTools.class,
          fieldName,
          getFieldMarkingValueForType(propertyType),
          ComputedKind.class,
          kind
      );
    });

    addFieldsForComputedMethod(component, new HashSet<>());
  }