Multi-catch(1..*) clause will be unpacked to several normal catch clauses, so the return type is List

@param ctx the parse tree
@return a list of CatchStatement instances
544989
@Override
    public List<CatchStatement> visitCatchClause(CatchClauseContext ctx) {
        // FIXME Groovy will ignore variableModifier of parameter in the catch clause
        // In order to make the new parser behave same with the old one, we do not process variableModifier*

        return this.visitCatchType(ctx.catchType()).stream()
                .map(e -> configureAST(
                        new CatchStatement(
                                // FIXME The old parser does not set location info for the parameter of the catch clause.
                                // we could make it better
                                //this.configureAST(new Parameter(e, this.visitIdentifier(ctx.identifier())), ctx.Identifier()),

                                new Parameter(e, this.visitIdentifier(ctx.identifier())),
                                this.visitBlock(ctx.block())),
                        ctx))
                .collect(Collectors.toList());
    }
1164802
private void parseForExpr() throws TTXPathException {

        // get number of all for conditions
        final int rangeVarNo = parseSimpleForClause();
        consume("return", true);

        // parse return clause
        parseExprSingle();

        mPipeBuilder.addForExpression(rangeVarNo);

    }
577680
public Object evaluateUntilLast(Context ctx){
		
		if (attributes.length == 0)
		{
			//不可能发生，除非beetl写错了，先放在着
			throw new RuntimeException();
		}
		Result ret = this.getValue(ctx);
		Object value = ret.value;
		if (value == null)
		{
			BeetlException ex = new BeetlException(BeetlException.NULL);
			ex.pushToken(this.firstToken);
			throw ex;
		}

	
		for (int i = 0; i < attributes.length-1; i++)
		{

			VarAttribute attr = attributes[i];
			if (value == null)
			{
				
					BeetlException be = new BeetlException(BeetlException.NULL, "空指针");
					if (i == 0)
					{
						be.pushToken(this.firstToken);
					}
					else
					{
						be.pushToken(attributes[i - 1].token);
					}

					throw be;

			}

			try
			{
				value = attr.evaluate(ctx, value);
			}
			catch (BeetlException ex)
			{
				ex.pushToken(attr.token);
				throw ex;

			}
			catch (RuntimeException ex)
			{
				BeetlException be = new BeetlException(BeetlException.ATTRIBUTE_INVALID, "属性访问出错", ex);
				be.pushToken(attr.token);
				throw be;
			}

		}

		return value ;
	}
333627
final public List SetExpr() throws ParseException {
                   List ans = new ArrayList(); Selector elem;
    jj_consume_token(11);
    elem = Expression();
                              ans.add(elem);
    label_1:
    while (true) {
      switch ((jj_ntk==-1)?jj_ntk():jj_ntk) {
      case 13:
        ;
        break;
      default:
        jj_la1[14] = jj_gen;
        break label_1;
      }
      jj_consume_token(13);
      elem = Expression();
                                ans.add(elem);
    }
    jj_consume_token(12);
    {if (true) return ans;}
    throw new Error("Missing return statement in function");
  }
1220660
@Override
    public List<String> getNodeNames(CommandContext ctx, OperationRequestAddress prefix) {

        ModelControllerClient client = ctx.getModelControllerClient();
        if(client == null) {
            return Collections.emptyList();
        }

        if(prefix.isEmpty()) {
            throw new IllegalArgumentException("The prefix must end on a type but it's empty.");
        }

        if(!prefix.endsOnType()) {
            throw new IllegalArgumentException("The prefix doesn't end on a type.");
        }

        final ModelNode request;
        DefaultOperationRequestBuilder builder = new DefaultOperationRequestBuilder(prefix);
        try {
            builder.setOperationName(Util.READ_CHILDREN_NAMES);
            builder.addProperty(Util.CHILD_TYPE, prefix.getNodeType());
            builder.addProperty(Util.INCLUDE_SINGLETONS, "true");
            request = builder.buildRequest();
        } catch (OperationFormatException e1) {
            throw new IllegalStateException("Failed to build operation", e1);
        }

        List<String> result;
        try {
            ModelNode outcome = client.execute(request);
            if (!Util.isSuccess(outcome)) {
                // TODO logging... exception?
                result = Collections.emptyList();
            } else {
                result = Util.getList(outcome);
            }
        } catch (Exception e) {
            result = Collections.emptyList();
        }
        return result;
    }
187845
public List<Exclude<ExceptionClassFilter<T>>> getAllExclude()
   {
      List<Exclude<ExceptionClassFilter<T>>> list = new ArrayList<Exclude<ExceptionClassFilter<T>>>();
      List<Node> nodeList = childNode.get("exclude");
      for(Node node: nodeList)
      {
         Exclude<ExceptionClassFilter<T>>  type = new ExcludeImpl<ExceptionClassFilter<T>>(this, "exclude", childNode, node);
         list.add(type);
      }
      return list;
   }
