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 e4e03542..03e438ac 100644 --- a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java +++ b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java @@ -99,7 +99,7 @@ private void runAnalyzeWithBaseUnit(SootMethod sm, List traversed, S private void runAnalyze(SootMethod sm, List traversed, Statement.Type changeTag, Unit unit, boolean tagged) { if (unit instanceof AssignStmt) { /* TODO Does AssignStmt check contain objects, arrays or other types? - Yes, sssignStmt handles assignments and they can be of any type as long as they follow the structure: variable = value + Yes, AssignStmt handles assignments and they can be of any type as long as they follow the structure: variable = value */ AssignStmt assignStmt = (AssignStmt) unit; @@ -159,9 +159,9 @@ private void gen(Statement stmt) { } private void kill(Unit unit) { - for (DataFlowAbstraction dataFlowAbstraction : res) { + res.forEach(dataFlowAbstraction -> { removeAll(unit.getDefBoxes(), dataFlowAbstraction); - } + }); } private void removeAll(List defBoxes, DataFlowAbstraction dataFlowAbstraction) { @@ -204,15 +204,15 @@ private void detectConflict(Unit u, Statement.Type changeTag, SootMethod sm) { * Checks if there is a conflict and if so adds it to the conflict list. */ private void checkConflicts(Unit unit, List potentialConflictingAssignments, Statement.Type changeTag, SootMethod sm) { - for (DataFlowAbstraction dataFlowAbstraction : potentialConflictingAssignments) { - for (ValueBox valueBox : unit.getDefBoxes()) { + potentialConflictingAssignments.forEach(dataFlowAbstraction -> { + unit.getDefBoxes().forEach(valueBox -> { if (isSameVariable(valueBox, dataFlowAbstraction)) { Conflict c = new Conflict(getStatementAssociatedWithUnit(sm, unit, changeTag), dataFlowAbstraction.getStmt()); conflicts.add(c); System.out.println(c); } - } - } + }); + }); } // TODO need to treat other cases (Arrays...) @@ -228,7 +228,6 @@ private boolean isSameVariable(ValueBox valueBox, DataFlowAbstraction dataFlowAb return false; } - /* * Returns the Statement changeTag */