当前位置: 首页>>代码示例>>Java>>正文


Java WalaException类代码示例

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


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

示例1: makeCG

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
  try {
    IClassHierarchy cha = makeHierarchy(scope, loaders);
    com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
    Iterable<Entrypoint> roots = makeScriptRoots(cha);
    JSAnalysisOptions options = makeOptions(scope, cha, roots);
    options.setHandleCallApply(builderType.handleCallApply());
    IAnalysisCacheView cache = makeCache(irFactory);
    JSCFABuilder builder = new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, ZeroXInstanceKeys.ALLOCATIONS,
        builderType.useOneCFA());
    if(builderType.extractCorrelatedPairs())
      builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));

    return builder;
  } catch (ClassHierarchyException e) {
    assert false : "internal error building class hierarchy";
    return null;
  }
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:20,代码来源:JSCallGraphBuilderUtil.java

示例2: makeCG

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
  try {
    IClassHierarchy cha = makeHierarchy(scope, loaders);
    com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
    Iterable<Entrypoint> roots = makeScriptRoots(cha);
    JSAnalysisOptions options = makeOptions(scope, cha, roots);
    options.setHandleCallApply(builderType.handleCallApply());
    AnalysisCache cache = makeCache(irFactory);
    JSCFABuilder builder = new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, ZeroXInstanceKeys.ALLOCATIONS,
        builderType.useOneCFA());
    if(builderType.extractCorrelatedPairs())
      builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));

    return builder;
  } catch (ClassHierarchyException e) {
    return null;
  }
}
 
开发者ID:ylimit,项目名称:HybridFlow,代码行数:19,代码来源:JSCallGraphBuilderUtil.java

示例3: makeHTMLCGBuilder

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url,
        CGBuilderType builderType) throws IOException, WalaException {
    IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
    CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs
                                       ? new CorrelatedPairExtractorFactory(translatorFactory, url)
                                       : null;
    JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(
        translatorFactory, preprocessor);
    SourceModule[] scriptsArray = makeHtmlScope(url, loaders);

    JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray,
                                         builderType, irFactory);
    if (builderType.extractCorrelatedPairs)
        builder.setContextSelector(new PropertyNameContextSelector(builder
                                   .getAnalysisCache(), 2, builder.getContextSelector()));
    builder.setBaseURL(url);
    return builder;
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:19,代码来源:ImprovedJSCallGraphBuilderUtil.java

示例4: makeCG

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders,
                                     AnalysisScope scope, CGBuilderType builderType,
                                     IRFactory<IMethod> irFactory) throws IOException, WalaException {
    try {
        IClassHierarchy cha = makeHierarchy(scope, loaders);
        com.ibm.wala.cast.util.Util.checkForFrontEndErrors(cha);
        Iterable<Entrypoint> roots = makeScriptRoots(cha);
        JSAnalysisOptions options = makeOptions(scope, cha, roots);
        options.setHandleCallApply(builderType.handleCallApply());
        IAnalysisCacheView cache = makeCache(irFactory);
        JSCFABuilder builder = new JSZeroOrOneXCFABuilder(cha, options,
                cache, null, null, ZeroXInstanceKeys.ALLOCATIONS,
                builderType.useOneCFA());
        
        if (builderType.extractCorrelatedPairs())
            builder.setContextSelector(new PropertyNameContextSelector(
                                           builder.getAnalysisCache(), 2, builder
                                           .getContextSelector()));

        return builder;
    } catch (ClassHierarchyException e) {
        // Assert.assertTrue("internal error building class hierarchy",
        // false);
        return null;
    }
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:27,代码来源:ImprovedJSCallGraphBuilderUtil.java

示例5: makeCG

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IOException, WalaException {
  try {
    IClassHierarchy cha = makeHierarchy(scope, loaders);
    com.ibm.wala.cast.js.util.Util.checkForFrontEndErrors(cha);
    Iterable<Entrypoint> roots = makeScriptRoots(cha);
    JSAnalysisOptions options = makeOptions(scope, cha, roots);
    options.setHandleCallApply(builderType.handleCallApply());
    AnalysisCache cache = makeCache(irFactory);
    JSCFABuilder builder = new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, ZeroXInstanceKeys.ALLOCATIONS,
        builderType.useOneCFA());
    if(builderType.extractCorrelatedPairs())
      builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));

    return builder;
  } catch (ClassHierarchyException e) {
    Assert.assertTrue("internal error building class hierarchy", false);
    return null;
  }
}
 