733157
private static List<Type> fetchAllNestedTypes(MessageType type, boolean all) {
        List<Type> ret = new ArrayList<Type>();

        List<Type> nestedTypes = type.getNestedTypes();
        ret.addAll(nestedTypes);
        if (all) {
            for (Type t : nestedTypes) {
                if (t instanceof MessageType) {
                    List<Type> subNestedTypes = fetchAllNestedTypes((MessageType) t, true);
                    ret.addAll(subNestedTypes);
                }
            }
        }

        return ret;
    }
971296
public VoltTable[] run(SystemProcedureExecutionContext ctx) {
        // Choose the lowest site ID on this host to actually flip the bit
        VoltDBInterface voltdb = VoltDB.instance();
        OperationMode opMode = voltdb.getMode();

        if (ctx.isLowestSiteId()) {
            ZooKeeper zk = voltdb.getHostMessenger().getZK();
            try {
                Stat stat;
                OperationMode zkMode = null;
                Code code;
                do {
                    stat = new Stat();
                    code = Code.BADVERSION;
                    try {
                        byte [] data = zk.getData(VoltZK.operationMode, false, stat);
                        zkMode = data == null ? opMode : OperationMode.valueOf(data);
                        if (zkMode == RUNNING) {
                            break;
                        }
                        stat = zk.setData(VoltZK.operationMode, RUNNING.getBytes(), stat.getVersion());
                        code = Code.OK;
                        zkMode = RUNNING;
                        break;
                    } catch (BadVersionException ex) {
                        code = ex.code();
                    }
                } while (zkMode != RUNNING && code == Code.BADVERSION);

                m_stat = stat;
                voltdb.getHostMessenger().unpause();
                voltdb.setMode(RUNNING);
                // for snmp
                SnmpTrapSender snmp = voltdb.getSnmpTrapSender();
                if (snmp != null) {
                    snmp.resume("Cluster resumed.");
                }
            } catch (Exception e) {
                throw new RuntimeException(e);
            }
        }

        VoltTable t = new VoltTable(VoltSystemProcedure.STATUS_SCHEMA);
        t.addRow(VoltSystemProcedure.STATUS_OK);
        return new VoltTable[] {t};
    }
395047
public static Multimap<Extract, WorkUnitState> getExtractsForPredicate(
      Multimap<Extract, WorkUnitState> extractToWorkUnitStateMap, Predicate<WorkUnitState> predicate) {
    Multimap<Extract, WorkUnitState> successfulExtracts = ArrayListMultimap.create();
    for (Map.Entry<Extract, Collection<WorkUnitState>> entry : extractToWorkUnitStateMap.asMap().entrySet()) {
      if (Iterables.all(entry.getValue(), predicate)) {
        successfulExtracts.putAll(entry.getKey(), entry.getValue());
      }
    }
    return successfulExtracts;
  }
585209
public List<CommandCallback> buildCommandCallback(CommandContext ctx, ClassLoader cl) {
        List<CommandCallback> callbackList = new ArrayList<CommandCallback>();
        if (ctx != null && ctx.getData("callbacks") != null) {
            logger.debug("Callback: {}", ctx.getData("callbacks"));
            String[] callbacksArray = ((String) ctx.getData("callbacks")).split(",");
            List<String> callbacks = (List<String>) Arrays.asList(callbacksArray);
            for (String callbackName : callbacks) {
                CommandCallback handler = findCommandCallback(callbackName.trim(), cl);
                callbackList.add(handler);
            }
        }
        return callbackList;
    }
523096
def _get_ctx(self, subctx=None):
        ""
        l = []
        if self.ctx is not None:      l.append(self.ctx)
        if subctx is not None:        l.append(subctx)
        return '' if len(l) == 0 else f" ({': '.join(l)})"
306678
protected List<PMultipleBind> getMultipleTypeBindList(PType patternType,
			ILexNameToken... patternNames)
	{
		List<PMultipleBind> typeBindList = new Vector<PMultipleBind>();
		typeBindList.add(getMultipleTypeBind(patternType, patternNames));
		return typeBindList;
	}
