循环调用starter的depose方法,如果有的话,然后销毁ioc容器
191775
public void depose() throws Exception {
        for (Object object : starters) {
            if (object instanceof LifeCycle)
                ((LifeCycle) object).depose();
        }
        if (ioc != null)
            ioc.depose();
    }
385022
public void contextInitialized(ServletContextEvent sce) {
        applicationContext = new XmlWebApplicationContext();
        applicationContext.setServletContext(sce.getServletContext());
        applicationContext.setConfigLocation(configLocation);
        applicationContext.refresh();
        appContext.getComboIocLoader().addLoader(new SpringIocLoader2(applicationContext, getSpringBeanNames().toArray(new String[0])));
        sce.getServletContext().setAttribute("spring." + selfName, applicationContext);
        // 登记所有标注了@AsSpringBean的对象到spring ioc
        Ioc ioc = appContext.getIoc();
        for (String name : ioc.getNamesByAnnotation(AsSpringBean.class)) {
            applicationContext.getBeanFactory().registerSingleton(name, ioc.get(null, name));
        }
    }
841652
@Override
	public boolean permit(String resourceId, Class c, Object target, String method) {
		if (c.isArray()) {
			// 允许调用，但实际上会在在其后调用中报错。不归此处管理
			return true;
		}
		String name = c.getName();
		String className = null;
		String pkgName = null;
		int i = name.lastIndexOf('.');
		if (i != -1) {
			pkgName = name.substring(0, i);
			className = name.substring(i + 1);

		} else {
			// 无包名，允许调用
			return true;
		}

		if (pkgName.startsWith("java.lang")) {
			if (className.equals("Runtime") || className.equals("Process") || className.equals("ProcessBuilder")
					|| className.equals("System")) {
				return false;
			}
		}

		return true;
	}
779558
public void train() throws Exception {

		loadData();
		/**
		 * 
		 * 更新参数的准则
		 */
		Update update;
		// viterbi解码
		Inferencer inference;

		HammingLoss loss = new HammingLoss();
		if (standard) {
			inference = new LinearViterbi(templets, labels.size());
			update = new LinearViterbiPAUpdate((LinearViterbi) inference, loss);
		} else {
			inference = new HigherOrderViterbi(templets, labels.size());
			update = new HigherOrderViterbiPAUpdate(templets, labels.size(), true);
		}

		OnlineTrainer trainer;

		if(cl!=null){
			trainer = new OnlineTrainer(cl, update, loss, factory,iterNum, c);
		}else{
			trainer = new OnlineTrainer(inference, update, loss,
					factory, iterNum, c);
		}

		cl = trainer.train(trainSet, testSet);

		if(cl!=null&&newmodel!=null)
			saveTo(newmodel);
		else
			saveTo(model);

	}
402007
public static <T> SqlParamsPairs getGetFromObject(Class<T> clazz,Object id) throws NoIdAnnotationFoundException, NoColumnAnnotationFoundException{
		
		//用来存放get语句
		StringBuffer getSql = new StringBuffer();
		
		//分析表名
		String tableName = getTableName(clazz);
		
		getSql.append("select * from " + tableName + " where ");
		
		//分析列
		Field[] fields = clazz.getDeclaredFields();
		Id idAnno = null;
		for (int i = 0; i < fields.length; i++) {
			Field f = fields[i];
			
			//找id字段
			Method getter = getGetter(clazz,f);
			
			if(getter == null){
				//没有get方法直接跳过
				continue;
			}
			
			//看是不是主键
			idAnno = getter.getAnnotation(Id.class);
			if(idAnno == null){
				continue;
			}
			
			//get column name
			String columnName = getColumnNameFromGetter(getter,f);

			getSql.append(columnName + " = ?");
			
			break;
		}
		
		//全部遍历完如果找不到主键就抛异常
		if(idAnno == null){
			throw new NoIdAnnotationFoundException(clazz);
		}
		
		SqlParamsPairs sqlAndParams = new SqlParamsPairs(getSql.toString(),new Object[]{id});
		logger.debug(sqlAndParams.toString());
		
		return sqlAndParams;
	}
