gpt4 book ai didi

com.ibm.wala.properties.WalaProperties.getJ2SEJarFiles()方法的使用及代码示例

转载 作者:知者 更新时间:2024-03-21 23:57:05 26 4
gpt4 key购买 nike

本文整理了Java中com.ibm.wala.properties.WalaProperties.getJ2SEJarFiles()方法的一些代码示例,展示了WalaProperties.getJ2SEJarFiles()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalaProperties.getJ2SEJarFiles()方法的具体详情如下:
包路径:com.ibm.wala.properties.WalaProperties
类名称:WalaProperties
方法名:getJ2SEJarFiles

WalaProperties.getJ2SEJarFiles介绍

[英]Determine the classpath noted in wala.properties for J2SE standard libraries If wala.properties cannot be loaded, returns jar files in boot classpath.
[中]确定wala中标注的类路径。如果wala是J2SE标准库的属性。无法加载属性,返回启动类路径中的jar文件。

代码示例

代码示例来源:origin: wala/WALA

protected void instrument(String testJarLocation) throws IOException, ClassNotFoundException, InvalidClassFileException, FailureException {
 if (! instrumentedJarBuilt) {
  System.err.println("core data jar to instrument: " + testJarLocation);
  
  Files.deleteIfExists(instrumentedJarLocation);
  
  String rtJar = null;
  for(String jar : WalaProperties.getJ2SEJarFiles()) {
   if (jar.endsWith(File.separator + "rt.jar") || jar.endsWith(File.separator + "classes.jar")) {
    rtJar = jar;
   }
  }
  List<String> args = new ArrayList<>(Arrays.asList(testJarLocation, "-o", instrumentedJarLocation.toString()));
  if (rtJar != null) {
   args.addAll(Arrays.asList("--rt-jar", rtJar));
  }
  if (testPatchCalls) {
   args.add("--patch-calls");
  }
  OfflineDynamicCallGraph.main(args.toArray(new String[0]));
  Assert.assertTrue("expected to create " + instrumentedJarLocation, Files.exists(instrumentedJarLocation));
  instrumentedJarBuilt = true;
 }
}

代码示例来源:origin: wala/WALA

scope.setLoaderImpl(walaLoader, entryPathname);
} else if ("stdlib".equals(entryType)) {
 String[] stdlibs = WalaProperties.getJ2SEJarFiles();
 for (String stdlib : stdlibs) {
  scope.addToScope(walaLoader, new JarFile(stdlib, false));

代码示例来源:origin: com.ibm.wala/com.ibm.wala.core

scope.setLoaderImpl(walaLoader, entryPathname);
} else if ("stdlib".equals(entryType)) {
 String[] stdlibs = WalaProperties.getJ2SEJarFiles();
 for (String stdlib : stdlibs) {
  scope.addToScope(walaLoader, new JarFile(stdlib, false));

代码示例来源:origin: wala/WALA

AnalysisScope scope = new JavaSourceAnalysisScope();
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
 scope.addToScope(ClassLoaderReference.Primordial, new JarFile(stdlib));

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com