1111200
@Override
    public ClassNode visitType(TypeContext ctx) {
        if (!asBoolean(ctx)) {
            return ClassHelper.OBJECT_TYPE;
        }

        ClassNode classNode = null;

        if (asBoolean(ctx.classOrInterfaceType())) {
            ctx.classOrInterfaceType().putNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR, ctx.getNodeMetaData(IS_INSIDE_INSTANCEOF_EXPR));
            classNode = this.visitClassOrInterfaceType(ctx.classOrInterfaceType());
        } else if (asBoolean(ctx.primitiveType())) {
            classNode = this.visitPrimitiveType(ctx.primitiveType());
        }

        if (!asBoolean(classNode)) {
            if (VOID_STR.equals(ctx.getText())) { // TODO refine error message for `void`
                throw createParsingFailedException("void is not allowed here", ctx);
            }

            throw createParsingFailedException("Unsupported type: " + ctx.getText(), ctx);
        }

        classNode.addAnnotations(this.visitAnnotationsOpt(ctx.annotationsOpt()));

        List<List<AnnotationNode>> dimList = this.visitDimsOpt(ctx.dimsOpt());
        if (asBoolean(dimList)) {
            // clear array's generics type info. Groovy's bug? array's generics type will be ignored. e.g. List<String>[]... p
            classNode.setGenericsTypes(null);
            classNode.setUsingGenerics(false);

            classNode = this.createArrayType(classNode, dimList);
        }

        return configureAST(classNode, ctx);
    }
624943
@SuppressWarnings({"unchecked", "rawtypes"}) // reflective
    public static <T> List<ConsoleAnnotator<T>> _for(T context) {
        List<ConsoleAnnotator<T>> r  = new ArrayList<>();
        for (ConsoleAnnotatorFactory f : ConsoleAnnotatorFactory.all()) {
            if (f.type().isInstance(context)) {
                ConsoleAnnotator ca = f.newInstance(context);
                if (ca!=null)
                    r.add(ca);
            }
        }
        return r;
    }
1057849
@Override
	protected List<OUT> executeOnCollections(List<IN1> input1, List<IN2> input2, RuntimeContext ctx, ExecutionConfig executionConfig) throws Exception {
		// --------------------------------------------------------------------
		// Setup
		// --------------------------------------------------------------------
		TypeInformation<IN1> inputType1 = getOperatorInfo().getFirstInputType();
		TypeInformation<IN2> inputType2 = getOperatorInfo().getSecondInputType();

		int[] inputKeys1 = getKeyColumns(0);
		int[] inputKeys2 = getKeyColumns(1);

		boolean[] inputSortDirections1 = new boolean[inputKeys1.length];
		boolean[] inputSortDirections2 = new boolean[inputKeys2.length];

		Arrays.fill(inputSortDirections1, true);
		Arrays.fill(inputSortDirections2, true);

		final TypeSerializer<IN1> inputSerializer1 = inputType1.createSerializer(executionConfig);
		final TypeSerializer<IN2> inputSerializer2 = inputType2.createSerializer(executionConfig);

		final TypeComparator<IN1> inputComparator1 = getTypeComparator(executionConfig, inputType1, inputKeys1, inputSortDirections1);
		final TypeComparator<IN2> inputComparator2 = getTypeComparator(executionConfig, inputType2, inputKeys2, inputSortDirections2);

		SimpleListIterable<IN1> iterator1 = new SimpleListIterable<IN1>(input1, inputComparator1, inputSerializer1);
		SimpleListIterable<IN2> iterator2 = new SimpleListIterable<IN2>(input2, inputComparator2, inputSerializer2);

		// --------------------------------------------------------------------
		// Run UDF
		// --------------------------------------------------------------------
		CoGroupFunction<IN1, IN2, OUT> function = userFunction.getUserCodeObject();

		FunctionUtils.setFunctionRuntimeContext(function, ctx);
		FunctionUtils.openFunction(function, parameters);

		List<OUT> result = new ArrayList<OUT>();
		Collector<OUT> resultCollector = new CopyingListCollector<OUT>(result, getOperatorInfo().getOutputType().createSerializer(executionConfig));

		function.coGroup(iterator1, iterator2, resultCollector);

		FunctionUtils.closeFunction(function);

		return result;
	}
679638
public VoltTable[] run(SystemProcedureExecutionContext ctx,
                           String selector) throws VoltAbortException
    {
        VoltDB.crashLocalVoltDB("This should never be called.", false, null);
        return null;
    }
1204497
public void initContext(Context ctx)
	{
		// 模板静态文本部分
		ctx.staticTextArray = staticTextArray;
		// 模板各种缓存存放地

		// 临时标量所在空间
		ctx.tempVarStartIndex = tempVarStartIndex;
		// 分配变量空间,最后一个为模板的返回值
		ctx.vars = new Object[varIndexSize + 1];
		ctx.vars[varIndexSize] = Context.NOT_EXIST_OBJECT;

		// 将全局变量放到数组
		putGlobaToArray(ctx);

	}