Normalized indentation.
This commit is contained in:
parent
86b16bd570
commit
30c886d95d
|
@ -41,32 +41,32 @@ public class PlugInUtil {
|
|||
}
|
||||
|
||||
public static void populateScope(JavaSourceAnalysisEngine engine, Collection<String> sources, List<String> libs) {
|
||||
if (null != libs ){
|
||||
boolean foundLib = false;
|
||||
for (String lib : libs) {
|
||||
File libFile = new File(lib);
|
||||
if (libFile.exists()) {
|
||||
foundLib = true;
|
||||
try {
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile, false)));
|
||||
} catch (IOException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
assert foundLib : "couldn't find library file from " + libs;
|
||||
}
|
||||
if (null != libs ) {
|
||||
boolean foundLib = false;
|
||||
for (String lib : libs) {
|
||||
File libFile = new File(lib);
|
||||
if (libFile.exists()) {
|
||||
foundLib = true;
|
||||
try {
|
||||
engine.addSystemModule(new JarFileModule(new JarFile(libFile, false)));
|
||||
} catch (IOException e) {
|
||||
Assert.fail(e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
assert foundLib : "couldn't find library file from " + libs;
|
||||
}
|
||||
|
||||
for (String srcFilePath : sources) {
|
||||
String srcFileName = srcFilePath.substring(srcFilePath.lastIndexOf(File.separator) + 1);
|
||||
File f = new File(srcFilePath);
|
||||
Assert.assertTrue("couldn't find " + srcFilePath, f.exists());
|
||||
if (f.isDirectory()) {
|
||||
engine.addSourceModule(new SourceDirectoryTreeModule(f));
|
||||
} else {
|
||||
engine.addSourceModule(new SourceFileModule(f, srcFileName, null));
|
||||
}
|
||||
}
|
||||
for (String srcFilePath : sources) {
|
||||
String srcFileName = srcFilePath.substring(srcFilePath.lastIndexOf(File.separator) + 1);
|
||||
File f = new File(srcFilePath);
|
||||
Assert.assertTrue("couldn't find " + srcFilePath, f.exists());
|
||||
if (f.isDirectory()) {
|
||||
engine.addSourceModule(new SourceDirectoryTreeModule(f));
|
||||
} else {
|
||||
engine.addSourceModule(new SourceFileModule(f, srcFileName, null));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -74,17 +74,17 @@ public class PlugInUtil {
|
|||
|
||||
public static JavaSourceAnalysisEngine
|
||||
createECJJavaEngine(Collection<String> sources, List<String> libs, final String [] entryPoints) {
|
||||
JavaSourceAnalysisEngine engine=null;
|
||||
if(null == entryPoints){
|
||||
engine = new ECJJavaSourceAnalysisEngine();
|
||||
}else{
|
||||
engine = new ECJJavaSourceAnalysisEngine() {
|
||||
JavaSourceAnalysisEngine engine=null;
|
||||
if(null == entryPoints) {
|
||||
engine = new ECJJavaSourceAnalysisEngine();
|
||||
} else {
|
||||
engine = new ECJJavaSourceAnalysisEngine() {
|
||||
@Override
|
||||
protected Iterable<Entrypoint> makeDefaultEntrypoints(AnalysisScope scope, IClassHierarchy cha) {
|
||||
return Util.makeMainEntrypoints(JavaSourceAnalysisScope.SOURCE,cha, entryPoints);
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
engine.setExclusionsFile(REGRESSION_EXCLUSIONS);
|
||||
populateScope(engine, sources, libs);
|
||||
return engine;
|
||||
|
|
|
@ -14,32 +14,32 @@ import com.ibm.wala.ssa.SSAInstruction;
|
|||
|
||||
public class SSAInstructionKey {
|
||||
|
||||
private final SSAInstruction key;
|
||||
public SSAInstructionKey(SSAInstruction key) {
|
||||
this.key = key;
|
||||
}
|
||||
private final SSAInstruction key;
|
||||
public SSAInstructionKey(SSAInstruction key) {
|
||||
this.key = key;
|
||||
}
|
||||
|
||||
public int hashCode(){
|
||||
return key.hashCode();
|
||||
}
|
||||
public int hashCode() {
|
||||
return key.hashCode();
|
||||
}
|
||||
|
||||
public String toString(){
|
||||
if (null == key){
|
||||
return "null (key)";
|
||||
}else{
|
||||
return key.toString();
|
||||
}
|
||||
}
|
||||
public String toString() {
|
||||
if (null == key) {
|
||||
return "null (key)";
|
||||
} else {
|
||||
return key.toString();
|
||||
}
|
||||
}
|
||||
|
||||
public boolean equals(Object obj){
|
||||
if (null == obj){
|
||||
return false;
|
||||
}else{
|
||||
if (obj instanceof SSAInstructionKey){
|
||||
return key == ((SSAInstructionKey) obj).key;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
public boolean equals(Object obj) {
|
||||
if (null == obj) {
|
||||
return false;
|
||||
} else {
|
||||
if (obj instanceof SSAInstructionKey) {
|
||||
return key == ((SSAInstructionKey) obj).key;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,8 +95,8 @@ public class SuperGraphUtil {
|
|||
}
|
||||
} else {
|
||||
if(!acceptedMethods.contains(method)) {
|
||||
log.debug("supergraph cut at '" + bbic.getNumber() + " -> " + nextChild.getNumber() + " ("
|
||||
+ nextChild.toString() + ")'");
|
||||
log.debug("supergraph cut at '" + bbic.getNumber() + " -> " + nextChild.getNumber() + " ("
|
||||
+ nextChild.toString() + ")'");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
@ -173,8 +173,8 @@ public class SuperGraphUtil {
|
|||
}
|
||||
if(mainEntryId == 0 && mainExitId == 0) {
|
||||
log.error(" "+entryClass + "." + entryMethod +
|
||||
": empty entry method, ensure invocation in main method " +
|
||||
"(mainEntryId = " +mainEntryId + " / mainExitId = " + mainExitId + ")");
|
||||
": empty entry method, ensure invocation in main method " +
|
||||
"(mainEntryId = " +mainEntryId + " / mainExitId = " + mainExitId + ")");
|
||||
return -1;
|
||||
}
|
||||
HashSet<Integer> relevantIDs = new HashSet<Integer>();
|
||||
|
@ -207,14 +207,14 @@ public class SuperGraphUtil {
|
|||
buildAdjacencyLists(sg, sgNodes, sgNodesReversed, adjList, adjListReverse, emptyNodes, relevantIDs);
|
||||
|
||||
// <<< print original adjacency list to log
|
||||
log.debug("adjacency list before removing empty nodes:");
|
||||
AnalysisUtil.printAdjList(adjList, log);
|
||||
log.debug("adjacency list before removing empty nodes:");
|
||||
AnalysisUtil.printAdjList(adjList, log);
|
||||
//
|
||||
if(removeEmptyNodes) {
|
||||
removeEmptyNodes(emptyNodes, adjList, adjListReverse, sgNodes, sgNodesReversed);
|
||||
// <<< print adjacency list to log
|
||||
log.debug("adjacency after removing empty nodes:");
|
||||
AnalysisUtil.printAdjList(adjList, log);
|
||||
log.debug("adjacency after removing empty nodes:");
|
||||
AnalysisUtil.printAdjList(adjList, log);
|
||||
//
|
||||
}
|
||||
|
||||
|
@ -483,10 +483,10 @@ public class SuperGraphUtil {
|
|||
HashMap<Integer, ArrayList<Integer>> adjList,
|
||||
HashMap<Integer, HashSet<ArrayList<Integer>>> paths) {
|
||||
|
||||
log.debug(" searching for "+currentId+" in adjList.");
|
||||
log.debug(" searching for "+currentId+" in adjList.");
|
||||
ArrayList<Integer> children = adjList.get(currentId);
|
||||
if (null == children) {
|
||||
throw new RuntimeException ("No entry found in adjList for "+currentId);
|
||||
throw new RuntimeException ("No entry found in adjList for "+currentId);
|
||||
}
|
||||
HashSet<ArrayList<Integer>> currentPaths = new HashSet<ArrayList<Integer>>();
|
||||
|
||||
|
@ -541,8 +541,8 @@ public class SuperGraphUtil {
|
|||
vc.pop();
|
||||
vc.push();
|
||||
if(expr.toString().equalsIgnoreCase("null")) {
|
||||
log.debug(" isNotMutuallyExclusive: EXPR: "+expr+" is NULL (combinedConditions: "
|
||||
+ combinedConditions + "/ expressions: " + expressions +")");
|
||||
log.debug(" isNotMutuallyExclusive: EXPR: "+expr+" is NULL (combinedConditions: "
|
||||
+ combinedConditions + "/ expressions: " + expressions +")");
|
||||
return true;
|
||||
}
|
||||
SatResult satResult = vc.checkUnsat(expr);
|
||||
|
|
Loading…
Reference in New Issue