• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java CircularDependencyException类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException的典型用法代码示例。如果您正苦于以下问题:Java CircularDependencyException类的具体用法?Java CircularDependencyException怎么用?Java CircularDependencyException使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CircularDependencyException类属于com.google.javascript.jscomp.deps.SortedDependencies包,在下文中一共展示了CircularDependencyException类的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: sortInputsByDeps

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Puts the JS files into a topologically sorted order by their dependencies.
 */
public void sortInputsByDeps(Compiler compiler) {
  // Set the compiler, so that we can parse requires/provides and report
  // errors properly.
  for (CompilerInput input : inputs) {
    input.setCompiler(compiler);
  }

  // Sort the JSModule in this order.
  try {
    List<CompilerInput> sortedList =
        (new SortedDependencies<CompilerInput>(
            Collections.<CompilerInput>unmodifiableList(inputs)))
        .getSortedList();
    inputs.clear();
    inputs.addAll(sortedList);
  } catch (CircularDependencyException e) {
    compiler.report(
        JSError.make(CIRCULAR_DEPENDENCY_ERROR, e.getMessage()));
  }
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:24,代码来源:JSModule.java


示例2: testSort3

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
public void testSort3() {
  SimpleDependencyInfo a = new SimpleDependencyInfo(
      "a", "a", provides("a"), requires("c"));
  SimpleDependencyInfo b = new SimpleDependencyInfo(
      "b", "b", provides("b"), requires("a"));
  SimpleDependencyInfo c = new SimpleDependencyInfo(
      "c", "c", provides("c"), requires("b"));

  try {
    new SortedDependencies<SimpleDependencyInfo>(
        Lists.newArrayList(a, b, c));
    fail("expected exception");
  } catch (CircularDependencyException e) {
    assertEquals("a -> a", e.getMessage());
  }
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:17,代码来源:SortedDependenciesTest.java


示例3: sortInputsByDeps

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Puts the JS files into a topologically sorted order by their dependencies.
 */
public void sortInputsByDeps(Compiler compiler) {
  // Set the compiler, so that we can parse requires/provides and report
  // errors properly.
  for (CompilerInput input : inputs) {
    input.setCompiler(compiler);
  }

  // Sort the JSModule in this order.
  try {
    List<CompilerInput> sortedList =
        (new SortedDependencies<>(
            Collections.unmodifiableList(inputs)))
        .getSortedList();
    inputs.clear();
    inputs.addAll(sortedList);
  } catch (CircularDependencyException e) {
    compiler.report(
        JSError.make(CIRCULAR_DEPENDENCY_ERROR, e.getMessage()));
  }
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:24,代码来源:JSModule.java


示例4: testSort3

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
public void testSort3() {
  SimpleDependencyInfo a = new SimpleDependencyInfo(
      "a", "a", provides("a"), requires("c"));
  SimpleDependencyInfo b = new SimpleDependencyInfo(
      "b", "b", provides("b"), requires("a"));
  SimpleDependencyInfo c = new SimpleDependencyInfo(
      "c", "c", provides("c"), requires("b"));

  try {
    new SortedDependencies<SimpleDependencyInfo>(
        Lists.newArrayList(a, b, c));
    fail("expected exception");
  } catch (CircularDependencyException e) {}
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:15,代码来源:SortedDependenciesTest.java


示例5: testSort4

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
public void testSort4() {
  SimpleDependencyInfo a = new SimpleDependencyInfo(
      "a", "a", provides("a"), requires("a"));

  try {
    new SortedDependencies<SimpleDependencyInfo>(
        Lists.newArrayList(a));
    fail("expected exception");
  } catch (CircularDependencyException e){
    assertEquals("a -> a", e.getMessage());
  }
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:13,代码来源:SortedDependenciesTest.java


示例6: runGSS

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
private void runGSS(Closure closure, JobDescriptionBuilder options) {
	GSSPrintStreamErrorManager manager = new GSSPrintStreamErrorManager(
			System.err, System.out,new ClosureStatusFormatter());

	if (ClosureModelManager.canBuild(closure.getClosureJs())) {
		try {
			BasicValidator validator = new BasicValidator(bundle,
					pathResolver);
			closure.getClosureJs().accept(validator, null);
			if (!validator.isValid()) {
				manager.reportMessage(new Status(StatusType.ERROR, bundle
						.getString(IConstants.SOYConsole_Invalid), null));
				reportConfErrors(validator, manager);
			} else {
				GSSBuildpathContainerResolver resolver = new GSSBuildpathContainerResolver(
						closure.getClosureGss().getBuildpath(),
						pathResolver);
				resolver.resolve();
				GSSCompilerCli.compile(closure.getClosureGss(), options,
						manager, resolver.getSources(),
						resolver.getExterns(), bundle, pathResolver);
			}
		} catch (CircularDependencyException e) {
			manager.reportMessage(new Status(StatusType.ERROR, bundle
					.getString(IConstants.JSConsole_CicleDeps), e));
		} catch (Exception e1) {
			manager.reportMessage(new Status(StatusType.ERROR, "", e1));
		}
	} else {
		manager.reportMessage(new Status(StatusType.ERROR, bundle
				.getString(IConstants.Console_NoResources), null));
	}
}
 
开发者ID:DigiArea,项目名称:closurefx-builder,代码行数:34,代码来源:ClosureFXCli.java


示例7: runSOY

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
private void runSOY(Closure closure, SoyJsSrcOptions options) {
	SOYPrintStreamErrorManager manager = new SOYPrintStreamErrorManager(
			System.err, System.out,new ClosureStatusFormatter());

	if (ClosureModelManager.canBuild(closure.getClosureJs())) {
		try {
			BasicValidator validator = new BasicValidator(bundle,
					pathResolver);
			closure.getClosureJs().accept(validator, null);
			if (!validator.isValid()) {
				manager.reportMessage(new Status(StatusType.ERROR, bundle
						.getString(IConstants.SOYConsole_Invalid), null));
				reportConfErrors(validator, manager);
			} else {
				SOYBuildpathContainerResolver resolver = new SOYBuildpathContainerResolver(
						closure.getClosureSoy().getBuildpath(),
						pathResolver);
				resolver.resolve();
				SOYCompilerCli compiler = new SOYCompilerCli(
						closure.getClosureSoy(), options,
						resolver.getSources(), resolver.getExterns(),
						pathResolver);
				compiler.setErrorManager(manager);
				compiler.setResourceBundle(bundle);
				compiler.compile();
			}
		} catch (CircularDependencyException e) {
			manager.reportMessage(new Status(StatusType.ERROR, bundle
					.getString(IConstants.JSConsole_CicleDeps), e));
		} catch (Exception e1) {
			manager.reportMessage(new Status(StatusType.ERROR, "", e1));
		}
	} else {
		manager.reportMessage(new Status(StatusType.ERROR, bundle
				.getString(IConstants.Console_NoResources), null));
	}
}
 
开发者ID:DigiArea,项目名称:closurefx-builder,代码行数:38,代码来源:ClosureFXCli.java


示例8: runJS

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
private void runJS(Closure closure, CompilerOptions options) {
	JSCPrintStreamErrorManager manager = new JSCPrintStreamErrorManager(
			System.err, System.out,new ClosureStatusFormatter());

	if (ClosureModelManager.canBuild(closure.getClosureJs())) {
		try {
			BasicValidator validator = new BasicValidator(bundle,
					pathResolver);
			closure.getClosureJs().accept(validator, null);
			if (!validator.isValid()) {
				manager.reportMessage(new Status(StatusType.ERROR, bundle
						.getString(IConstants.JSConsole_Invalid), null));
				reportConfErrors(validator, manager);
			} else {
				JSBuildpathContainerResolver resolver = new JSBuildpathContainerResolver(
						closure.getClosureJs().getBuildpath(), pathResolver);
				resolver.getDependencies();
				resolver.resolve();
				JSCCompilerCli compiler = new JSCCompilerCli(
						closure.getClosureJs(), options,
						resolver.getSources(), resolver.getExterns(),
						pathResolver);

				compiler.setErrorManager(manager);
				compiler.setResourceBundle(bundle);
				com.google.javascript.jscomp.Compiler
						.setLoggingLevel(Level.SEVERE);
				compiler.build();
			}
		} catch (CircularDependencyException e) {
			manager.reportMessage(new Status(StatusType.ERROR, bundle
					.getString(IConstants.JSConsole_CicleDeps), e));
		} catch (Exception e1) {
			manager.reportMessage(new Status(StatusType.ERROR, "", e1));
		}
	} else {
		manager.reportMessage(new Status(StatusType.ERROR, bundle
				.getString(IConstants.Console_NoResources), null));
	}
}
 
开发者ID:DigiArea,项目名称:closurefx-builder,代码行数:41,代码来源:ClosureFXCli.java


示例9: createTask

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
@Override
protected Task<Closure> createTask() {
	Task<Closure> task = new Task<Closure>() {
		protected Closure call() throws IOException, MalformedURLException {

			consoleManager.reportMessage(new Status(StatusType.INFO, bundle
					.getString(IConstants.Console_Start), null));

			if (isCancelled()) {
				return null;
			}

			if (ClosureModelManager.canBuild(closure.getClosureJs())) {
				try {
					BasicValidator validator = new BasicValidator(bundle,
							pathResolver);
					closure.getClosureJs().accept(validator, null);
					if (!validator.isValid()) {
						consoleManager
								.reportMessage(new Status(
										StatusType.ERROR,
										bundle.getString(IConstants.JSConsole_Invalid),
										null));
					} else {
						CompilerOptions options = buildpathManager
								.getJSCOptions(closure, pathResolver);
						// options.setIdeMode(true);
						JSBuildpathContainerResolver resolver = new JSBuildpathContainerResolver(
								closure.getClosureJs().getBuildpath(),
								pathResolver);
						resolver.getDependencies();
						resolver.resolve();
						JSCCompiler compiler = new JSCCompiler(
								closure.getClosureJs(), options,
								resolver.getSources(),
								resolver.getExterns(), pathResolver);
						JSCErrorManager manager = new JSCErrorManager(consoleManager);
						compiler.setErrorManager(manager);
						compiler.setResourceBundle(bundle);
						com.google.javascript.jscomp.Compiler
								.setLoggingLevel(Level.SEVERE);
						compiler.build();
						//final error reporting
						consoleManager.reportErrors(manager
								.getErrorStatuses());
						manager.clear();
					}
				} catch (CircularDependencyException e) {
					consoleManager
							.reportMessage(new Status(
									StatusType.ERROR,
									MessageFormat.format(
											bundle.getString(IConstants.JSConsole_CicleDeps),
											e.getLocalizedMessage()), null));
				} catch (Exception e1) {
					consoleManager
							.reportMessage(new Status(StatusType.ERROR, e1
									.getLocalizedMessage(), e1));
				}
			} else {
				consoleManager.reportMessage(new Status(StatusType.WARNING,
						bundle.getString(IConstants.Console_NoResources),
						null));
			}

			updateProgress(1, 1);

			consoleManager.reportMessage(new Status(StatusType.INFO, bundle
					.getString(IConstants.Console_Finish), null));

			return getClosure();
		}
	};
	progressBar.progressProperty().bind(task.progressProperty());
	return task;
}
 
开发者ID:DigiArea,项目名称:closurefx-builder,代码行数:77,代码来源:JSService.java


示例10: getDependencies

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
public void getDependencies() throws CircularDependencyException {
	readEntries();
	deps = new SortedDependencies<DependencyInfo>(
			new ArrayList<DependencyInfo>(closureDeps));
}
 
开发者ID:DigiArea,项目名称:closurefx-builder,代码行数:6,代码来源:JSBuildpathContainerResolver.java


示例11: sortJsModules

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Returns the given collection of modules in topological order.
 *
 * Note that this will return the modules in the same order if they are
 * already sorted, and in general, will only change the order as necessary to
 * satisfy the ordering dependencies.  This can be important for cases where
 * the modules do not properly specify all dependencies.
 */
public static JSModule[] sortJsModules(Collection<JSModule> modules)
    throws CircularDependencyException {
  // Sort the JSModule in this order.
  List<JSModule> sortedList = (new SortedDependencies<JSModule>(
          Lists.newArrayList(modules))).getSortedList();
  return sortedList.toArray(new JSModule[sortedList.size()]);
}
 
开发者ID:ehsan,项目名称:js-symbolic-executor,代码行数:16,代码来源:JSModule.java


示例12: manageDependencies

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Applies a DependencyOptions in "dependency sorting" and "dependency pruning"
 * mode to the given list of inputs. Returns a new list with the files sorted
 * and removed. This module graph will be updated to reflect the new list.
 *
 * If you need more fine-grained dependency management, you should create your
 * own DependencyOptions and call
 * {@code manageDependencies(DependencyOptions, List<CompilerInput>)}.
 *
 * @param entryPoints The entry points into the program.
 *     Expressed as JS symbols.
 * @param inputs The original list of sources. Used to ensure that the sort
 *     is stable.
 * @throws CircularDependencyException if there is a circular dependency
 *     between the provides and requires.
 * @throws MissingProvideException if an entry point was not provided
 *     by any of the inputs.
 * @see DependencyOptions for more info on how this works.
 */
public List<CompilerInput> manageDependencies(
    List<String> entryPoints,
    List<CompilerInput> inputs)
    throws CircularDependencyException, MissingProvideException {
  DependencyOptions depOptions = new DependencyOptions();
  depOptions.setDependencySorting(true);
  depOptions.setDependencyPruning(true);
  depOptions.setEntryPoints(entryPoints);
  return manageDependencies(depOptions, inputs);
}
 
开发者ID:SpoonLabs,项目名称:astor,代码行数:30,代码来源:JSModuleGraph.java


示例13: sortJsModules

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Returns the given collection of modules in topological order.
 *
 * Note that this will return the modules in the same order if they are
 * already sorted, and in general, will only change the order as necessary to
 * satisfy the ordering dependencies.  This can be important for cases where
 * the modules do not properly specify all dependencies.
 */
public static JSModule[] sortJsModules(Collection<JSModule> modules)
    throws CircularDependencyException {
  // Sort the JSModule in this order.
  List<JSModule> sortedList = (new SortedDependencies<>(
          Lists.newArrayList(modules))).getSortedList();
  return sortedList.toArray(new JSModule[sortedList.size()]);
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:16,代码来源:JSModule.java


示例14: manageDependencies

import com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException; //导入依赖的package包/类
/**
 * Applies a DependencyOptions in "dependency sorting" and "dependency pruning"
 * mode to the given list of inputs. Returns a new list with the files sorted
 * and removed. This module graph will be updated to reflect the new list.
 *
 * If you need more fine-grained dependency management, you should create your
 * own DependencyOptions and call
 * {@code manageDependencies(DependencyOptions, List<CompilerInput>)}.
 *
 * @param entryPoints The entry points into the program.
 *     Expressed as JS symbols.
 * @param inputs The original list of sources. Used to ensure that the sort
 *     is stable.
 * @throws CircularDependencyException if there is a circular dependency
 *     between the provides and requires.
 * @throws MissingProvideException if an entry point was not provided
 *     by any of the inputs.
 * @see DependencyOptions for more info on how this works.
 */
public List<CompilerInput> manageDependencies(
    List<String> entryPoints,
    List<CompilerInput> inputs)
    throws CircularDependencyException,
        MissingModuleException,
        MissingProvideException {
  DependencyOptions depOptions = new DependencyOptions();
  depOptions.setDependencySorting(true);
  depOptions.setDependencyPruning(true);
  depOptions.setEntryPoints(entryPoints);
  return manageDependencies(depOptions, inputs);
}
 
开发者ID:nicks,项目名称:closure-compiler-old,代码行数:32,代码来源:JSModuleGraph.java



注:本文中的com.google.javascript.jscomp.deps.SortedDependencies.CircularDependencyException类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Coding类代码示例发布时间:2022-05-22
下一篇:
Java BatchSpoutExecutor类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap