Skip to content

Commit

Permalink
refactor(spgroup#31): is statement extract to isTagged method
Browse files Browse the repository at this point in the history
  • Loading branch information
barbosamaatheus committed Dec 22, 2020
1 parent 073fbb5 commit b03c518
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ private void traverse(SootMethod sm, List<SootMethod> 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?
Expand Down Expand Up @@ -123,6 +123,10 @@ private void traverse(SootMethod sm, List<SootMethod> 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);
}
Expand Down Expand Up @@ -169,8 +173,7 @@ private void kill(Unit unit) {
*/
private void detectConflict(FlowSet<DataFlowAbstraction> in, Unit u, Statement.Type changeTag, SootMethod sm) {

if (!(isRightStatement(u) || isLeftStatement(u) || isInLeftStatementFLow(changeTag)
|| isInRightStatementFLow(changeTag))) {
if (!isTagged(changeTag, u)) {
return;
}

Expand Down

0 comments on commit b03c518

Please sign in to comment.