diff --git a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java index 0cbdb194..391ebead 100644 --- a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java +++ b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java @@ -276,7 +276,7 @@ private boolean isInLeftStatementFlow(Statement.Type flowChangeTag) { } private boolean isInLeftAndRightStatementFlow(Statement.Type flowChangeTag) { - return flowChangeTag.equals(Statement.Type.BOTH); + return flowChangeTag.equals(Statement.Type.SOURCE_SINK); } // TODO add depth to InstanceFieldRef and StaticFieldRef... @@ -374,7 +374,7 @@ private String getArrayRefName(ArrayRef arrayRef) { private Statement getStatementAssociatedWithUnit(SootMethod sootMethod, Unit u, Statement.Type flowChangeTag) { if (isLeftAndRightUnit(u) || isInLeftAndRightStatementFlow(flowChangeTag) || isBothUnitOrBothStatementFlow(u, flowChangeTag)) { - return createStatement(sootMethod, u, Statement.Type.BOTH); + return createStatement(sootMethod, u, Statement.Type.SOURCE_SINK); } else if (isLeftUnit(u)) { return findLeftStatement(u); } else if (isRightUnit(u)) { @@ -388,7 +388,7 @@ private Statement getStatementAssociatedWithUnit(SootMethod sootMethod, Unit u, } private void setStackTraceInStmt(Statement stmt) { - stmt.setStacktrace(new ArrayList(this.stacktraceList)); + stmt.setTraversedLine(new ArrayList(this.stacktraceList)); } private void addStackTrace(TraversedLine traversedLine) { @@ -445,6 +445,6 @@ private boolean isLeftStatement(Statement stmt) { } private boolean isLefAndRightStatement(Statement stmt) { - return stmt.getType().equals(Statement.Type.BOTH); + return stmt.getType().equals(Statement.Type.SOURCE_SINK); } } diff --git a/src/main/java/br/unb/cic/analysis/model/Conflict.java b/src/main/java/br/unb/cic/analysis/model/Conflict.java index 455e4119..36e2fdf4 100644 --- a/src/main/java/br/unb/cic/analysis/model/Conflict.java +++ b/src/main/java/br/unb/cic/analysis/model/Conflict.java @@ -28,12 +28,12 @@ public Conflict(Statement source, Statement sink) { this.sourceMethodName = source.getSootMethod().getName(); this.sourceLineNumber = source.getSourceCodeLineNumber(); this.sourceUnit = source.getUnit(); - this.sourceTraversedLine = source.getStacktrace(); + this.sourceTraversedLine = source.getTraversedLine(); this.sinkClassName = sink.getSootClass().getName(); this.sinkMethodName = sink.getSootMethod().getName(); this.sinkLineNumber = sink.getSourceCodeLineNumber(); this.sinkUnit = sink.getUnit(); - this.sinkTraversedLine = sink.getStacktrace(); + this.sinkTraversedLine = sink.getTraversedLine(); } @Deprecated diff --git a/src/main/java/br/unb/cic/analysis/model/Statement.java b/src/main/java/br/unb/cic/analysis/model/Statement.java index c80eb60a..8fc1b554 100644 --- a/src/main/java/br/unb/cic/analysis/model/Statement.java +++ b/src/main/java/br/unb/cic/analysis/model/Statement.java @@ -4,8 +4,13 @@ import soot.SootMethod; import soot.Unit; import soot.ValueBox; -import soot.jimple.*; +import soot.jimple.AssignStmt; +import soot.jimple.InstanceInvokeExpr; +import soot.jimple.InvokeExpr; +import soot.jimple.InvokeStmt; +import java.util.ArrayList; +import java.util.List; import java.util.Objects; /** @@ -31,18 +36,20 @@ public static StatementBuilder builder() { return builder; } - private SootClass sootClass; - private SootMethod sootMethod; - private Unit unit; + private SootClass sootClass; + private SootMethod sootMethod; + private Unit unit; private Type type; private Integer sourceCodeLineNumber; - + private List traversedLine; + Statement(SootClass sootClass, SootMethod sootMethod, Unit unit, Type type, Integer sourceCodeLineNumber) { this.sootClass = sootClass; this.sootMethod = sootMethod; this.unit = unit; this.type = type; this.sourceCodeLineNumber = sourceCodeLineNumber; + this.traversedLine = new ArrayList<>(); } public SootClass getSootClass() { @@ -65,6 +72,14 @@ public Integer getSourceCodeLineNumber() { return sourceCodeLineNumber; } + public List getTraversedLine() { + return traversedLine; + } + + public void setTraversedLine(List traversedLine) { + this.traversedLine = traversedLine; + } + @Override public boolean equals(Object o) { if (this == o) return true;