673786
private void writeInitializers(
      GinjectorBindings bindings,
      StringBuilder initializeEagerSingletonsBody, StringBuilder initializeStaticInjectionsBody,
      SourceWriteUtil sourceWriteUtil, SourceWriter writer) {

    if (bindings.hasEagerSingletonBindingInSubtree()) {
      sourceWriteUtil.writeMethod(writer,
          "public void initializeEagerSingletons()", initializeEagerSingletonsBody.toString());
    }

    if (bindings.hasStaticInjectionRequestInSubtree()) {
      sourceWriteUtil.writeMethod(writer,
          "public void initializeStaticInjections()", initializeStaticInjectionsBody.toString());
    }
  }
238968
function trailingEdge(time) {
    timerId = undefined;
    // 有lastArgs才执行，
    // 意味着只有 func 已经被 debounced 过一次以后才会在 trailing edge 执行
    if (trailing && lastArgs) {
      return invokeFunc(time);
    }
    // 每次 trailingEdge 都会清除 lastArgs 和 lastThis，目的是避免最后一次函数被执行了两次
    // 举个例子：最后一次函数执行的时候，可能恰巧是前一次的 trailing edge，函数被调用，而这个函数又需要在自己时延的 trailing edge 触发，导致触发多次
    lastArgs = lastThis = undefined;
    return result;
  }
