-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AnalysisScope example #11
Merged
Merged
Changes from 6 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
eecf360
initial commit
jerryxu158 269c7f3
initial commit
jerryxu158 e49b1da
JavaDoc creation & removal of static keyword on import
jerryxu158 9626f97
hopefully finished the scope file example implementation
jerryxu158 4c2c8b4
fixed scope file input
jerryxu158 62d2d6d
changed param names, renamed class
jerryxu158 f8dbf0d
changed exception to exlcusion
jerryxu158 6d0c5ce
Merge branch 'master' into AnaylsisScope
msridhar 66cf8de
tweaks
msridhar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
40 changes: 40 additions & 0 deletions
40
src/main/java/com/ibm/wala/examples/analysisscope/AnalysisScopeExample.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
package com.ibm.wala.examples.analysisscope; | ||
|
||
import com.ibm.wala.ipa.callgraph.AnalysisScope; | ||
import com.ibm.wala.ipa.callgraph.AnalysisScope; | ||
import com.ibm.wala.util.config.FileOfClasses; | ||
import com.ibm.wala.util.config.AnalysisScopeReader; | ||
|
||
import java.io.File; | ||
import java.io.IOException; | ||
import com.ibm.wala.util.config.AnalysisScopeReader; | ||
|
||
/** | ||
* This file is an example of 2 ways to create an analysis scope. | ||
* for more information on analysis scopes, please check out https://github.com/wala/WALA/wiki/Analysis-Scope | ||
* | ||
*/ | ||
|
||
|
||
public class AnalysisScopeExample { | ||
/** | ||
* @param classPath paths of jars to include in analysis scope, formatted as a Java classpath | ||
* @return AnaylsisScope object created by makeJavaBinaryAnalysisScope | ||
* @throws IOException | ||
*/ | ||
AnalysisScope makeAnalysisScope(String classPath) throws IOException { | ||
return AnalysisScopeReader.makeJavaBinaryAnalysisScope(classPath, null); | ||
} | ||
|
||
/** | ||
* | ||
* @param scopeFilePath Location of a scope file in string form | ||
* @param exceptionFilePath location of an exception file | ||
* @return return an analysis scope object | ||
* @throws IOException | ||
*/ | ||
AnalysisScope makeAnalysisScope(String scopeFilePath, String exceptionFilePath) throws IOException{ | ||
File exception = new File(exceptionFilePath); | ||
return AnalysisScopeReader.readJavaScope(scopeFilePath, exception, AnalysisScopeExample.class.getClassLoader()); | ||
} | ||
} |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Everywhere you write
exception
it should beexclusion
. These files give a pattern of which Java packages to exclude from the scope