开发者ID:blackoutjack,项目名称:jamweaver,代码行数:20,代码来源:JSCallGraphBuilderUtil.java

示例6: main

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
/**
 * main method to print out all ir for the test classes
 * @param args no args defined
 * @throws IOException
 * @throws WalaException
 */
public static void main(String[] args) throws IOException, WalaException {
	String pathname = TARGET_IRS;

	if (args.length > 0) {
		pathname = args[0];
	}

	TargetApplication targetApplication = TestUtilities.loadTestJar();

	for (IClass clazz : targetApplication.getApplicationClasses()) {
		for (IMethod m : clazz.getDeclaredMethods()) {
			printToPDF(pathname, targetApplication.getClassHierachy(), targetApplication.findIRForMethod(m));
		}
	}
}
 
开发者ID:wondee,项目名称:faststring,代码行数:22,代码来源:PrintTestIRs.java

示例7: createMethodFor

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
private AnalyzedMethod createMethodFor(String className, String methodName, String jarName) {
	TargetApplication application = TestUtilities.loadTestJar("target/" + jarName);
	for (IClass cl : application.getClassHierachy()) {
		if (cl.getName().toString().endsWith(className)) {
			LOG.info("found class {}", className);
			for (IMethod m : cl.getAllMethods()) {
				if (m.getName().toString().equals(methodName) || m.getSignature().equals(methodName)) {
					try {
						PrintTestIRs.printToPDF("target", application.getClassHierachy(), application.findIRForMethod(m));
					} catch (WalaException | IOException e) {
						// TODO Auto-generated catch block
						e.printStackTrace();
					}

					LOG.info("found method {}; {}", m.getSignature());
					return application.findIRMethodForMethod(m);

				}
			}
		}
	}

	throw new IllegalStateException(String.format("no method found %s %s", className, methodName));
}
 
开发者ID:wondee,项目名称:faststring,代码行数:25,代码来源:TestExternalJars.java

示例8: run

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
public static Process run(String[] args) throws IOException {
  try {
    validateCommandLine(args);
    String classpath = args[CLASSPATH_INDEX];
    AnalysisScope scope = AnalysisScopeReader.makeJavaBinaryAnalysisScope(classpath, null);
    ExampleUtil.addDefaultExclusions(scope);

    // invoke WALA to build a class hierarchy
    ClassHierarchy cha = ClassHierarchyFactory.make(scope);

    Graph<IClass> g = typeHierarchy2Graph(cha);

    g = pruneForAppLoader(g);
    //String dotFile = "/tmp" + File.separatorChar + DOT_FILE;
    String dotFile = File.createTempFile("out", ".dt").getAbsolutePath();
    String pdfFile = File.createTempFile("out", ".pdf").getAbsolutePath();
    String dotExe = "dot";
    String gvExe = "open";
    DotUtil.dotify(g, null, dotFile, pdfFile, dotExe);
    return PDFViewUtil.launchPDFView(pdfFile, gvExe);

  } catch (WalaException e) {
    // TODO Auto-generated catch block
    e.printStackTrace();
    return null;
  }
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:28,代码来源:PDFTypeHierarchy.java

示例9: pruneForAppLoader

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
/**
 * Restrict g to nodes from the Application loader
 */
public static Graph<IClass> pruneForAppLoader(Graph<IClass> g) throws WalaException {
  Predicate<IClass> f = new Predicate<IClass>() {
    @Override public boolean test(IClass c) {
      return (c.getClassLoader().getReference().equals(ClassLoaderReference.Application));
    }
  };
  return pruneGraph(g, f);
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:12,代码来源:PDFTypeHierarchy.java

示例10: getSystemJars

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
/**
 * Collect the set of JarFiles that constitute the system libraries of the running JRE.
 */
private JarFile[] getSystemJars() throws IOException {
  String javaHomePath = "garbage";
  Set<JarFile> jarFiles = HashSetFactory.make();

  // first, see if wala.properties has been set up
  try {
    Properties p = WalaProperties.loadProperties();
    javaHomePath = p.getProperty(WalaProperties.J2SE_DIR);
  } catch (WalaException e) {
    // no luck.
  }

  // if not, try assuming the running JRE looks normal
  File x = new File(javaHomePath);
  if (!(x.exists() && x.isDirectory())) {
    javaHomePath = System.getProperty("java.home");

    if (!javaHomePath.endsWith(File.separator)) {
      javaHomePath = javaHomePath + File.separator;
    }

    javaHomePath = javaHomePath + "lib";
  }

  // find jars from chosen JRE lib path
  collectJars(new File(javaHomePath), jarFiles);

  return jarFiles.toArray(new JarFile[jarFiles.size()]);
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:33,代码来源:SimpleThreadEscapeAnalysis.java

示例11: makeScriptCGBuilder

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
/**
 * create a CG builder for script.  Note that the script at dir/name is loaded via the classloader, not from the filesystem.
 */
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, CGBuilderType builderType, ClassLoader loader) throws IOException, WalaException {
  URL script = getURLforFile(dir, name, loader);
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, script) : null;
  JavaScriptLoaderFactory loaders = JSCallGraphUtil.makeLoaders(preprocessor);

  AnalysisScope scope = makeScriptScope(dir, name, loaders, loader);

  return makeCG(loaders, scope, builderType, AstIRFactory.makeDefaultFactory());
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:13,代码来源:JSCallGraphBuilderUtil.java

示例12: makeScriptCG

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
public static CallGraph makeScriptCG(String dir, String name, CGBuilderType builderType, ClassLoader loader) throws IOException,
    IllegalArgumentException, CancelException, WalaException {
  PropagationCallGraphBuilder b = makeScriptCGBuilder(dir, name, builderType, loader);
  CallGraph CG = b.makeCallGraph(b.getOptions());
  // dumpCG(b.getPointerAnalysis(), CG);
  return CG;
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:8,代码来源:JSCallGraphBuilderUtil.java

示例13: makeHTMLCGBuilder

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType, Function<Void, JSSourceExtractor> fExtractor) throws IOException, WalaException {
  IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
  JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
  SourceModule[] scriptsArray = makeHtmlScope(url, loaders, fExtractor);
  
  JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray, builderType, irFactory);
  if(builderType.extractCorrelatedPairs)
    builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));
  builder.setBaseURL(url);
  return builder;
}
 