1190534
function join(handler, data, item, type, callback) {

  const schema = item.schema;
  if (!data || !schema) {
    return callback();
  }

  // 已经获取的内容（不再重复获取，检索时剔除这些内容）
  const selected = data.options ? _.keys(data.options[schema]) : [];

  // 最终结果保存在options里
  data.options = data.options || {};

  // 指定检索条件
  let filter = {free: {}, select: item.fields}, storeKey;
  Object.keys(item.conditions).forEach(key => {

    let dataKey = item.conditions[key];

    // $符号开头的是变量，需要在data里取值作为真正的检索条件值
    if (dataKey[0] === '$') {
      let val = helper.get((type === 4) ? data.items : data, dataKey.substr(1)); // 列表类型（type=4）时，在items里取值
      val = _.isArray(val) ? val : [val];
      val = _.union(_.compact(_.difference(_.flatten(val), selected)));     // 去除已经获取的，空的，重复的

      if (!_.isEmpty(val)) {
        filter.free[key] = {$in: val};
      }

      // 确定保存Option数据的key，找出与当前数据字段相同的条件的名称
      if (dataKey.substr(1) === item.key) {
        storeKey = key;
      }
    } else {
      filter.free[key] = dataKey;
    }
  });

  // 没有条件，不检索options项，防止检索所有的值出来
  if (_.isEmpty(filter.free)) {
    return callback();
  }

  // 找到新的board
  const board = cache.get(CONST.SYSTEM_DB_BOARD).find(item => item.schema === schema && item.action === 'list')
    , script  = buildScript(board, filter, handler.timezone);

  // 查询
  new ctrl(handler.copy({script: script, condition: filter.condition}), schema).list((err, result) => {
    if (err) {
      return callback(err);
    }
    result.items.forEach(item => {
      data.options[schema] = data.options[schema] || {};
      data.options[schema][item[storeKey] || item._id] = item;
    });

    callback();
  });
}
410384
private void parseStartTag(boolean xmldecl, boolean throwOnResolveFailure) throws IOException, KriptonRuntimeException {
		if (!xmldecl) {
			read('<');
		}
		name = readName();
		attributeCount = 0;

		while (true) {
			skip();

			if (position >= limit && !fillBuffer(1)) {
				checkRelaxed(UNEXPECTED_EOF);
				return;
			}

			int c = buffer[position];

			if (xmldecl) {
				if (c == '?') {
					position++;
					read('>');
					return;
				}
			} else {
				if (c == '/') {
					degenerated = true;
					position++;
					skip();
					read('>');
					break;
				} else if (c == '>') {
					position++;
					break;
				}
			}

			String attrName = readName();

			int i = (attributeCount++) * 4;
			attributes = ensureCapacity(attributes, i + 4);
			attributes[i] = "";
			attributes[i + 1] = null;
			attributes[i + 2] = attrName;

			skip();
			if (position >= limit && !fillBuffer(1)) {
				checkRelaxed(UNEXPECTED_EOF);
				return;
			}

			if (buffer[position] == '=') {
				position++;

				skip();
				if (position >= limit && !fillBuffer(1)) {
					checkRelaxed(UNEXPECTED_EOF);
					return;
				}
				char delimiter = buffer[position];

				if (delimiter == '\'' || delimiter == '"') {
					position++;
				} else if (relaxed) {
					delimiter = ' ';
				} else {
					throw new KriptonRuntimeException("attr value delimiter missing!", true, this.getLineNumber(), this.getColumnNumber(), getPositionDescription(), null);
				}

				attributes[i + 3] = readValue(delimiter, true, throwOnResolveFailure, ValueContext.ATTRIBUTE);

				if (delimiter != ' ') {
					position++; // end quote
				}
			} else if (relaxed) {
				attributes[i + 3] = attrName;
			} else {
				checkRelaxed("Attr.value missing f. " + attrName);
				attributes[i + 3] = attrName;
			}
		}

		int sp = depth++ * 4;
		elementStack = ensureCapacity(elementStack, sp + 4);
		elementStack[sp + 3] = name;

		if (depth >= nspCounts.length) {
			int[] bigger = new int[depth + 4];
			System.arraycopy(nspCounts, 0, bigger, 0, nspCounts.length);
			nspCounts = bigger;
		}

		nspCounts[depth] = nspCounts[depth - 1];

		if (processNsp) {
			adjustNsp();
		} else {
			namespace = "";
		}

		// For consistency with Expat, add default attributes after fixing
		// namespaces.
		if (defaultAttributes != null) {
			Map<String, String> elementDefaultAttributes = defaultAttributes.get(name);
			if (elementDefaultAttributes != null) {
				for (Map.Entry<String, String> entry : elementDefaultAttributes.entrySet()) {
					if (getAttributeValue(null, entry.getKey()) != null) {
						continue; // an explicit value overrides the default
					}

					int i = (attributeCount++) * 4;
					attributes = ensureCapacity(attributes, i + 4);
					attributes[i] = "";
					attributes[i + 1] = null;
					attributes[i + 2] = entry.getKey();
					attributes[i + 3] = entry.getValue();
				}
			}
		}

		elementStack[sp] = namespace;
		elementStack[sp + 1] = prefix;
		elementStack[sp + 2] = name;
	}
519730
private void initRepairingHandler(RepairingHandler handler) {
        logger.finest("Initializing repairing handler");

        boolean initialized = false;
        try {
            invalidationMetaDataFetcher.init(handler);
            initialized = true;
        } catch (Exception e) {
            logger.warning(e);
        } finally {
            if (!initialized) {
                initRepairingHandlerAsync(handler);
            }
        }
    }
