- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.ibm.wala.properties.WalaProperties
类的一些代码示例,展示了WalaProperties
类的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WalaProperties
类的具体详情如下:
包路径:com.ibm.wala.properties.WalaProperties
类名称:WalaProperties
暂无
代码示例来源: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
public static Properties loadProperties() throws WalaException {
try {
Properties result = loadPropertiesFromFile(WalaProperties.class.getClassLoader(), PROPERTY_FILENAME);
String outputDir = result.getProperty(OUTPUT_DIR, DefaultPropertiesValues.DEFAULT_OUTPUT_DIR);
result.setProperty(OUTPUT_DIR, convertToAbsolute(outputDir));
String walaReport = result.getProperty(WALA_REPORT, DefaultPropertiesValues.DEFAULT_WALA_REPORT_FILENAME);
result.setProperty(WALA_REPORT, convertToAbsolute(walaReport));
return result;
} catch (Exception e) {
// e.printStackTrace();
throw new WalaException("Unable to set up wala properties ", e);
}
}
代码示例来源: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: 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
public static Properties loadProperties() {
try {
Properties result = WalaProperties.loadPropertiesFromFile(WalaExamplesProperties.class.getClassLoader(), PROPERTY_FILENAME);
return result;
} catch (Exception e) {
e.printStackTrace();
throw new IllegalStateException("Unable to set up wala examples properties ", e);
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
static String convertToAbsolute(String path) {
final File file = new File(path);
return (file.isAbsolute()) ? file.getAbsolutePath() : WalaProperties.getWalaHomeDir().concat(File.separator).concat(path);
}
代码示例来源:origin: wala/WALA
public static Properties loadPropertiesFromFile(ClassLoader loader, String fileName) throws IOException {
if (loader == null) {
throw new IllegalArgumentException("loader is null");
}
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}
try (final InputStream propertyStream = loader.getResourceAsStream(fileName)) {
if (propertyStream == null) {
// create default properties
Properties defprop = new Properties();
defprop.setProperty(OUTPUT_DIR, "./out");
defprop.setProperty(INPUT_DIR, "./in");
defprop.setProperty(ECLIPSE_PLUGINS_DIR, "./plugins");
defprop.setProperty(WALA_REPORT, "./wala_report.txt");
defprop.setProperty(J2EE_DIR, "./j2ee");
final String j2selib = guessJavaLib();
defprop.setProperty(J2SE_DIR, j2selib);
return defprop;
}
Properties result = new Properties();
result.load(propertyStream);
if (!result.containsKey(J2SE_DIR)) {
final String j2selib = guessJavaLib();
result.setProperty(J2SE_DIR, j2selib);
}
return result;
}
}
代码示例来源: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: wala/WALA
static String convertToAbsolute(String path) {
final File file = new File(path);
return (file.isAbsolute()) ? file.getAbsolutePath() : WalaProperties.getWalaHomeDir().concat(File.separator).concat(path);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
public static Properties loadPropertiesFromFile(ClassLoader loader, String fileName) throws IOException {
if (loader == null) {
throw new IllegalArgumentException("loader is null");
}
if (fileName == null) {
throw new IllegalArgumentException("null fileName");
}
try (final InputStream propertyStream = loader.getResourceAsStream(fileName)) {
if (propertyStream == null) {
// create default properties
Properties defprop = new Properties();
defprop.setProperty(OUTPUT_DIR, "./out");
defprop.setProperty(INPUT_DIR, "./in");
defprop.setProperty(ECLIPSE_PLUGINS_DIR, "./plugins");
defprop.setProperty(WALA_REPORT, "./wala_report.txt");
defprop.setProperty(J2EE_DIR, "./j2ee");
final String j2selib = guessJavaLib();
defprop.setProperty(J2SE_DIR, j2selib);
return defprop;
}
Properties result = new Properties();
result.load(propertyStream);
if (!result.containsKey(J2SE_DIR)) {
final String j2selib = guessJavaLib();
result.setProperty(J2SE_DIR, j2selib);
}
return result;
}
}
代码示例来源: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: 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: 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: com.ibm.wala/com.ibm.wala.core
public static Properties loadProperties() throws WalaException {
try {
Properties result = loadPropertiesFromFile(WalaProperties.class.getClassLoader(), PROPERTY_FILENAME);
String outputDir = result.getProperty(OUTPUT_DIR, DefaultPropertiesValues.DEFAULT_OUTPUT_DIR);
result.setProperty(OUTPUT_DIR, convertToAbsolute(outputDir));
String walaReport = result.getProperty(WALA_REPORT, DefaultPropertiesValues.DEFAULT_WALA_REPORT_FILENAME);
result.setProperty(WALA_REPORT, convertToAbsolute(walaReport));
return result;
} catch (Exception e) {
// e.printStackTrace();
throw new WalaException("Unable to set up wala properties ", e);
}
}
代码示例来源: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: 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
AnalysisScope scope = new JavaSourceAnalysisScope();
String[] stdlibs = WalaProperties.getJ2SEJarFiles();
for (String stdlib : stdlibs) {
scope.addToScope(ClassLoaderReference.Primordial, new JarFile(stdlib));
代码示例来源: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
/**
* 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
wp = WalaProperties.loadProperties();
wp.putAll(WalaExamplesProperties.loadProperties());
} catch (WalaException e) {
您好,下面是我在 AWS 中创建启用了弹性 IP 的实例的模板。但是我不确定我哪里出错了。我已经通过在线 json 验证器验证了 json,仍然面临问题请帮忙 { "AWSTemplateForm
标题有点乱,但已经说明了一切。我想在一个属性的属性上有一个属性观察器: class A { var b: B init() { b = B() } fu
假设我的一个 Controller 中有这样的方法: [Route("api/Products")] public IQueryable GetProducts() { return db.P
这有效: // @flow import React, {Component} from 'react'; type Props = {}; class Delete extends Componen
我有一个 ViewModelBase 类,我在其中为 INotifyPropertyChanged 接口(interface)定义了 RaisePropertyChanged 方法。大多数 MVVM
我创建了类: class StorageBase { public Queue Slices {get;set;} } 和 wpf 自定义控件,它具有 StorageBase 类型的依赖属性
我的 java 应用程序问题是 log4j2 系统日志不是写在 'local1.log' 中而是'消息'。我的/etc/rsyslog.conf 在/etc/rsyslog.conf 中配置为 'lo
为什么需要在对象中使用 this.property = property ?它是用来定义对象的“外部世界”的属性吗? function Person(property) { this.property
摘要: 这个问题是关于属性的继承与从彼此继承属性的类的内部和外部的不同读/写访问相结合。 详细信息: 我有一个类 A 和另一个继承自 A 的类 B。 A 中声明了属性someProperty。我希望该
我正在开发 ASP.NET MVC 应用,设计域模型,使用(测试)新的 EF Code First 功能。 我有一个可能有也可能没有截止日期的事件实体,处理它的最佳方法是什么? 1 个属性: publ
我在配置项目时经常使用它们,但大多数情况下都是按照指示添加 fragment 。我完全不知道哪个文件到底是做什么的。谁能清楚地说明每个文件的用途。 到目前为止我认为 local.properties
在运行 python 文件以使用 rasa nlu 训练文件时,我在命令提示符下收到此错误 我目前正在使用 Windows 10 rasa_core==0.8.2 rasa_nlu==0.11.4 p
我在这方面遇到了一些麻烦,尽管我已经搜索了答案,但还是找不到。 为了使用 AsyncAppender,我看到了很多不同的 log4j 配置,无论如何,它们都与 .properties 配置文件无关。
我正在编写一个 Python 类,并使用 @property 装饰器为该类创建属性。 我在文档中没有找到太多关于这个装饰器的信息,但是从我可以从 Stack Overflow 和我的 Python l
在 gradle 任务中,我可以创建这样的路径: System.env.FOLDER_PATH + '/subFolder' 但我想在我的 gradle.properties 中设置它,所以它会像 s
如何在属性文件的 log4j2 中创建键值对? 我知道在 log4j 版本 1 中它是这样完成的: log4j.appender.x.additionalFields={'key': 'value'}
我想通了 struct PropertyTest { @property int x() { return val; } @property void x( int newVal )
我有 REST (Jersey) webservice,它利用了一些编码/解码到/来自 XML 的数据对象。数据对象位于 webservice war 所依赖的单独项目/jar 中。 我使用 MOXy
我正在创建一个 LinkedList 类: function LinkedList(){ ... 有什么区别: this.addNode = function(data){
关于语义的快速问题:) 如果我正在编写一个协议(protocol),这是首选: // (a) @protocol MyProtocol @property (nonatomic, copy) NSSe
我是一名优秀的程序员,十分优秀!