开发者ID:wala,项目名称:WALA-start,代码行数:13,代码来源:JSCallGraphBuilderUtil.java

示例14: makeHTMLCGBuilder

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
public static JSCFABuilder makeHTMLCGBuilder(URL url, CGBuilderType builderType) throws IOException, WalaException {
  IRFactory<IMethod> irFactory = AstIRFactory.makeDefaultFactory();
  CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs ? new CorrelatedPairExtractorFactory(translatorFactory, url) : null;
  JavaScriptLoaderFactory loaders = new WebPageLoaderFactory(translatorFactory, preprocessor);
  SourceModule[] scriptsArray = makeHtmlScope(url, loaders);
  
  JSCFABuilder builder = makeCGBuilder(loaders, scriptsArray, builderType, irFactory);
  if(builderType.extractCorrelatedPairs)
    builder.setContextSelector(new PropertyNameContextSelector(builder.getAnalysisCache(), 2, builder.getContextSelector()));
  builder.setBaseURL(url);
  return builder;
}
 
开发者ID:ylimit,项目名称:HybridFlow,代码行数:13,代码来源:JSCallGraphBuilderUtil.java

示例15: makeScriptCGBuilder

import com.ibm.wala.util.WalaException; //导入依赖的package包/类
/**
 * create a CG builder for script. Note that the script at dir/name is
 * loaded via the classloader, not from the filesystem.
 */
public static JSCFABuilder makeScriptCGBuilder(String dir, String name,
        CGBuilderType builderType) throws IOException, WalaException {
    URL script = getURLforFile(dir, name);
    CAstRewriterFactory preprocessor = builderType.extractCorrelatedPairs
                                       ? new CorrelatedPairExtractorFactory(translatorFactory, script)
                                       : null;
    JavaScriptLoaderFactory loaders = JSCallGraphUtil
                                      .makeLoaders(preprocessor);

    AnalysisScope scope = makeScriptScope(script, dir, name, loaders);

    return makeCG(loaders, scope, builderType,
                  AstIRFactory.makeDefaultFactory());
}
 
开发者ID:logicalhacking,项目名称:DASCA,代码行数:19,代码来源:ImprovedJSCallGraphBuilderUtil.java


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