File tree 1 file changed +34
-0
lines changed
src/main/java/com/ibm/wala/examples/analysisscope
1 file changed +34
-0
lines changed Original file line number Diff line number Diff line change
1
+ package com .ibm .wala .examples .analysisscope ;
2
+
3
+ import com .ibm .wala .core .util .config .AnalysisScopeReader ;
4
+ import com .ibm .wala .ipa .callgraph .AnalysisScope ;
5
+ import java .io .File ;
6
+ import java .io .IOException ;
7
+
8
+ /**
9
+ * This class shows two ways to create an {@link AnalysisScope}. for more information, check out
10
+ * https://github.com/wala/WALA/wiki/Analysis-Scope
11
+ */
12
+ public class AnalysisScopeExample {
13
+ /**
14
+ * @param classPath paths of jars to include in analysis scope, formatted as a Java classpath
15
+ * @return AnaylsisScope object created by makeJavaBinaryAnalysisScope
16
+ * @throws IOException
17
+ */
18
+ AnalysisScope makeAnalysisScope (String classPath ) throws IOException {
19
+ return AnalysisScopeReader .instance .makeJavaBinaryAnalysisScope (classPath , null );
20
+ }
21
+
22
+ /**
23
+ * @param scopeFilePath Location of a scope file in string form
24
+ * @param exclusionFilePath location of an exception file
25
+ * @return return an analysis scope object
26
+ * @throws IOException
27
+ */
28
+ AnalysisScope makeAnalysisScope (String scopeFilePath , String exclusionFilePath )
29
+ throws IOException {
30
+ File exclusionsFile = new File (exclusionFilePath );
31
+ return AnalysisScopeReader .instance .readJavaScope (
32
+ scopeFilePath , exclusionsFile , AnalysisScopeExample .class .getClassLoader ());
33
+ }
34
+ }
You can’t perform that action at this time.
0 commit comments