gpt4 book ai didi

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

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

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

WalaProperties.loadProperties介绍

暂无

代码示例

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

/**
 * @return names of the Jar files holding J2EE libraries
 * @throws IllegalStateException if the J2EE_DIR property is not set
 */
public static String[] getJ2EEJarFiles() {
 Properties p = null;
 try {
  p = WalaProperties.loadProperties();
 } catch (WalaException e) {
  e.printStackTrace();
  throw new IllegalStateException("problem loading wala.properties");
 }
 String dir = p.getProperty(WalaProperties.J2EE_DIR);
 if (dir == null) {
  throw new IllegalStateException("No J2EE directory specified");
 }
 return getJarsInDirectory(dir);
}

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

/**
 * @return names of the Jar files holding J2EE libraries
 * @throws IllegalStateException if the J2EE_DIR property is not set
 */
public static String[] getJ2EEJarFiles() {
 Properties p = null;
 try {
  p = WalaProperties.loadProperties();
 } catch (WalaException e) {
  e.printStackTrace();
  throw new IllegalStateException("problem loading wala.properties");
 }
 String dir = p.getProperty(WalaProperties.J2EE_DIR);
 if (dir == null) {
  throw new IllegalStateException("No J2EE directory specified");
 }
 return getJarsInDirectory(dir);
}

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

/**
 * Determine the classpath noted in wala.properties for J2SE standard libraries
 * 
 * If wala.properties cannot be loaded, returns jar files in boot classpath.
 * @throws IllegalStateException if jar files cannot be discovered
 * @see PlatformUtil#getBootClassPathJars() 
 */
public static String[] getJ2SEJarFiles() {
 Properties p = null;
 try {
  p = WalaProperties.loadProperties();
 } catch (WalaException e) {
  return PlatformUtil.getBootClassPathJars();
 }
 String dir = p.getProperty(WalaProperties.J2SE_DIR);
 if (dir == null || !(new File(dir)).isDirectory()) {
  System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid.  Using boot class path instead.");
  return PlatformUtil.getBootClassPathJars();      
 }
 return getJarsInDirectory(dir);
}

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

public static <T, P, F> void viewIFDS(TabulationResult<T, P, F> r, Collection<? extends P> roots, NodeDecorator<T> labels)
  throws WalaException {
 Properties p = null;
 try {
  p = WalaProperties.loadProperties();
 } catch (WalaException e) {
  e.printStackTrace();
  Assertions.UNREACHABLE();
 }
 String scratch = p.getProperty(WalaProperties.OUTPUT_DIR);
 viewIFDS(r, roots, labels, scratch);
}

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

/**
 * Determine the classpath noted in wala.properties for J2SE standard libraries
 * 
 * If wala.properties cannot be loaded, returns jar files in boot classpath.
 * @throws IllegalStateException if jar files cannot be discovered
 * @see PlatformUtil#getBootClassPathJars() 
 */
public static String[] getJ2SEJarFiles() {
 Properties p = null;
 try {
  p = WalaProperties.loadProperties();
 } catch (WalaException e) {
  return PlatformUtil.getBootClassPathJars();
 }
 String dir = p.getProperty(WalaProperties.J2SE_DIR);
 if (dir == null || !(new File(dir)).isDirectory()) {
  System.err.println("WARNING: java_runtime_dir " + dir + " in wala.properties is invalid.  Using boot class path instead.");
  return PlatformUtil.getBootClassPathJars();      
 }
 return getJarsInDirectory(dir);
}

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

public static void main(String[] args) throws IllegalArgumentException, CancelException, IOException {
 try {
  Properties p = new Properties();
  p.putAll(WalaProperties.loadProperties());
 } catch (WalaException e) {
  e.printStackTrace();
  Assertions.UNREACHABLE();
 }
 runTestCase(TestConstants.JLEX_MAIN, TestConstants.JLEX, "JLex");
 // runTestCase(TestConstants.HELLO_MAIN, TestConstants.HELLO, "Hello");
}

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

/**
 * 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[0]);
}

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

/**
 * @param appJar something like "c:/temp/testdata/java_cup.jar"
 */
public static Process run(String appJar, String exclusionFile) throws IllegalArgumentException, CancelException {
 try {
  Graph<CGNode> g = buildPrunedCallGraph(appJar, (new FileProvider()).getFile(exclusionFile));
  Properties p = null;
  try {
   p = WalaExamplesProperties.loadProperties();
   p.putAll(WalaProperties.loadProperties());
  } catch (WalaException e) {
   e.printStackTrace();
   Assertions.UNREACHABLE();
  }
  String pdfFile = p.getProperty(WalaProperties.OUTPUT_DIR) + File.separatorChar + PDF_FILE;
  String dotExe = p.getProperty(WalaExamplesProperties.DOT_EXE);
  DotUtil.dotify(g, null, PDFTypeHierarchy.DOT_FILE, pdfFile, dotExe);
  String gvExe = p.getProperty(WalaExamplesProperties.PDFVIEW_EXE);
  return PDFViewUtil.launchPDFView(pdfFile, gvExe);
 } catch (WalaException e) {
  e.printStackTrace();
  return null;
 } catch (IOException e) {
  e.printStackTrace();
  return null;
 }
}

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

wp = WalaProperties.loadProperties();
 wp.putAll(WalaExamplesProperties.loadProperties());
} catch (WalaException e) {

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

wp = WalaProperties.loadProperties();
 wp.putAll(WalaExamplesProperties.loadProperties());
} catch (WalaException e) {

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

try {
 p = WalaExamplesProperties.loadProperties();
 p.putAll(WalaProperties.loadProperties());
} catch (WalaException e) {
 e.printStackTrace();

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

wp = WalaProperties.loadProperties();
 wp.putAll(WalaExamplesProperties.loadProperties());
} catch (WalaException e) {

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

try {
 p = WalaExamplesProperties.loadProperties();
 p.putAll(WalaProperties.loadProperties());
} catch (WalaException e) {
 e.printStackTrace();

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