com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(9.0k)|赞(0)|评价(0)|浏览(151)

本文整理了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

Util.addBypassLogic介绍

[英]Modify an options object to include bypass logic as specified by a an XML file.
[中]修改选项对象以包含XML文件指定的旁路逻辑。

代码示例

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

  1. public static void addDefaultBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha) {
  2. if (nativeSpec == null) return;
  3. if (cl.getResourceAsStream(nativeSpec) != null) {
  4. addBypassLogic(options, scope, cl, nativeSpec, cha);
  5. } else {
  6. // try to load from filesystem
  7. try (final BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(nativeSpec))) {
  8. XMLMethodSummaryReader reader = new XMLMethodSummaryReader(bIn, scope);
  9. addBypassLogic(options, scope, cl, reader, cha);
  10. } catch (FileNotFoundException e) {
  11. System.err.println("Could not load natives xml file from: " + nativeSpec);
  12. e.printStackTrace();
  13. } catch (IOException e) {
  14. System.err.println("Could not close natives xml file " + nativeSpec);
  15. e.printStackTrace();
  16. }
  17. }
  18. }

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

  1. public static void addDefaultBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, IClassHierarchy cha) {
  2. if (nativeSpec == null) return;
  3. if (cl.getResourceAsStream(nativeSpec) != null) {
  4. addBypassLogic(options, scope, cl, nativeSpec, cha);
  5. } else {
  6. // try to load from filesystem
  7. try (final BufferedInputStream bIn = new BufferedInputStream(new FileInputStream(nativeSpec))) {
  8. XMLMethodSummaryReader reader = new XMLMethodSummaryReader(bIn, scope);
  9. addBypassLogic(options, scope, cl, reader, cha);
  10. } catch (FileNotFoundException e) {
  11. System.err.println("Could not load natives xml file from: " + nativeSpec);
  12. e.printStackTrace();
  13. } catch (IOException e) {
  14. System.err.println("Could not close natives xml file " + nativeSpec);
  15. e.printStackTrace();
  16. }
  17. }
  18. }

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

  1. /**
  2. * Modify an options object to include bypass logic as specified by a an XML file.
  3. *
  4. * @throws IllegalArgumentException if scope is null
  5. * @throws IllegalArgumentException if cl is null
  6. * @throws IllegalArgumentException if options is null
  7. * @throws IllegalArgumentException if scope is null
  8. */
  9. public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, String xmlFile,
  10. IClassHierarchy cha) throws IllegalArgumentException {
  11. if (scope == null) {
  12. throw new IllegalArgumentException("scope is null");
  13. }
  14. if (options == null) {
  15. throw new IllegalArgumentException("options is null");
  16. }
  17. if (cl == null) {
  18. throw new IllegalArgumentException("cl is null");
  19. }
  20. if (cha == null) {
  21. throw new IllegalArgumentException("cha cannot be null");
  22. }
  23. try (final InputStream s = cl.getResourceAsStream(xmlFile)) {
  24. XMLMethodSummaryReader summary = new XMLMethodSummaryReader(s, scope);
  25. addBypassLogic(options, scope, cl, summary, cha);
  26. } catch (IOException e) {
  27. System.err.println("Could not close XML method summary reader: " + e.getLocalizedMessage());
  28. e.printStackTrace();
  29. }
  30. }

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

  1. /**
  2. * Modify an options object to include bypass logic as specified by a an XML file.
  3. *
  4. * @throws IllegalArgumentException if scope is null
  5. * @throws IllegalArgumentException if cl is null
  6. * @throws IllegalArgumentException if options is null
  7. * @throws IllegalArgumentException if scope is null
  8. */
  9. public static void addBypassLogic(AnalysisOptions options, AnalysisScope scope, ClassLoader cl, String xmlFile,
  10. IClassHierarchy cha) throws IllegalArgumentException {
  11. if (scope == null) {
  12. throw new IllegalArgumentException("scope is null");
  13. }
  14. if (options == null) {
  15. throw new IllegalArgumentException("options is null");
  16. }
  17. if (cl == null) {
  18. throw new IllegalArgumentException("cl is null");
  19. }
  20. if (cha == null) {
  21. throw new IllegalArgumentException("cha cannot be null");
  22. }
  23. try (final InputStream s = cl.getResourceAsStream(xmlFile)) {
  24. XMLMethodSummaryReader summary = new XMLMethodSummaryReader(s, scope);
  25. addBypassLogic(options, scope, cl, summary, cha);
  26. } catch (IOException e) {
  27. System.err.println("Could not close XML method summary reader: " + e.getLocalizedMessage());
  28. e.printStackTrace();
  29. }
  30. }

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

  1. /**
  2. * @param options options that govern call graph construction
  3. * @param cha governing class hierarchy
  4. * @param cl classloader that can find WALA resources
  5. * @param scope representation of the analysis scope
  6. * @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
  7. * @return a 0-1-Opt-CFA Call Graph Builder.
  8. * @throws IllegalArgumentException if options is null
  9. * @throws IllegalArgumentException if xmlFiles == null
  10. */
  11. public static SSAPropagationCallGraphBuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha,
  12. ClassLoader cl, AnalysisScope scope, String[] xmlFiles, byte instancePolicy) throws IllegalArgumentException {
  13. if (xmlFiles == null) {
  14. throw new IllegalArgumentException("xmlFiles == null");
  15. }
  16. if (options == null) {
  17. throw new IllegalArgumentException("options is null");
  18. }
  19. Util.addDefaultSelectors(options, cha);
  20. for (String xmlFile : xmlFiles) {
  21. Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  22. }
  23. return new ZeroXCFABuilder(Language.JAVA, cha, options, cache, null, null, instancePolicy);
  24. }

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

  1. /**
  2. * @param options options that govern call graph construction
  3. * @param cha governing class hierarchy
  4. * @param cl classloader that can find WALA resources
  5. * @param scope representation of the analysis scope
  6. * @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
  7. * @return a 0-1-Opt-CFA Call Graph Builder.
  8. * @throws IllegalArgumentException if options is null
  9. * @throws IllegalArgumentException if xmlFiles == null
  10. */
  11. public static SSAPropagationCallGraphBuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha,
  12. ClassLoader cl, AnalysisScope scope, String[] xmlFiles, byte instancePolicy) throws IllegalArgumentException {
  13. if (xmlFiles == null) {
  14. throw new IllegalArgumentException("xmlFiles == null");
  15. }
  16. if (options == null) {
  17. throw new IllegalArgumentException("options is null");
  18. }
  19. Util.addDefaultSelectors(options, cha);
  20. for (String xmlFile : xmlFiles) {
  21. Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  22. }
  23. return new ZeroXCFABuilder(Language.JAVA, cha, options, cache, null, null, instancePolicy);
  24. }

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

  1. /**
  2. * @param options options that govern call graph construction
  3. * @param cha governing class hierarchy
  4. * @param cl classloader that can find DOMO resources
  5. * @param scope representation of the analysis scope
  6. * @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
  7. * @return a 0-1-Opt-CFA Call Graph Builder.
  8. */
  9. public static AstJavaCFABuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
  10. AnalysisScope scope, String[] xmlFiles, byte instancePolicy) {
  11. com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
  12. for (String xmlFile : xmlFiles) {
  13. com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  14. }
  15. return new AstJavaZeroXCFABuilder(cha, options, cache, null, null, instancePolicy);
  16. }

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

  1. /**
  2. * @param options options that govern call graph construction
  3. * @param cha governing class hierarchy
  4. * @param cl classloader that can find DOMO resources
  5. * @param scope representation of the analysis scope
  6. * @param xmlFiles set of Strings that are names of XML files holding bypass logic specifications.
  7. * @return a 0-1-Opt-CFA Call Graph Builder.
  8. */
  9. public static AstJavaCFABuilder make(AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
  10. AnalysisScope scope, String[] xmlFiles, byte instancePolicy) {
  11. com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
  12. for (String xmlFile : xmlFiles) {
  13. com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  14. }
  15. return new AstJavaZeroXCFABuilder(cha, options, cache, null, null, instancePolicy);
  16. }

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

  1. /**
  2. * @param options
  3. * options that govern call graph construction
  4. * @param cha
  5. * governing class hierarchy
  6. * @param cl
  7. * classloader that can find DOMO resources
  8. * @param scope
  9. * representation of the analysis scope
  10. * @param xmlFiles
  11. * set of Strings that are names of XML files holding bypass logic
  12. * specifications.
  13. * @return a 0-1-Opt-CFA Call Graph Builder.
  14. */
  15. public static JSCFABuilder make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
  16. AnalysisScope scope, String[] xmlFiles, byte instancePolicy, boolean doOneCFA) {
  17. com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
  18. for (String xmlFile : xmlFiles) {
  19. com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  20. }
  21. return new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, instancePolicy, doOneCFA);
  22. }

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

  1. /**
  2. * @param options
  3. * options that govern call graph construction
  4. * @param cha
  5. * governing class hierarchy
  6. * @param cl
  7. * classloader that can find DOMO resources
  8. * @param scope
  9. * representation of the analysis scope
  10. * @param xmlFiles
  11. * set of Strings that are names of XML files holding bypass logic
  12. * specifications.
  13. * @return a 0-1-Opt-CFA Call Graph Builder.
  14. */
  15. public static JSCFABuilder make(JSAnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, ClassLoader cl,
  16. AnalysisScope scope, String[] xmlFiles, byte instancePolicy, boolean doOneCFA) {
  17. com.ibm.wala.ipa.callgraph.impl.Util.addDefaultSelectors(options, cha);
  18. for (String xmlFile : xmlFiles) {
  19. com.ibm.wala.ipa.callgraph.impl.Util.addBypassLogic(options, scope, cl, xmlFile, cha);
  20. }
  21. return new JSZeroOrOneXCFABuilder(cha, options, cache, null, null, instancePolicy, doOneCFA);
  22. }

相关文章