332989
private Object invokeRpc(Method method, Object[] args) throws Exception {
		String methodName = method.getName();
		Class<?>[] parameterTypes = method.getParameterTypes();
		Annotation[][] parameterAnnotations = method.getParameterAnnotations();
		Time futureTimeout = extractRpcTimeout(parameterAnnotations, args, timeout);

		final RpcInvocation rpcInvocation = createRpcInvocationMessage(methodName, parameterTypes, args);

		Class<?> returnType = method.getReturnType();

		final Object result;

		if (Objects.equals(returnType, Void.TYPE)) {
			tell(rpcInvocation);

			result = null;
		} else {
			// execute an asynchronous call
			CompletableFuture<?> resultFuture = ask(rpcInvocation, futureTimeout);

			CompletableFuture<?> completableFuture = resultFuture.thenApply((Object o) -> {
				if (o instanceof SerializedValue) {
					try {
						return  ((SerializedValue<?>) o).deserializeValue(getClass().getClassLoader());
					} catch (IOException | ClassNotFoundException e) {
						throw new CompletionException(
							new RpcException("Could not deserialize the serialized payload of RPC method : "
								+ methodName, e));
					}
				} else {
					return o;
				}
			});

			if (Objects.equals(returnType, CompletableFuture.class)) {
				result = completableFuture;
			} else {
				try {
					result = completableFuture.get(futureTimeout.getSize(), futureTimeout.getUnit());
				} catch (ExecutionException ee) {
					throw new RpcException("Failure while obtaining synchronous RPC result.", ExceptionUtils.stripExecutionException(ee));
				}
			}
		}

		return result;
	}
269720
public static Throwable extractRootCause(Throwable t) {
        Throwable result = t;
        while (result.getCause() != null) {
            result = result.getCause();
        }
        return result;
    }
211501
public Object[] resolve(final Invocation inv,
            final ParameterBindingResult parameterBindingResult) throws Exception {
        Object[] parameters = new Object[paramMetaDatas.length];
        for (int i = 0; i < resolvers.length; i++) {
            if (resolvers[i] == null) {
                continue;
            }
            try {
                if (logger.isDebugEnabled()) {
                    logger.debug("Resolves parameter "
                            + paramMetaDatas[i].getParamType().getSimpleName() + " using "
                            + resolvers[i].getClass().getName());
                }
                parameters[i] = resolvers[i].resolve(inv, paramMetaDatas[i]);
                // afterPropertiesSet
                if (parameters[i] instanceof InitializingBean) {
                    ((InitializingBean) parameters[i]).afterPropertiesSet();
                }
                if (parameters[i] == null) {
                    DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
                    if (defValudeAnnotation != null && paramMetaDatas[i].getParamType() == String.class) {
                        parameters[i] = defValudeAnnotation.value();
                    }
                }
            } catch (TypeMismatchException e) {
                // 出现这个错误肯定是解析一般参数失败导致的，而非bean里面的某个属性值的解析失败

                logger.debug("", e);

                // 对简单类型的参数，设置一个默认值给它以支持对该方法的继续调用
                if (paramMetaDatas[i].getParamType().isPrimitive()) {
                    DefValue defValudeAnnotation = paramMetaDatas[i].getAnnotation(DefValue.class);
                    if (defValudeAnnotation == null
                            || DefValue.NATIVE_DEFAULT.equals(defValudeAnnotation.value())) {
                        // 对这最常用的类型做一下if-else判断，其他类型就简单使用converter来做吧
                        if (paramMetaDatas[i].getParamType() == int.class) {
                            parameters[i] = Integer.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == long.class) {
                            parameters[i] = Long.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == boolean.class) {
                            parameters[i] = Boolean.FALSE;
                        } else if (paramMetaDatas[i].getParamType() == double.class) {
                            parameters[i] = Double.valueOf(0);
                        } else if (paramMetaDatas[i].getParamType() == float.class) {
                            parameters[i] = Float.valueOf(0);
                        } else {
                            TypeConverter typeConverter = SafedTypeConverterFactory
                                    .getCurrentConverter();
                            parameters[i] = typeConverter.convertIfNecessary("0", paramMetaDatas[i]
                                    .getParamType());
                        }
                    } else {
                        TypeConverter typeConverter = SafedTypeConverterFactory
                                .getCurrentConverter();
                        parameters[i] = typeConverter.convertIfNecessary(defValudeAnnotation
                                .value(), paramMetaDatas[i].getParamType());
                    }
                }
                // 
                String paramName = parameterNames[i];
                if (paramName == null) {
                    for (String name : paramMetaDatas[i].getParamNames()) {
                        if ((paramName = name) != null) {
                            break;
                        }
                    }
                }
                Assert.isTrue(paramName != null);
                FieldError fieldError = new FieldError(//
                        "method", // 该出错字段所在的对象的名字；对于这类异常我们统一规定名字为method
                        paramName, // 出错的字段的名字；取其参数名
                        inv.getParameter(paramName), // 被拒绝的值
                        true,//whether this error represents a binding failure (like a type mismatch); else, it is a validation failure
                        new String[] { e.getErrorCode() },// "typeMismatch"
                        new String[] { inv.getParameter(paramName) }, //the array of arguments to be used to resolve this message
                        null // the default message to be used to resolve this message
                );
                parameterBindingResult.addError(fieldError);
            } catch (Exception e) {
                // 什么错误呢？比如很有可能是构造对象不能成功导致的错误，没有默认构造函数、构造函数执行失败等等
                logger.error("", e);
                throw e;
            }
        }
        return parameters;
    }
