本文整理了Java中com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic()
方法的一些代码示例,展示了Util.addBypassLogic()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.addBypassLogic()
方法的具体详情如下:
包路径:com.ibm.wala.ipa.callgraph.impl.Util
类名称:Util
方法名:addBypassLogic
[英]Modify an options object to include bypass logic as specified by a an XML file.
[中]修改选项对象以包含XML文件指定的旁路逻辑。
代码示例来源:origin: wala/WALA
public static void addDefaultBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha) {
if (nativeSpec == null) return;
if (cl.getResourceAsStream(nativeSpec) != null) {
addBypassLogic(options, scope, cl, nativeSpec, cha);
} else {
// try to load from filesystem
try (final BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(nativeSpec))) {
XMLMethodSummaryReader reader = new XMLMethodSummaryReader(bIn, scope);
addBypassLogic(options, scope, cl, reader, cha);
} catch (FileNotFoundException e) {
System.err.println("Could not load natives xml file from: " + nativeSpec);
e.printStackTrace();
} catch (IOException e) {
System.err.println("Could not close natives xml file " + nativeSpec);
e.printStackTrace();
}
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
public static void addDefaultBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha) {
if (nativeSpec == null) return;
if (cl.getResourceAsStream(nativeSpec) != null) {
addBypassLogic(options, scope, cl, nativeSpec, cha);
} else {
// try to load from filesystem
try (final BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(nativeSpec))) {
XMLMethodSummaryReader reader = new XMLMethodSummaryReader(bIn, scope);
addBypassLogic(options, scope, cl, reader, cha);
} catch (FileNotFoundException e) {
System.err.println("Could not load natives xml file from: " + nativeSpec);
e.printStackTrace();
} catch (IOException e) {
System.err.println("Could not close natives xml file " + nativeSpec);
e.printStackTrace();
}
}
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* Modify an options object to include bypass logic as specified by a an XML file.
*
* @throws IllegalArgumentException if scope is null
* @throws IllegalArgumentException if cl is null
* @throws IllegalArgumentException if options is null
* @throws IllegalArgumentException if scope is null
*/
public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, String xmlFile,
IClassHierarchy cha) throws IllegalArgumentException {
if (scope == null) {
throw new IllegalArgumentException("scope is null");
}
if (options == null) {
throw new IllegalArgumentException("options is null");
}
if (cl == null) {
throw new IllegalArgumentException("cl is null");
}
if (cha == null) {
throw new IllegalArgumentException("cha cannot be null");
}
try (final InputStream s = cl.getResourceAsStream(xmlFile)) {
XMLMethodSummaryReader summary = new XMLMethodSummaryReader(s, scope);
addBypassLogic(options, scope, cl, summary, cha);
} catch (IOException e) {
System.err.println("Could not close XML method summary reader: " + e.getLocalizedMessage());
e.printStackTrace();
}
}
代码示例来源:origin: wala/WALA
/**
* Modify an options object to include bypass logic as specified by a an XML file.
*
* @throws IllegalArgumentException if scope is null
* @throws IllegalArgumentException if cl is null
* @throws IllegalArgumentException if options is null
* @throws IllegalArgumentException if scope is null
*/
public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, String xmlFile,
IClassHierarchy cha) throws IllegalArgumentException {
if (scope == null) {
throw new IllegalArgumentException("scope is null");
}
if (options == null) {
throw new IllegalArgumentException("options is null");
}
if (cl == null) {
throw new IllegalArgumentException("cl is null");
}
if (cha == null) {
throw new IllegalArgumentException("cha cannot be null");
}
try (final InputStream s = cl.getResourceAsStream(xmlFile)) {
XMLMethodSummaryReader summary = new XMLMethodSummaryReader(s, scope);
addBypassLogic(options, scope, cl, summary, cha);
} catch (IOException e) {
System.err.println("Could not close XML method summary reader: " + e.getLocalizedMessage());
e.printStackTrace();
}
}
代码示例来源:origin: wala/WALA
/**
* @param options options that govern call graph construction
* @param cha governing class hierarchy
* @param cl classloader that can find WALA resources
* @param scope representation of the analysis scope
* @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
* @throws IllegalArgumentException if options is null
* @throws IllegalArgumentException if xmlFiles == null
*/
public static SSAPropagationCallGraphBuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha,
ClassLoader cl, AnalysisScope scope, String[] xmlFiles, byte instancePolicy) throws IllegalArgumentException {
if (xmlFiles == null) {
throw new IllegalArgumentException("xmlFiles == null");
}
if (options == null) {
throw new IllegalArgumentException("options is null");
}
Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new ZeroXCFABuilder(Language.JAVA, cha, options, cache, null, null, instancePolicy);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.core
/**
* @param options options that govern call graph construction
* @param cha governing class hierarchy
* @param cl classloader that can find WALA resources
* @param scope representation of the analysis scope
* @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
* @throws IllegalArgumentException if options is null
* @throws IllegalArgumentException if xmlFiles == null
*/
public static SSAPropagationCallGraphBuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha,
ClassLoader cl, AnalysisScope scope, String[] xmlFiles, byte instancePolicy) throws IllegalArgumentException {
if (xmlFiles == null) {
throw new IllegalArgumentException("xmlFiles == null");
}
if (options == null) {
throw new IllegalArgumentException("options is null");
}
Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new ZeroXCFABuilder(Language.JAVA, cha, options, cache, null, null, instancePolicy);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.cast.java
/**
* @param options options that govern call graph construction
* @param cha governing class hierarchy
* @param cl classloader that can find DOMO resources
* @param scope representation of the analysis scope
* @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
*/
public static AstJavaCFABuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
AnalysisScope scope, String[] xmlFiles, byte instancePolicy) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new AstJavaZeroXCFABuilder(cha, options, cache, null, null, instancePolicy);
}
代码示例来源:origin: wala/WALA
/**
* @param options options that govern call graph construction
* @param cha governing class hierarchy
* @param cl classloader that can find DOMO resources
* @param scope representation of the analysis scope
* @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
*/
public static AstJavaCFABuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
AnalysisScope scope, String[] xmlFiles, byte instancePolicy) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new AstJavaZeroXCFABuilder(cha, options, cache, null, null, instancePolicy);
}
代码示例来源:origin: wala/WALA
/**
* @param options
* options that govern call graph construction
* @param cha
* governing class hierarchy
* @param cl
* classloader that can find DOMO resources
* @param scope
* representation of the analysis scope
* @param xmlFiles
* set of Strings that are names of XML files holding bypass logic
* specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
*/
public static JSCFABuilder make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
AnalysisScope scope, String[] xmlFiles, byte instancePolicy, boolean doOneCFA) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, instancePolicy, doOneCFA);
}
代码示例来源:origin: com.ibm.wala/com.ibm.wala.cast.js
/**
* @param options
* options that govern call graph construction
* @param cha
* governing class hierarchy
* @param cl
* classloader that can find DOMO resources
* @param scope
* representation of the analysis scope
* @param xmlFiles
* set of Strings that are names of XML files holding bypass logic
* specifications.
* @return a 0-1-Opt-CFA Call Graph Builder.
*/
public static JSCFABuilder make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
AnalysisScope scope, String[] xmlFiles, byte instancePolicy, boolean doOneCFA) {
com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
for (String xmlFile : xmlFiles) {
com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
}
return new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, instancePolicy, doOneCFA);
}
内容来源于网络,如有侵权,请联系作者删除!