forked from spgroup/conflict-static-analysis
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1580c0f
commit 97c4131
Showing
6 changed files
with
179 additions
and
36 deletions.
There are no files selected for viewing
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
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
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
55 changes: 55 additions & 0 deletions
55
src/main/java/br/unb/cic/analysis/model/TraversedLine.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,55 @@ | ||
package br.unb.cic.analysis.model; | ||
|
||
import soot.SootClass; | ||
import soot.SootMethod; | ||
|
||
public class TraversedLine { | ||
protected SootClass sootClass; | ||
protected SootMethod sootMethod; | ||
protected Integer lineNumber; | ||
|
||
public TraversedLine(SootClass sootClass, SootMethod sootMethod, Integer lineNumber) { | ||
this.sootClass = sootClass; | ||
this.sootMethod = sootMethod; | ||
this.lineNumber = lineNumber; | ||
} | ||
|
||
public TraversedLine(SootMethod sootMethod, Integer lineNumber) { | ||
this.sootClass = sootMethod.getDeclaringClass(); | ||
this.sootMethod = sootMethod; | ||
this.lineNumber = lineNumber; | ||
} | ||
|
||
public SootClass getSootClass() { | ||
return sootClass; | ||
} | ||
|
||
public void setSootClass(SootClass sootClass) { | ||
this.sootClass = sootClass; | ||
} | ||
|
||
public SootMethod getSootMethod() { | ||
return sootMethod; | ||
} | ||
|
||
public void setSootMethod(SootMethod sootMethod) { | ||
this.sootMethod = sootMethod; | ||
} | ||
|
||
public Integer getLineNumber() { | ||
return lineNumber; | ||
} | ||
|
||
public void setLineNumber(Integer lineNumber) { | ||
this.lineNumber = lineNumber; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "Stacktrace{" + | ||
"sootClass=" + sootClass.getShortJavaStyleName() + | ||
", sootMethod=" + sootMethod.getSubSignature() + | ||
", lineNumber=" + lineNumber + | ||
'}'; | ||
} | ||
} |
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
29 changes: 29 additions & 0 deletions
29
src/test/java/br/unb/cic/analysis/samples/ioa/StacktraceConflictSample.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,29 @@ | ||
package br.unb.cic.analysis.samples.ioa; | ||
|
||
// Conflict: [left, m():11] --> [right, m():12] | ||
public class StacktraceConflictSample { | ||
private int x, y; | ||
|
||
public void main() { | ||
StacktraceConflictSample m = new StacktraceConflictSample(); | ||
|
||
m.foo(); // LEFT | ||
m.bar(); // RIGHT | ||
} | ||
|
||
private void foo() { | ||
qux(); | ||
System.out.println(); | ||
y = 1; | ||
} | ||
|
||
private void bar() { | ||
x = 2; | ||
y = 2; | ||
} | ||
|
||
private void qux() { | ||
x = 3; | ||
System.out.println(); | ||
} | ||
} |