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 c7550094..81898ee2 100644 --- a/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java +++ b/src/main/java/br/unb/cic/analysis/ioa/InterproceduralOverrideAssignment.java @@ -80,7 +80,7 @@ private void traverse(SootMethod sm, List traversed, Statement.Type detectConflict(res, unit, changeTag, sm); - if ((isLeftStatement(unit) || isRightStatement(unit)) || (isInLeftStatementFLow(changeTag) || isInRightStatementFLow(changeTag))) { + if (isTagged(changeTag, unit)) { // TODO mover if e else para metodos diferentes if (unit instanceof AssignStmt) { // TODO Verificar AssignStmt contem objetos, arrays ou outros tipos? @@ -123,6 +123,10 @@ private void traverse(SootMethod sm, List traversed, Statement.Type }); } + private boolean isTagged(Statement.Type changeTag, Unit unit) { + return (isLeftStatement(unit) || isRightStatement(unit)) || (isInLeftStatementFLow(changeTag) || isInRightStatementFLow(changeTag)); + } + private boolean isInRightStatementFLow(Statement.Type changeTag) { return changeTag.equals(Statement.Type.SINK); } @@ -169,8 +173,7 @@ private void kill(Unit unit) { */ private void detectConflict(FlowSet in, Unit u, Statement.Type changeTag, SootMethod sm) { - if (!(isRightStatement(u) || isLeftStatement(u) || isInLeftStatementFLow(changeTag) - || isInRightStatementFLow(changeTag))) { + if (!isTagged(changeTag, u)) { return; }