676624
private void tryDisposeAllOperators() throws Exception {
		for (StreamOperator<?> operator : operatorChain.getAllOperators()) {
			if (operator != null) {
				operator.dispose();
			}
		}
	}
328033
void endIfStarted(CodeAttribute b, ClassMethod method) {
        b.aload(getLocalVariableIndex(0));
        b.dup();
        final BranchEnd ifnotnull = b.ifnull();
        b.checkcast(Stack.class);
        b.invokevirtual(Stack.class.getName(), END_INTERCEPTOR_CONTEXT_METHOD_NAME, EMPTY_PARENTHESES + VOID_CLASS_DESCRIPTOR);
        BranchEnd ifnull = b.gotoInstruction();
        b.branchEnd(ifnotnull);
        b.pop(); // remove null Stack
        b.branchEnd(ifnull);
    }
1292133
public static Object invokeMethod(Object bean, Method method, Object... args) throws Exception {
        Class<?>[] types    = method.getParameterTypes();
        int        argCount = args == null ? 0 : args.length;
        // 参数个数对不上
        if (argCount != types.length) {
            throw new IllegalStateException(String.format("%s in %s", method.getName(), bean));
        }

        // 转参数类型
        for (int i = 0; i < argCount; i++) {
            args[i] = cast(args[i], types[i]);
        }
        return method.invoke(bean, args);
    }
50561
function modInitFactoryInvoker(id) {
        var mod = modModules[id];
        var invoking;

        mod.invokeFactory = invokeFactory;

        /**
         * 初始化模块
         *
         * @inner
         */
        function invokeFactory() {
            if (invoking || mod.state !== MODULE_PREPARED) {
                return;
            }

            invoking = 1;

            // 拼接factory invoke所需的arguments
            var factoryReady = 1;
            each(
                mod.factoryDeps,
                function (dep) {
                    var depId = dep.absId;

                    if (!BUILDIN_MODULE[depId]) {
                        modTryInvokeFactory(depId);
                        return (factoryReady = modIs(depId, MODULE_DEFINED));
                    }
                }
            );

            if (factoryReady) {
                try {
                    // 调用factory函数初始化module
                    var factory = mod.factory;
                    var exports = typeof factory === 'function'
                        ? factory.apply(global, modGetModulesExports(
                                mod.factoryDeps,
                                {
                                    require: mod.require,
                                    exports: mod.exports,
                                    module: mod
                                }
                            ))
                        : factory;

                    if (exports != null) {
                        mod.exports = exports;
                    }

                    mod.invokeFactory = null;
                }
                catch (ex) {
                    mod.hang = 1;
                    throw ex;
                }

                // 完成define
                // 不放在try里，避免后续的运行错误被这里吞掉
                modDefined(id);
            }
        }
    }