StatelessScriptUpdateProcessorFactory.java 文件源码

java
阅读 17 收藏 0 点赞 0 评论 0

项目:search 作者:
/**
 * For error messages - returns null if there are any exceptions of any 
 * kind building the string (or of the list is empty for some unknown reason).
 * @param ext - if true, list of extensions, otherwise a list of engine names
 */
private static String getSupportedEngines(ScriptEngineManager mgr,
                                          boolean ext) {
  String result = null;
  try {
    List<ScriptEngineFactory> factories = mgr.getEngineFactories();
    if (null == factories) return result;

    Set<String> engines = new LinkedHashSet<>(factories.size());
    for (ScriptEngineFactory f : factories) {
      if (ext) {
        engines.addAll(f.getExtensions());
      } else {
        engines.addAll(f.getNames());
      }
    }
    result = StringUtils.join(engines, ", ");
  } catch (RuntimeException e) {
    /* :NOOP: */
  }
  return result;
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号