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 4aee1230..1aed7557 100644 --- a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java +++ b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java @@ -23,8 +23,7 @@ public class InterproceduralOverrideAssignment extends SceneTransformer implemen private PointsToAnalysis pta; private AbstractMergeConflictDefinition definition; - // TODO dataflowabstraction provavelmente deve ser subustituido por algo que faça mais sentido na analise inter procedural - // TODO Adicionar tratamento de if, loops... (ForwardFlowAnalysis) + // TODO Add treatment of if, loops ... (ForwardFlowAnalysis) private FlowSet res; private Body body; @@ -161,9 +160,9 @@ private void gen(Statement stmt) { private void kill(Unit unit) { for (DataFlowAbstraction dataFlowAbstraction : res) { - // TODO extrair metodo res.removeAll(unit.getDefBoxes()) + // TODO extract method res.removeAll (unit.getDefBoxes ()) for (ValueBox valueBox : unit.getDefBoxes()) { - if (compareItens(valueBox, dataFlowAbstraction)) { + if (isSameVariable(valueBox, dataFlowAbstraction)) { res.remove(dataFlowAbstraction); } } @@ -204,7 +203,7 @@ private void detectConflict(Unit u, Statement.Type changeTag, SootMethod sm) { private void checkConflicts(Unit unit, List potentialConflictingAssignments, Statement.Type changeTag, SootMethod sm) { for (DataFlowAbstraction dataFlowAbstraction : potentialConflictingAssignments) { for (ValueBox valueBox : unit.getDefBoxes()) { - if (compareItens(valueBox, dataFlowAbstraction)) { + if (isSameVariable(valueBox, dataFlowAbstraction)) { Conflict c = new Conflict(getStatementAssociatedWithUnit(sm, unit, changeTag), dataFlowAbstraction.getStmt()); conflicts.add(c); System.out.println(c); @@ -213,9 +212,8 @@ private void checkConflicts(Unit unit, List potentialConfli } } - // TODO improve method name // TODO need to treat other cases (Arrays...) - private boolean compareItens(ValueBox valueBox, DataFlowAbstraction dataFlowAbstraction) { + private boolean isSameVariable(ValueBox valueBox, DataFlowAbstraction dataFlowAbstraction) { // TODO check why equivTo(Object o) doesn't work if (valueBox.getValue() instanceof InstanceFieldRef && dataFlowAbstraction.getFieldRef() != null) { return valueBox.getValue().equivHashCode() == dataFlowAbstraction.getFieldRef().equivHashCode();